sinatools.utils.text_transliteration¶
-
sinatools.utils.text_transliteration.
perform_transliteration
(text, schema)¶ This method takes a text and a schema as input and returns a tuple of two values: the transliteration of the text is based on the given schema and a flag indicating whether all characters in the text were transliterated or not.
- Parameters
- Returns
A tuple of two values: - The transliterated text based on the given schema. - A boolean flag indicating whether all characters in the input text were successfully transliterated or not.
- Return type
Example:
from sinatools.utils import text_transliteration print(text_transliteration.perform_transliteration("مُحَمَدٌ نَـشِيْطٌـ1" , "ar2bw")) print(text_transliteration.perform_transliteration("muHamadN" , "bw2ar")) print(text_transliteration.perform_transliteration("شَنُعُ۪ـ1" , "ar2bw")) print(text_transliteration.perform_transliteration("$aw~aH_2" , "bw2ar")) #output ('muHamadN na_$iyoTN_1', True) ('مُحَمَدٌ', True) ('$anuE-u_1', True) ('شَوَّح 2', True)