diff --git a/arabic_reshaper/arabic_reshaper.py b/arabic_reshaper/arabic_reshaper.py index 4721a6a..84e80b6 100644 --- a/arabic_reshaper/arabic_reshaper.py +++ b/arabic_reshaper/arabic_reshaper.py @@ -97,7 +97,7 @@ def _get_ligature_forms_from_re_group_index(self, group_index): return self._ligatures_re return self._re_group_index_to_ligature_forms[group_index] - def reshape(self, text): + def reshape(self, text, return_char_forms=False): if not text: return '' @@ -236,7 +236,10 @@ def reshape(self, text): if i in positions_harakat: result.extend(positions_harakat[i]) - return ''.join(result) + if return_char_forms: + return ''.join(result), output + else: + return ''.join(result) default_reshaper = ArabicReshaper()