Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:

jobs:
claude-review:
if: github.event.pull_request.head.repo.full_name == github.repository
# Optional: Filter by PR author
# if: |
# github.event.pull_request.user.login == 'external-contributor' ||
Expand Down
4 changes: 2 additions & 2 deletions arabic_reshaper/arabic_reshaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
'\u06d6-\u06dc'
'\u06df-\u06e8'
'\u06ea-\u06ed'
'\u08d4-\u08e1'
'\u08d4-\u08ed'
'\u0897-\u089f'
'\u08ca-\u08e1'
'\u08e3-\u08ff'
']',

Expand Down
30 changes: 30 additions & 0 deletions arabic_reshaper/tests/test_006_harakat_ranges.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import unittest

import arabic_reshaper


class TestHarakatRanges(unittest.TestCase):
def setUp(self):
self.keep = arabic_reshaper.ArabicReshaper(
configuration={'delete_harakat': False}
)

def test_extended_marks_do_not_break_joining(self):
# Combining marks added in later Unicode versions must not split
# the letters around them. U+FE91 and U+FE90 are initial and
# final beh.
for mark in ('\u0897', '\u089f', '\u08ca', '\u08d0', '\u08d3',
'\u08e1', '\u08e3', '\u08ff'):
with self.subTest(mark='U+%04X' % ord(mark)):
self.assertEqual(
self.keep.reshape('\u0628' + mark + '\u0628'),
'\ufe91' + mark + '\ufe90'
)

def test_disputed_end_of_ayah_is_not_a_haraka(self):
# U+08E2 is a format character, so deleting harakat keeps it.
self.assertIn('\u08e2', arabic_reshaper.reshape('\u0628\u08e2'))


if __name__ == '__main__':
unittest.main()
Loading