python-negar 1.4__tar.gz → 1.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,7 @@
1
+ 1.4.1 - 2025-01-06
2
+ -- Fixed issue with immutability check.
3
+ -- Added several additional immutable words.
4
+
1
5
  1.4 - 2025-01-05
2
6
  -- Added a new feature to ignore text after #> as a comment trigger.
3
7
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-negar
3
- Version: 1.4
3
+ Version: 1.4.1
4
4
  Summary: Negar is a spell corrector and Persian text editor
5
5
  Home-page: http://github.com/shahinism/python-negar
6
6
  Author: Shahin Azad
@@ -1,7 +1,7 @@
1
1
  import platform
2
2
  from pathlib import Path
3
3
 
4
- __version__ = "1.4"
4
+ __version__ = "1.4.1"
5
5
 
6
6
  DATAFILE = Path(__file__).parent.absolute() / "data/immutable.words"
7
7
  APPDATA = "AppData/Roaming/" if platform.system() == "Windows" else "."
@@ -194,6 +194,8 @@
194
194
  بلغارستان
195
195
  بلوچستان
196
196
  بلوچستان
197
+ بمان
198
+ بمانی
197
199
  بنانها
198
200
  بنگستان
199
201
  بنگستان
@@ -213,6 +215,8 @@
213
215
  بهترین
214
216
  به‌تنهایی
215
217
  بهمان
218
+ بهمان
219
+ بهمانی
216
220
  بوتان
217
221
  بودنتان
218
222
  بوستان
@@ -337,6 +341,9 @@
337
341
  بیبل
338
342
  بی‌بها
339
343
  بی‌بهایی
344
+ بیبی
345
+ بیبی‌فیس
346
+ بیبی‌گرل
340
347
  بیت
341
348
  بیت‌التکمه‌ها
342
349
  بیت‌الحکمه
@@ -416,6 +423,7 @@
416
423
  بیدی
417
424
  بیر
418
425
  بیرالده
426
+ بیرانوند
419
427
  بیراه
420
428
  بیراهه
421
429
  بیراهه‌ها
@@ -800,6 +808,7 @@
800
808
  پاک‌نها
801
809
  پانسمان
802
810
  پایتان
811
+ پخشان
803
812
  پراستر
804
813
  پراشتها
805
814
  پرالتها
@@ -883,6 +892,9 @@
883
892
  تنهای
884
893
  تنهایی
885
894
  تنهایی
895
+ تنهایی‌ها
896
+ تنهایی‌های
897
+ تنهایی‌هایی
886
898
  تنوره‌کشان
887
899
  تهیدستان
888
900
  توتستان
@@ -910,8 +922,15 @@
910
922
  چایمان
911
923
  چپ‌دستان
912
924
  چچستان
925
+ چشمانتان
926
+ چشمان‌تان
927
+ چشمانشان
928
+ چشمان‌شان
929
+ چشمانمان
930
+ چشمان‌مان
913
931
  چنارستان
914
932
  چیستان
933
+ حاکمان
915
934
  حرفتان
916
935
  حسابتان
917
936
  حصیرستان
@@ -978,6 +997,7 @@
978
997
  دفتری
979
998
  دکتر
980
999
  دکتری
1000
+ دکترین
981
1001
  دلستر
982
1002
  دنیاپرستان
983
1003
  دهستان
@@ -1065,6 +1085,8 @@
1065
1085
  شبستری
1066
1086
  شبها
1067
1087
  شتان
1088
+ شتر
1089
+ شتری
1068
1090
  شعردوستان
1069
1091
  شفها
1070
1092
  شکرافشان
@@ -1860,6 +1882,8 @@
1860
1882
  هلی‌کوپتر
1861
1883
  هلیکوپتر
1862
1884
  همان
1885
+ همان
1886
+ همان‌ها
1863
1887
  همانی
1864
1888
  هم‌بستر
1865
1889
  هم‌پیمان
@@ -130,7 +130,7 @@ class PersianEditor:
130
130
  """Remove immutable words temporarily and reapply them at the end of the process."""
131
131
  if state == State.save:
132
132
  self.immutable_words = {}
133
- words = self.text.split()
133
+ words = re.findall(r"\b[\w\u200c]+\b", self.text, re.UNICODE)
134
134
  for i, word in enumerate(words):
135
135
  if (word := word.strip()) in ImmutableWords.get():
136
136
  self.immutable_words[i] = word
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-negar
3
- Version: 1.4
3
+ Version: 1.4.1
4
4
  Summary: Negar is a spell corrector and Persian text editor
5
5
  Home-page: http://github.com/shahinism/python-negar
6
6
  Author: Shahin Azad
@@ -139,11 +139,16 @@ class Test(unittest.TestCase):
139
139
  self.input_ = "بیستم ماه میلادی"
140
140
  self.output_ = "بیستم ماه میلادی"
141
141
 
142
- @_assertEqual("Ignote Comment")
142
+ @_assertEqual("Ignore Comment")
143
143
  def test_ignore_comment(self):
144
144
  self.input_ = "کشیـــــــــده شده اند #> می نویسد .... "
145
145
  self.output_ = "کشیده شده‌اند #> می نویسد .... "
146
146
 
147
+ @_assertEqual("mix_parentheses_suffix")
148
+ def test_mix_parentheses_suffix(self):
149
+ self.input_ = '"دختر تنهایی " ( کهتر بمان )'
150
+ self.output_ = "«دختر تنهایی» (کهتر بمان)"
151
+
147
152
 
148
153
  if __name__ == "__main__":
149
154
  unittest.main()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes