toMrzAlphabet

open override fun toMrzAlphabet(normalizedInput: String): TransliterationResult

Maps text to the MRZ alphabet and always succeeds.

Characters already in the MRZ alphabet pass through, and lowercase Latin letters become uppercase. Accented Latin letters lose their accent (Ä becomes A). Æ becomes AE, Œ becomes OE, ß becomes SS, Þ becomes TH, Ð becomes D, and IJ becomes IJ. Apostrophes and other punctuation are dropped. A comma between two name parts becomes one <, with or without a space next to it (ANNA, MARIA and ANNA,MARIA both give ANNA<MARIA); a comma at the start or the end is dropped.

Cyrillic letters follow the main values of Section 6.B, capital and small alike (Ж becomes ZH, Щ becomes SHCH). The table's language exceptions are not applied here; they are in the profiles of IcaoCyrillicLanguageProfiles.

Arabic-script letters follow Section 6.C, plus veh and feh with 3 dots below from Appendix B. Short vowels, sukun, superscript alef, tatweel and the four letters the table marks "not encoded" produce nothing. Teh marbuta is XTA, or XAH at the end of a name part. Shadda repeats the letter before it (XDZ becomes XDZXDZ).

Every other character, including space, hyphen, the schwa Ə, and Greek letters, becomes <.

Return

TransliterationResult.Success with the mapped text and any characters with no mapping.

Parameters

normalizedInput

The text, already in Unicode NFC.