tetrak_translit.transliterate¶
- tetrak_translit.transliterate(text, scheme='ala_lc', *, script=None, to='latin', orthography=None)[source]¶
Transliterate text between a script and scheme.
- Parameters:
text (str) – The text. For
to="latin"the script’s letters in it are rendered and everything else is passed through; otherwise the whole string is read as Latin in scheme.scheme (str | Scheme) – A scheme key (
"ala_lc","iso_9985","bgn_pcgn","hubschmann_meillet","western"for Armenian;"ala_lc","iso_9984","national"for Georgian), optionally qualified with the script ("ka/ala_lc"), or aScheme.script (str | Script | None) – Which script, when the text and the key do not settle it: a key (
"hy","ka") or name ("Armenian").to (str) –
"latin"(the default);"script"to read Latin back; or a script key or name, which reads back into that script.orthography (str | None) – For Armenian,
"classical"or"reformed", when rendering through a scheme whose rules depend on it (ALA-LC). By default it is detected from text; a short string with no tell is indeterminate and gets none of the orthography-specific rules, so say so when you know.
- Returns:
The transliterated string.
- Raises:
UnknownSchemeError – scheme names no table, or tables in several scripts with nothing to choose between them.
UnknownScriptError – script or to names no script.
NotReversibleError – reading back through a lossy scheme.
- Return type: