File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,10 @@ def get_glyph_type(target):
153153
154154def is_haraka (target ):
155155 return target in HARAKAT
156-
156+
157+ def replace_jalalah (unshaped_word ):
158+ return re .sub (u'^\u0627 \u0644 \u0644 \u0647 $' , u'\uFDF2 ' , unshaped_word )
159+
157160def replace_lam_alef (unshaped_word ):
158161 list_word = list (unshaped_word )
159162 letter_before = u''
@@ -226,6 +229,7 @@ def reconstruct_word(self, reshaped_word):
226229 return u'' .join (l )
227230
228231def get_reshaped_word (unshaped_word ):
232+ unshaped_word = replace_jalalah (unshaped_word )
229233 unshaped_word = replace_lam_alef (unshaped_word )
230234 decomposed_word = DecomposedWord (unshaped_word )
231235 result = u''
@@ -321,4 +325,4 @@ def reshape_sentence(sentence):
321325 for j in range (len (mixed_words )):
322326 mixed_words [j ] = get_reshaped_word (mixed_words [j ])
323327 words [i ] = u'' .join (mixed_words )
324- return u' ' .join (words )
328+ return u' ' .join (words )
You can’t perform that action at this time.
0 commit comments