python script for arabic text transcription
Project description
Phonetic Transcription
The phonetic transcription below is based on the scheme found in Arabic Through the Quran by Alan Jones (Islamic Texts Society, 2008). The correct form of pronunciation will depend on context, especially for the letters hamza and alif maksūra. The basic form of transcription is shown below.
Phonetic transcription for letters
Letter | Transcription | |
---|---|---|
0 | alif | ā |
1 | bā | b |
2 | tā | t |
3 | thā | th |
4 | jīm | j |
5 | ḥā | ḥ |
6 | khā | kh |
7 | dāl | d |
8 | dhāl | dh |
9 | rā | r |
10 | zāy | z |
11 | sīn | s |
12 | shīn | sh |
13 | ṣād | ṣ |
14 | ḍād | ḍ |
15 | ṭā | ṭ |
16 | ẓā | ẓ |
17 | ʿayn | ʿ |
18 | ghayn | gh |
19 | fā | f |
20 | qāf | q |
21 | kāf | k |
22 | lām | l |
23 | mīm | m |
24 | nūn | n |
25 | hā | h |
26 | wāw | w |
27 | yā | y |
28 | hamza | ' |
29 | alif maksura | ā |
30 | ta marbūta | t |
Phonetic transcription for diactrics
Diacritic | Transcription | |
---|---|---|
0 | fathatan | an |
1 | dammatan | un |
2 | kasratan | in |
3 | fatha | a |
4 | damma | u |
5 | kasra | i |
6 | shadda | (double) |
7 | sukūn | ' |
The long vowels are indicated by ā, ī and ū, and the maddah may also be used to lengthen a vowel. The shadda is indicated by the doubling of a letter
Usage
Python 3.9 or later required
pip install arab-transliterator
python -m arab_transliterator.transliterator [-t arab_text] [-f arab_file]
Ex1.
python -m arab_transliterator.transliterator -t "وَلَقَدْ آتَيْنَا مُوسَى الْكِتَابَ وَقَفَّيْنَا مِن بَعْدِهِ بِالرُّسُلِ ۖ وَآتَيْنَا عِيسَى ابْنَ مَرْيَمَ الْبَيِّنَاتِ وَأَيَّدْنَاهُ بِرُوحِ الْقُدُسِ ۗ أَفَكُلَّمَا جَاءَكُمْ رَسُولٌ بِمَا لَا تَهْوَىٰ أَنفُسُكُمُ اسْتَكْبَرْتُمْ فَفَرِيقًا كَذَّبْتُمْ وَفَرِيقًا تَقْتُلُونَ
"
output
walaqad ’ātaynā mūsá l-kitāba waqaffaynā min baʿdihi birrusuli wa’ātaynā ʿīsá b-na maryama l-bayyināti wa'ayyadnāhu birūḥi l-qudusi afakullamā jā'akum rasūlun bimā lā tahwá anfusukumu s-takbartum fafarīqan kadhdhabtum wafarīqan taqtulūna
Ex2
>>> from arab_transliterator.transliterator import ArabTransliterator
>>> Trans = ArabTransliterator()
>>> Trans.translate("وَفَرِيقًا تَقْتُلُونَ")
'wafarīqan taqtulūna'
>>>
Contributors
Feel free to contribute by making pull-requests or writing issues. Thanks
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file arab_transliterator-1.0.3.tar.gz
.
File metadata
- Download URL: arab_transliterator-1.0.3.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78bb08c4a8e0777f730df994a4589a23693a860ef6d0cd905ce1649689924ec6 |
|
MD5 | 8a8924f9565d728c4029a1e3e9a65151 |
|
BLAKE2b-256 | 0e9a74e2ac8885f88e79ae26764acdc3ab19dac78d5901c6f6f122f87ec6cf73 |
File details
Details for the file arab_transliterator-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: arab_transliterator-1.0.3-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e03b4544873c92103cf28cce85e27cec2f517b799cafb9ea982face1ac403d2e |
|
MD5 | 1c636effc65d6483a8fdaebff0f461c1 |
|
BLAKE2b-256 | 5c13e924ebbb91c6800da498b2c6c6cc7825353fecbf29b459d38f7922c2ee19 |