mpcabd / python-arabic-reshaper

Reconstruct Arabic sentences to be used in applications that don't support Arabic
MIT License
395 stars 81 forks source link

dropping diacritics? #68

Closed esalesky closed 3 years ago

esalesky commented 3 years ago

Hi,

I am trying to use this package to render images of Arabic text with pygame. I'm observing that the reshaper package appears to drops diacritics -- I'd particularly like to keep them in if possible, and I think this is unexpected from your original blog post.

Use:

import arabic_reshaper
from bidi.algorithm import get_display

text_to_be_reshaped = 'أَنا كَنَدِيَّةٍ ، وَأَنا أَصْغَرِ إِخْوانِي السَبْعَةِ '
reshaped_text = arabic_reshaper.reshape(text_to_be_reshaped)
bidi_text = get_display(reshaped_text)

Printing before and after (using NotoSansArabic, which supports diacritics etc):

Screen Shot 2021-05-17 at 12 46 27 PM

Similarly in the demo linked from your blog post:

Screen Shot 2021-05-17 at 12 44 44 PM

Thank you for any pointers! --Liz

esalesky commented 3 years ago

I have since found the configuration options in the README and disabled 'delete_harakat' etc. Thank you very much for a very helpful package!!

--Liz