Open jacobwegner opened 12 months ago
$ echo 'عمر الى شَيْخْ حنته' > sample.txt
$ camel_transliterate -s ar2safebw sample.txt
Emr AlY cayoxo Hnth
I need to install some additional dependencies to get camel_tools installed on macOS.
Via their Python CLI:
from camel_tools.utils.charmap import CharMapper
from camel_tools.utils.transliterate import Transliterator
ar2safebw = CharMapper.builtin_mapper('ar2safebw')
transliterator = Transliterator(ar2safebw)
transliterator.transliterate('عمر الى شَيْخْ حنته')
'Emr AlY cayoxo Hnth'
refs https://github.com/scaife-viewer/beyond-translation-site/issues/91#issuecomment-1238571736
@jchill-git mentioned that CAMeL may offer an improved approach to transliteration.
Here is the current transliterator applied to Arabic text:
https://icu4c-demos.unicode.org/icu-bin/translit
Building on #163, we may want to add a token-level field for transliteration.