diff --git a/arabic_reshaper/letters.py b/arabic_reshaper/letters.py index 45415d8..7ffe780 100644 --- a/arabic_reshaper/letters.py +++ b/arabic_reshaper/letters.py @@ -468,6 +468,8 @@ '\u06B1': ('\u06B1', '\uFB9C', '\uFB9D', '\uFB9B'), # ARABIC LETTER GUEH '\u06B3': ('\u06B3', '\uFB98', '\uFB99', '\uFB97'), + # KURDISH LETTER LAM WITH SMALL V + '\u06B5': ('\u06B5', '\uE008', '\uE009', '\uE007'), # ARABIC LETTER NOON GHUNNA '\u06BA': ('\u06BA', '', '', '\uFB9F'), # ARABIC LETTER RNOON diff --git a/arabic_reshaper/tests/test_005_kurdish.py b/arabic_reshaper/tests/test_005_kurdish.py new file mode 100644 index 0000000..d1ab76d --- /dev/null +++ b/arabic_reshaper/tests/test_005_kurdish.py @@ -0,0 +1,46 @@ +import unittest + +import arabic_reshaper + + +class TestKurdishLamWithSmallV(unittest.TestCase): + """U+06B5 has no Unicode presentation forms. Kurdish fonts draw its + initial, medial and final forms from private-use code points + U+E008, U+E009 and U+E007.""" + + def setUp(self): + self.reshaper = arabic_reshaper.ArabicReshaper( + configuration={'language': 'Kurdish'} + ) + + def test_forms(self): + cases = ( + # isolated + ('ڵ', 'ڵ'), + # initial, before meem + ('ڵم', 'ﻢ'), + # medial, between two meems + ('مڵم', 'ﻣﻢ'), + # final, after meem + ('مڵ', 'ﻣ'), + ) + for text, expected in cases: + with self.subTest(text=text): + self.assertEqual(self.reshaper.reshape(text), expected) + + def test_words(self): + cases = ( + # سڵاو (hello): medial + ('سڵاو', 'ﺳﺎو'), + # وڵات (country): initial, because waw does not join forward + ('وڵات', 'وﺎت'), + # گوڵ (flower): isolated, after waw + ('گوڵ', 'ﮔﻮڵ'), + ) + for text, expected in cases: + with self.subTest(text=text): + self.assertEqual(self.reshaper.reshape(text), expected) + + +if __name__ == '__main__': + unittest.main()