Skip to content

Commit 47dc979

Browse files
committed
Updated by Marko Luther <[email protected]> to work with Python 3.x, still compatible with 2.x
1 parent ae4231a commit 47dc979

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arabic_reshaper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@
140140
]
141141

142142
def get_reshaped_glyph(target, location):
143-
if ARABIC_GLYPHS.has_key(target):
143+
if target in ARABIC_GLYPHS:
144144
return ARABIC_GLYPHS[target][location]
145145
else:
146146
return target
147147

148148
def get_glyph_type(target):
149-
if ARABIC_GLYPHS.has_key(target):
149+
if target in ARABIC_GLYPHS:
150150
return ARABIC_GLYPHS[target][5]
151151
else:
152152
return 2
@@ -266,7 +266,7 @@ def reshape_it(unshaped_word):
266266

267267

268268
def is_arabic_character(target):
269-
return ARABIC_GLYPHS.has_key(target) or target in HARAKAT
269+
return target in ARABIC_GLYPHS or target in HARAKAT
270270

271271
def get_words(sentence):
272272
if sentence:

0 commit comments

Comments
 (0)