Skip to content

Commit c0e02d8

Browse files
committed
Added usage example
1 parent 47dc979 commit c0e02d8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

arabic_reshaper.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99

1010
# Ported and tweaked from Java to Python, from Better Arabic Reshaper [https://github.com/agawish/Better-Arabic-Reshaper/]
1111

12+
# Usage:
13+
### Install python-bidi [https://github.com/MeirKriheli/python-bidi], can be installed from pip `pip install python-bidi`.
14+
15+
# import arabic_reshaper
16+
# from bidi.algorithm import get_display
17+
# reshaped_text = arabic_reshaper.reshape(u'اللغة العربية رائعة')
18+
# bidi_text = get_display(reshaped_text)
19+
### Now you can pass `bidi_text` to any function that handles displaying/printing of the text, like writing it to PIL Image or passing it to a PDF generating method.
20+
1221
import re
1322

1423
DEFINED_CHARACTERS_ORGINAL_ALF_UPPER_MDD = u'\u0622'

0 commit comments

Comments
 (0)