Skip to content

Convert Arabic characters to their English (Latin) homophone.

License

Notifications You must be signed in to change notification settings

rexa222/arabic2latin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arabic2latin

Convert Arabic and Persian (Farsi) characters to their English homophone.

Installation

Install from PyPI:

pip install arabic2latin

Alternatively, install from source:

pip install git+https://github.com/rexa222/arabic2latin

Usage/Examples

from arabic2latin import arabic_to_latin

arabic_text = "السَّلَامُ عَلَيْكَ"
arabic_converted_text = arabic_to_latin(arabic_text)

persian_text = "سلام بر همگی"
persian__converted_text = arabic_to_latin(persian_text)

print("Arbic converted text: " + converted_text)
print("Persian converted text: " + converted_text)

Output:

Arbic converted text: alsaalaamo aalayka
Persian converted text: salam bar hamagy

Debug Mode

If you came across a character that was not converted, you can find it using debug feature and report it as guided in the contributing section.

converted_text = arabic_to_latin(arabic_text, debug=True)

Output:

unknown character: ?

Contributing

If you find a bug 🐛, please open a bug report. If you have an idea for an improvement or new feature 🚀, please open a feature request.