Skip to content

Commit

Permalink
Fix Shadda ligatures
Browse files Browse the repository at this point in the history
  • Loading branch information
mpcabd committed Nov 20, 2017
1 parent 75df1ed commit 135a6b8
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 6 deletions.
2 changes: 1 addition & 1 deletion arabic_reshaper/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.0.9'
__version__ = '2.0.10'
11 changes: 10 additions & 1 deletion arabic_reshaper/default-config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,17 @@ ARABIC LIGATURE SEEN WITH MEEM WITH JEEM = no
ARABIC LIGATURE SEEN WITH MEEM WITH MEEM = no
ARABIC LIGATURE SEEN WITH REH = no
ARABIC LIGATURE SEEN WITH YEH = no
ARABIC LIGATURE SHADDA WITH DAMMA = no
ARABIC LIGATURE SHADDA WITH DAMMATAN ISOLATED FORM = no
ARABIC LIGATURE SHADDA WITH KASRATAN ISOLATED FORM = no
ARABIC LIGATURE SHADDA WITH FATHA ISOLATED FORM = no
ARABIC LIGATURE SHADDA WITH DAMMA ISOLATED FORM = no
ARABIC LIGATURE SHADDA WITH KASRA ISOLATED FORM = no
ARABIC LIGATURE SHADDA WITH SUPERSCRIPT ALEF ISOLATED FORM = no
ARABIC LIGATURE SHADDA WITH FATHA MEDIAL FORM = no
ARABIC LIGATURE SHADDA WITH DAMMA MEDIAL FORM = no
ARABIC LIGATURE SHADDA WITH KASRA MEDIAL FORM = no
ARABIC LIGATURE SHADDA WITH FATHA = no
ARABIC LIGATURE SHADDA WITH DAMMA = no
ARABIC LIGATURE SHADDA WITH KASRA = no
ARABIC LIGATURE SHEEN WITH ALEF MAKSURA = no
ARABIC LIGATURE SHEEN WITH HAH = no
Expand Down
66 changes: 62 additions & 4 deletions arabic_reshaper/ligatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,15 +661,73 @@
('ARABIC LIGATURE SEEN WITH YEH', (
'\u0633\u064A', ('\uFCFC', '', '', '\uFD18'),
)),
('ARABIC LIGATURE SHADDA WITH DAMMA', (
'\u0640\u064F\u0651', ('', '', '\uFCF3', ''),

# Arabic ligatures with Shadda, the order of characters doesn't matter
('ARABIC LIGATURE SHADDA WITH DAMMATAN ISOLATED FORM', (
'(?:\u064C\u0651|\u0651\u064C)',

('\uFC5E', '\uFC5E', '\uFC5E', '\uFC5E'),
)),
('ARABIC LIGATURE SHADDA WITH KASRATAN ISOLATED FORM', (
'(?:\u064D\u0651|\u0651\u064D)',

('\uFC5F', '\uFC5F', '\uFC5F', '\uFC5F'),
)),
('ARABIC LIGATURE SHADDA WITH FATHA ISOLATED FORM', (
'(?:\u064E\u0651|\u0651\u064E)',

('\uFC60', '\uFC60', '\uFC60', '\uFC60'),
)),
('ARABIC LIGATURE SHADDA WITH DAMMA ISOLATED FORM', (
'(?:\u064F\u0651|\u0651\u064F)',

('\uFC61', '\uFC61', '\uFC61', '\uFC61'),
)),
('ARABIC LIGATURE SHADDA WITH KASRA ISOLATED FORM', (
'(?:\u0650\u0651|\u0651\u0650)',

('\uFC62', '\uFC62', '\uFC62', '\uFC62'),
)),
('ARABIC LIGATURE SHADDA WITH SUPERSCRIPT ALEF ISOLATED FORM', (
'(?:\u0670\u0651|\u0651\u0670)',

('\uFC63', '\uFC63', '\uFC63', '\uFC63'),
)),

# There is a special case when they are with Tatweel
('ARABIC LIGATURE SHADDA WITH FATHA MEDIAL FORM', (
'\u0640(?:\u064E\u0651|\u0651\u064E)',

('\uFCF2', '\uFCF2', '\uFCF2', '\uFCF2'),
)),
('ARABIC LIGATURE SHADDA WITH DAMMA MEDIAL FORM', (
'\u0640(?:\u064F\u0651|\u0651\u064F)',

('\uFCF3', '\uFCF3', '\uFCF3', '\uFCF3'),
)),
('ARABIC LIGATURE SHADDA WITH KASRA MEDIAL FORM', (
'\u0640(?:\u0650\u0651|\u0651\u0650)',

('\uFCF4', '\uFCF4', '\uFCF4', '\uFCF4'),
)),

# Repeated with different keys to be backward compatible
('ARABIC LIGATURE SHADDA WITH FATHA', (
'\u0640\u064E\u0651', ('', '', '\uFCF2', ''),
'\u0640(?:\u064E\u0651|\u0651\u064E)',

('\uFCF2', '\uFCF2', '\uFCF2', '\uFCF2'),
)),
('ARABIC LIGATURE SHADDA WITH DAMMA', (
'\u0640(?:\u064F\u0651|\u0651\u064F)',

('\uFCF3', '\uFCF3', '\uFCF3', '\uFCF3'),
)),
('ARABIC LIGATURE SHADDA WITH KASRA', (
'\u0640\u0650\u0651', ('', '', '\uFCF4', ''),
'\u0640(?:\u0650\u0651|\u0651\u0650)',

('\uFCF4', '\uFCF4', '\uFCF4', '\uFCF4'),
)),

('ARABIC LIGATURE SHEEN WITH ALEF MAKSURA', (
'\u0634\u0649', ('\uFCFD', '', '', '\uFD19'),
)),
Expand Down

0 comments on commit 135a6b8

Please sign in to comment.