Consider the following string of text:
All of the following words use the letter ر (also known as resh or raa).
The letter ر is almost the same as the English ‘R‘ sound.
"ﺭَﺃَﺏَ, ﺭَﺃَﺱَ, ﺭَﺃﺱ, ﺭَﺋِﻴﺲ, ﺭَﺋِﻴﺴِﻲّ "
Suppose that someone fluent in English wanted to learn arabian writing (حروف) one letter at a time by writing arabian in the English writing system, except that the student replaced the letter R
with one arabic letter resh.
After practicing with a few paragraphs, the student begins to use two arabian letters instead of one letter.
Eventually, the entire text is written in arabian حروف.
At first, I was hoping to replace one arabian letter only.
text = "ﺭَﺃَﺏَ, ﺭَﺃَﺱَ, ﺭَﺃﺱ, ﺭَﺋِﻴﺲ, ﺭَﺋِﻴﺴِﻲّ "
rtext = repr(text.encode('utf-8'))
# the letter `xd8xb1` (raa or resh) represents the 'R' sound.
# text = text.replace('ر', "R")
rtext = rtext.replace("\xd8\xb1", "R")
print(text)
print(40*'#')
print(rtext)
The problem is that "\xd8\xb1"
is not the only unicode encoding for the letter resh. None of the reshes were replaced, because they are written as resh with an accent on top.
How do I use python to replace the Arabian letter resh
with an English or latin-style letter R
What are the other choices for resh?
In European languages, there exist Unicode numbers for R
with an accent written above the letter.
Symbol | Base Sixteen Hexidecimal Notation |
Base Ten Decimal Notation |
---|---|---|
Ŕ |
154 |
340 |
Ŗ |
156 |
342 |
Ř |
158 |
344 |
Ȑ |
210 |
528 |
Ȓ |
212 |
530 |
Ṙ |
1E58 |
7698 |
Ṛ |
1E5A |
7770 |
Ṟ |
1E5E |
7774 |
ᴿ |
1D3F |
7487 |
???? |
1D411 |
119825 |
ℝ |
52 |
82 |
Ⓡ |
24C7 |
9415 |
Whare are the unicode values for all of the variants on the arabian letter RA (also known as resh)?