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
4 changes: 2 additions & 2 deletions build/lib/sinatools/utils/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ def remove_punctuation(text):
يَا أَيُّهَا الَّذِينَ آمَنُوا لِيَسْتَأْذِنْكُمُ

"""
output_string = text
try:
if text:
punctuation_marks = [r'[\u0021-\u002F]+', r'[U+060C]+', r'[\u003A-\u0040]+',
r'[\u005B-\u0060]+', r'[\u007B-\u007E]+', r'[\u060C]+',
r'[\u061B]+', r'[\u061E]+', r'[\u061F]+', r'[\u0640]+',
r'[\u0653]+', r'[\u065C]+', r'[\u066C]+', r'[\u066A]+',
r'["}"]+', r'["{"]+']
output_string = text
for punctuation in punctuation_marks:
output_string = re.sub(punctuation, '', output_string)
except:
Expand Down Expand Up @@ -138,4 +138,4 @@ def remove_latin(text):
except:
return text
return text


4 changes: 2 additions & 2 deletions sinatools/utils/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ def remove_punctuation(text):
يَا أَيُّهَا الَّذِينَ آمَنُوا لِيَسْتَأْذِنْكُمُ

"""
output_string = text
try:
if text:
punctuation_marks = [r'[\u0021-\u002F]+', r'[U+060C]+', r'[\u003A-\u0040]+',
r'[\u005B-\u0060]+', r'[\u007B-\u007E]+', r'[\u060C]+',
r'[\u061B]+', r'[\u061E]+', r'[\u061F]+', r'[\u0640]+',
r'[\u0653]+', r'[\u065C]+', r'[\u066C]+', r'[\u066A]+',
r'["}"]+', r'["{"]+']
output_string = text
for punctuation in punctuation_marks:
output_string = re.sub(punctuation, '', output_string)
except:
Expand Down Expand Up @@ -138,4 +138,4 @@ def remove_latin(text):
except:
return text
return text