You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to transliterate Arabic to Tunisian and getting the aaransia.exceptions.SourceLanguageError exception with almost every single sentence. This is what I have tried.
>>> from aaransia import transliterate, SourceLanguageError
>>> ar = "ﺎﻨﻫ ﻒﻋﻻ ﺵﺮﻓ ﻊﻈﻴﻣ ﻞﻳ ﺎﻧ ﺄﺼﻋﺩ ﺎﻠﻤﻨﺻﺓ ﻞﻠﻣﺭﺓ ﺎﻠﺛﺎﻨﻳﺓ. ﺄﻧﺍ ﻒﻳ ﻍﺎﻳﺓ ﺍﻼﻤﺘﻧﺎﻧ"
>>> transliterate(ar, source = "ar", target = "tn")
Traceback (most recent call last):
File "/home/centos/.local/lib/python3.6/site-packages/aaransia/transliteration.py", line 103, in transliterate
text.split())))
File "/home/centos/.local/lib/python3.6/site-packages/aaransia/transliteration.py", line 102, in <lambda>
return ' '.join(list(map(lambda word: _transliterate_word(word, source, target, universal),
File "/home/centos/.local/lib/python3.6/site-packages/aaransia/transliteration.py", line 90, in _transliterate_word
return u''.join(result).replace(u'\u200e', '')
TypeError: sequence item 0: expected str instance, NoneType found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/centos/.local/lib/python3.6/site-packages/aaransia/transliteration.py", line 105, in transliterate
raise SourceLanguageError(f'{SOURCE_LANGUAGE_EXCEPTION_MESSAGE}: {source}')
aaransia.exceptions.SourceLanguageError: Source alphabet language doesn't match the input text: ar
However, when tried with universal = True , I got the same sentence back. What is wrong?
I am trying to transliterate Arabic to Tunisian and getting the
aaransia.exceptions.SourceLanguageError
exception with almost every single sentence. This is what I have tried.However, when tried with
universal = True
, I got the same sentence back. What is wrong?I think some Arabic alphabets are missing. What is the fix? Or I am doing something wrong?
The text was updated successfully, but these errors were encountered: