Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override transliterator #164

Open
jacobwegner opened this issue Jul 13, 2023 · 2 comments
Open

Override transliterator #164

jacobwegner opened this issue Jul 13, 2023 · 2 comments

Comments

@jacobwegner
Copy link
Contributor

jacobwegner commented Jul 13, 2023

refs #91 (comment)

@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

image

Building on #163, we may want to add a token-level field for transliteration.

@jacobwegner
Copy link
Contributor Author

via camel_transliterate

$ 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.

@jacobwegner
Copy link
Contributor Author

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant