From 44f5e85177e53cc656f1f6482d1631fbc24a0190 Mon Sep 17 00:00:00 2001 From: anqorithm <61029571+anqorithm@users.noreply.github.com> Date: Mon, 2 Nov 2026 04:47:50 +0100 Subject: [PATCH 1/2] Add Kurdish letter lam with small v to the Kurdish table U+06B5 was missing, so it stayed unshaped in Kurdish text. Signed-off-by: anqorithm <61029571+anqorithm@users.noreply.github.com> --- arabic_reshaper/letters.py | 2 ++ arabic_reshaper/tests/test_005_kurdish.py | 25 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 arabic_reshaper/tests/test_005_kurdish.py 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..e11a1a6 --- /dev/null +++ b/arabic_reshaper/tests/test_005_kurdish.py @@ -0,0 +1,25 @@ +import unittest + +import arabic_reshaper + + +class TestKurdishLamWithSmallV(unittest.TestCase): + def setUp(self): + self.reshaper = arabic_reshaper.ArabicReshaper( + configuration={'language': 'Kurdish'} + ) + + def test_forms(self): + cases = ( + ('ڵ', 'ڵ'), + ('ڵم', ''), + ('مڵم', ''), + ('مڵ', ''), + ) + for text, form in cases: + with self.subTest(text=text): + self.assertIn(form, self.reshaper.reshape(text)) + + +if __name__ == '__main__': + unittest.main() From c5736785956c238b21cd9f965c3287e6a7e2d8e3 Mon Sep 17 00:00:00 2001 From: Abdullah Diab Date: Mon, 2 Nov 2026 15:47:44 +0400 Subject: [PATCH 2/2] Make the lam with small v test exact and readable - Write the private-use code points as escapes so the expected values are visible in diffs and editors. - Compare the whole reshaped output with assertEqual instead of assertIn, so a wrongly shaped neighbour or extra output also fails. - Add real Kurdish words that put the letter after a non-joining letter. Co-Authored-By: Claude Opus 5.5 --- arabic_reshaper/tests/test_005_kurdish.py | 31 +++++++++++++++++++---- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/arabic_reshaper/tests/test_005_kurdish.py b/arabic_reshaper/tests/test_005_kurdish.py index e11a1a6..d1ab76d 100644 --- a/arabic_reshaper/tests/test_005_kurdish.py +++ b/arabic_reshaper/tests/test_005_kurdish.py @@ -4,6 +4,10 @@ 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'} @@ -11,14 +15,31 @@ def setUp(self): 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, form in cases: + for text, expected in cases: with self.subTest(text=text): - self.assertIn(form, self.reshaper.reshape(text)) + self.assertEqual(self.reshaper.reshape(text), expected) if __name__ == '__main__':