Skip to content

Commit

Permalink
Fixed issue #19; *hayeshan$
Browse files Browse the repository at this point in the history
  • Loading branch information
javadr committed Mar 31, 2022
1 parent 800dc45 commit 5d9d54c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.9.3 - 2022-03-31
-- Fixed issue #19; some cases than ended with *hayeshan (کتابهایشان)

0.9.2 - 2022-03-30
-- Fixed some issues with ^bi*
-- Fixed the issue of extra ZWNJ beside brackets
Expand Down
2 changes: 1 addition & 1 deletion negar/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pathlib import Path

__version__ = "0.9.2"
__version__ = "0.9.3"

LOGO = (Path(__file__).parent.absolute()/"logo.png").as_posix()
DATAFILE = Path(__file__).parent.absolute()/"data/untouchable.dat"
Expand Down
1 change: 1 addition & 0 deletions negar/data/untouchable.dat
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,7 @@
کم‌بها
کمتر
کنتر
کهتر
کهکشان
کوپنها
کودکستان
Expand Down
10 changes: 5 additions & 5 deletions negar/virastar.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ def fix_suffix_spacing(self):
regex = re.compile(
r"""\s+
(تر(ی(ن)?)?
|ها(ی(ی)?)?
|[تمش]ان)
|[تمش]ان
|ها(ی(ی|ت|م|ش|تان|شان)?)?)
\b""",
re.VERBOSE
)
Expand All @@ -164,10 +164,10 @@ def fix_suffix_spacing(self):
def fix_suffix_separate(self):
"""Puts ZWNJ between a word with its suffix (haye, ...)"""
regex = re.compile(
r"""(\S+)
r"""(\S+?) # not-greedy fetch to handle some case like هایشان instead شان
(تر(ی(ن)?)?
|ها(ی(ی)?)?|
[تمش]ان)\b""",
|[تمش]ان
|ها(ی(ی|ت|م|ش|تان|شان)?)?)\b""",
re.VERBOSE
)
wlist = self.text.split(" ")
Expand Down

0 comments on commit 5d9d54c

Please sign in to comment.