korcen 0.3.8__tar.gz → 0.3.10__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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: korcen
3
- Version: 0.3.8
3
+ Version: 0.3.10
4
4
  Summary: 한국어 비속어 검열
5
5
  Home-page: https://github.com/KR-korcen/korcen
6
6
  Author: Tanat
@@ -15,4 +15,4 @@ except ImportError as e:
15
15
 
16
16
 
17
17
  __all__ = [name for name, obj in locals().items()
18
- if not (name.startswith('_') or inspect.ismodule(obj))]
18
+ if not (name.startswith('_') or inspect.ismodule(obj))]
@@ -2,7 +2,6 @@ import re
2
2
  from better_profanity import profanity
3
3
  from collections import OrderedDict
4
4
 
5
-
6
5
  profanity.load_censor_words()
7
6
 
8
7
  cache_size = 0
@@ -15,12 +14,12 @@ def save_text(id, text):
15
14
  cache.move_to_end(id)
16
15
  content = cache[id] + text
17
16
  cache[id] = text
18
- if len(cache) == cache_size:
17
+ if len(cache) <= cache_size:
19
18
  cache.popitem(last=False)
20
19
  return content
21
20
 
22
21
 
23
- if len(cache) == cache_size:
22
+ if len(cache) <= cache_size:
24
23
  cache.popitem(last=False)
25
24
 
26
25
  cache[id] = text
@@ -30,8 +29,8 @@ def check(text:str, id: int=None):
30
29
 
31
30
  if id != None:
32
31
  if cache_size < 2:
33
- print("Cache size must be at least 2")
34
- return "error"
32
+ print("korcen: Cache size must be at least 2")
33
+ return False
35
34
  text = save_text(id=id, text=text)
36
35
 
37
36
  text = re.sub('𝗌', 's', text)
@@ -53,6 +52,7 @@ def check(text:str, id: int=None):
53
52
  text = re.sub('🅢', 's', text)
54
53
  text = re.sub('🆂', 's', text)
55
54
  text = re.sub('🅂', 's', text)
55
+ text = re.sub('𝑺', 's', text)
56
56
  text = re.sub('𝖾', 'e', text)
57
57
  text = re.sub('𝘦', 'e', text)
58
58
  text = re.sub('𝙚', 'e', text)
@@ -229,13 +229,14 @@ def check(text:str, id: int=None):
229
229
  text = re.sub("[^ㄱ-힣]", "", text)
230
230
  fuck = ["시ㅂ", "시ㅏㄹ", "씨ㅂ", "씨ㅏㄹ", "ㅣ발", "ㅆ발", "ㅅ발", "ㅅㅂ", "ㅆㅂ", "ㅆ바", "ㅅ바",
231
231
  "시ㅂㅏ", "ㅅㅂㅏ", "시ㅏㄹ", "씨ㅏㄹ", "ㅅ불", "ㅆ불", "ㅅ쁠", "ㅆ뿔", "ㅆㅣ발", "ㅅㅟ발", "ㅅㅣㅂㅏ",
232
- "ㅣ바알", "ㅅ벌", "^^ㅣ벌", "ㅆ삐라", "씨ㅃ"]
232
+ "ㅣ바알", "ㅅ벌", "^^ㅣ벌", "ㅆ삐라", "씨ㅃ", "^^/발"]
233
233
  for i in fuck:
234
234
  if i in text:
235
235
  return True
236
236
 
237
237
  text = re.sub('다시 방', '', text)
238
238
  text = re.sub('다시 불러', '', text)
239
+ text = re.sub('불러드', '', text)
239
240
  text = re.sub('시발음', '', text)
240
241
  text = re.sub('시발택시', '', text)
241
242
  text = re.sub('시발자동차', '', text)
@@ -316,6 +317,7 @@ def check(text:str, id: int=None):
316
317
  text = re.sub('의', '', text)
317
318
  text = re.sub('하시바라 이노스케', '', text)
318
319
  text = re.sub("[^가-힣]", "", text)
320
+ text = re.sub('즉시발급', '', text)
319
321
  text = re.sub('련', '놈', text)
320
322
  text = re.sub('뇬', '놈', text)
321
323
  text = re.sub('놈', '놈', text)
@@ -493,6 +495,7 @@ def check(text:str, id: int=None):
493
495
  text = re.sub('키보드', '', text)
494
496
  text = re.sub('새끼손', '', text)
495
497
  text = re.sub('셰리프', '', text)
498
+ text = re.sub('로쉐리', '', text)
496
499
  sonofbitch = ["새끼", "쉐리", "쌔끼", "썌끼", "쎼끼", "쌬끼", "샠끼", "세끼", "샊", "쌖", "섺", "쎆", "십새", "새키", "씹색", "새까", "새꺄",
497
500
  "새뀌", "새끠", "새캬", "색꺄", "색끼", "섹히", "셁기", "셁끼", "셐기", "셰끼", "셰리", "쉐꺄", "십색꺄", "십떼끼", "십데꺄", "십때끼", "십새꺄", "십새캬", "쉑히"]
498
501
  for i in sonofbitch:
@@ -655,19 +658,6 @@ def check(text:str, id: int=None):
655
658
  if i in text:
656
659
  return True
657
660
 
658
- text = re.sub("[^ㄱ-힣]", "", text)
659
- picking = ["ㅈㄴ", "ㅈ나", "존ㄴ", "존맛"]
660
- for i in picking:
661
- if i in text:
662
- return True
663
- text = re.sub("그만 졸라", "", text)
664
- text = re.sub("[^가-힣]", "", text)
665
- text = re.sub("졸라서", "", text)
666
- text = re.sub("졸라맨", "", text)
667
- picking = ["존나", "존내", "쫀나", "존네","줜나"]
668
- for i in picking:
669
- if i in text:
670
- return True
671
661
 
672
662
  text = re.sub("[^가-힣]", "", newtext)
673
663
  text = re.sub("뒤져봐야", "", text)
@@ -719,6 +709,7 @@ def check(text:str, id: int=None):
719
709
  text = re.sub('게 보지', '', text)
720
710
  text = re.sub("[^ㄱ-힣]", "", text)
721
711
  text = re.sub('보g', '보지', text)
712
+ text = re.sub('하나보지', '', text)
722
713
  text = re.sub('켜보지', '', text)
723
714
  text = re.sub('보지맙', '', text)
724
715
  text = re.sub('초보지', '', text)
@@ -788,6 +779,7 @@ def check(text:str, id: int=None):
788
779
  text = re.sub('자지금', '', text)
789
780
  text = re.sub("[^ㄱ-힣]", "", text)
790
781
  text = re.sub('자지않', '', text)
782
+ text = re.sub('어케자지', '', text)
791
783
  text = re.sub('자지도마', '', text)
792
784
  text = re.sub('자지는않', '', text)
793
785
  text = re.sub('자지좀마', '', text)
@@ -865,6 +857,7 @@ def check(text:str, id: int=None):
865
857
  text = re.sub('해야', '', text)
866
858
  text = re.sub('카시야스', '', text)
867
859
  text = re.sub('야스톤', '', text)
860
+ text = re.sub('유니섹스', '', text)
868
861
  text = re.sub("[^가-힣]", "", text)
869
862
  sex = ["섹스", "섻", "쉑스", "섿스", "섹그", "야스", "색스", "셱스", "섁스", "세엑스", "썩스", "섹수", "섹파", "섹하자", "쉐스", "쉑스", "쉐엑스", "색수", "세엑수우", "섹하고",
870
863
  "섹하구", "섹하자", "섹하장", "섹하쟈", "섹한번", "쌕스"]
@@ -1160,8 +1153,8 @@ def general(text:str, id: int=None):
1160
1153
 
1161
1154
  if id != None:
1162
1155
  if cache_size < 2:
1163
- print("Cache size must be at least 2")
1164
- return "error"
1156
+ print("korcen: Cache size must be at least 2")
1157
+ return False
1165
1158
  text = save_text(id=id, text=text)
1166
1159
 
1167
1160
  text = re.sub('𝗌', 's', text)
@@ -1183,6 +1176,7 @@ def general(text:str, id: int=None):
1183
1176
  text = re.sub('🅢', 's', text)
1184
1177
  text = re.sub('🆂', 's', text)
1185
1178
  text = re.sub('🅂', 's', text)
1179
+ text = re.sub('𝑺', 's', text)
1186
1180
  text = re.sub('𝖾', 'e', text)
1187
1181
  text = re.sub('𝘦', 'e', text)
1188
1182
  text = re.sub('𝙚', 'e', text)
@@ -1359,13 +1353,14 @@ def general(text:str, id: int=None):
1359
1353
  text = re.sub("[^ㄱ-힣]", "", text)
1360
1354
  fuck = ["시ㅂ", "시ㅏㄹ", "씨ㅂ", "씨ㅏㄹ", "ㅣ발", "ㅆ발", "ㅅ발", "ㅅㅂ", "ㅆㅂ", "ㅆ바", "ㅅ바",
1361
1355
  "시ㅂㅏ", "ㅅㅂㅏ", "시ㅏㄹ", "씨ㅏㄹ", "ㅅ불", "ㅆ불", "ㅅ쁠", "ㅆ뿔", "ㅆㅣ발", "ㅅㅟ발", "ㅅㅣㅂㅏ",
1362
- "ㅣ바알", "ㅅ벌", "^^ㅣ벌", "ㅆ삐라", "씨ㅃ"]
1356
+ "ㅣ바알", "ㅅ벌", "^^ㅣ벌", "ㅆ삐라", "씨ㅃ", "^^/발"]
1363
1357
  for i in fuck:
1364
1358
  if i in text:
1365
1359
  return True
1366
1360
 
1367
1361
  text = re.sub('다시 방', '', text)
1368
1362
  text = re.sub('다시 불러', '', text)
1363
+ text = re.sub('불러드', '', text)
1369
1364
  text = re.sub('시발음', '', text)
1370
1365
  text = re.sub('시발택시', '', text)
1371
1366
  text = re.sub('시발자동차', '', text)
@@ -1447,6 +1442,7 @@ def general(text:str, id: int=None):
1447
1442
  text = re.sub('의', '', text)
1448
1443
  text = re.sub('하시바라 이노스케', '', text)
1449
1444
  text = re.sub("[^가-힣]", "", text)
1445
+ text = re.sub('즉시발급', '', text)
1450
1446
  text = re.sub('련', '놈', text)
1451
1447
  text = re.sub('뇬', '놈', text)
1452
1448
  text = re.sub('놈', '놈', text)
@@ -1623,6 +1619,7 @@ def general(text:str, id: int=None):
1623
1619
  text = re.sub('키보드', '', text)
1624
1620
  text = re.sub('새끼손', '', text)
1625
1621
  text = re.sub('셰리프', '', text)
1622
+ text = re.sub('로쉐리', '', text)
1626
1623
  sonofbitch = ["새끼", "쉐리", "쌔끼", "썌끼", "쎼끼", "쌬끼", "샠끼", "세끼", "샊", "쌖", "섺", "쎆", "십새", "새키", "씹색", "새까", "새꺄",
1627
1624
  "새뀌", "새끠", "새캬", "색꺄", "색끼", "섹히", "셁기", "셁끼", "셐기", "셰끼", "셰리", "쉐꺄", "십색꺄", "십떼끼", "십데꺄", "십때끼", "십새꺄", "십새캬", "쉑히"]
1628
1625
  for i in sonofbitch:
@@ -1761,8 +1758,8 @@ def minor(text:str, id: int=None):
1761
1758
 
1762
1759
  if id != None:
1763
1760
  if cache_size < 2:
1764
- print("Cache size must be at least 2")
1765
- return "error"
1761
+ print("korcen: Cache size must be at least 2")
1762
+ return False
1766
1763
  text = save_text(id=id, text=text)
1767
1764
 
1768
1765
  newtext = text.lower()
@@ -1796,20 +1793,6 @@ def minor(text:str, id: int=None):
1796
1793
  if i in text:
1797
1794
  return True
1798
1795
 
1799
- text = re.sub("[^ㄱ-힣]", "", text)
1800
- picking = ["ㅈㄴ", "ㅈ나", "존ㄴ", "존맛"]
1801
- for i in picking:
1802
- if i in text:
1803
- return True
1804
- text = re.sub("그만 졸라", "", text)
1805
- text = re.sub("[^가-힣]", "", text)
1806
- text = re.sub("졸라서", "", text)
1807
- text = re.sub("졸라맨", "", text)
1808
- picking = ["존나", "존내", "쫀나", "존네","줜나"]
1809
- for i in picking:
1810
- if i in text:
1811
- return True
1812
-
1813
1796
  text = re.sub("[^가-힣]", "", newtext)
1814
1797
  text = re.sub("뒤져봐야", "", text)
1815
1798
  text = re.sub("뒤질뻔", "", text)
@@ -1830,8 +1813,8 @@ def sexual(text:str, id: int=None):
1830
1813
 
1831
1814
  if id != None:
1832
1815
  if cache_size < 2:
1833
- print("Cache size must be at least 2")
1834
- return "error"
1816
+ print("korcen: Cache size must be at least 2")
1817
+ return False
1835
1818
  text = save_text(id=id, text=text)
1836
1819
 
1837
1820
  text = re.sub('𝗌', 's', text)
@@ -1853,6 +1836,7 @@ def sexual(text:str, id: int=None):
1853
1836
  text = re.sub('🅢', 's', text)
1854
1837
  text = re.sub('🆂', 's', text)
1855
1838
  text = re.sub('🅂', 's', text)
1839
+ text = re.sub('𝑺', 's', text)
1856
1840
  text = re.sub('𝖾', 'e', text)
1857
1841
  text = re.sub('𝘦', 'e', text)
1858
1842
  text = re.sub('𝙚', 'e', text)
@@ -1935,6 +1919,7 @@ def sexual(text:str, id: int=None):
1935
1919
  text = re.sub('게 보지', '', text)
1936
1920
  text = re.sub("[^ㄱ-힣]", "", text)
1937
1921
  text = re.sub('보g', '보지', text)
1922
+ text = re.sub('하나보지', '', text)
1938
1923
  text = re.sub('켜보지', '', text)
1939
1924
  text = re.sub('보지맙', '', text)
1940
1925
  text = re.sub('초보지', '', text)
@@ -2004,6 +1989,7 @@ def sexual(text:str, id: int=None):
2004
1989
  text = re.sub('자지금', '', text)
2005
1990
  text = re.sub("[^ㄱ-힣]", "", text)
2006
1991
  text = re.sub('자지않', '', text)
1992
+ text = re.sub('어케자지', '', text)
2007
1993
  text = re.sub('자지도마', '', text)
2008
1994
  text = re.sub('자지는않', '', text)
2009
1995
  text = re.sub('자지좀마', '', text)
@@ -2081,6 +2067,7 @@ def sexual(text:str, id: int=None):
2081
2067
  text = re.sub('해야', '', text)
2082
2068
  text = re.sub('카시야스', '', text)
2083
2069
  text = re.sub('야스톤', '', text)
2070
+ text = re.sub('유니섹스', '', text)
2084
2071
  text = re.sub("[^가-힣]", "", text)
2085
2072
  sex = ["섹스", "섻", "쉑스", "섿스", "섹그", "야스", "색스", "셱스", "섁스", "세엑스", "썩스", "섹수", "섹파", "섹하자", "쉐스", "쉑스", "쉐엑스", "색수", "세엑수우", "섹하고",
2086
2073
  "섹하구", "섹하자", "섹하장", "섹하쟈", "섹한번", "쌕스"]
@@ -2192,8 +2179,8 @@ def belittle(text:str, id: int=None):
2192
2179
 
2193
2180
  if id != None:
2194
2181
  if cache_size < 2:
2195
- print("Cache size must be at least 2")
2196
- return "error"
2182
+ print("korcen: Cache size must be at least 2")
2183
+ return False
2197
2184
  text = save_text(id=id, text=text)
2198
2185
 
2199
2186
  text = text.lower()
@@ -2246,8 +2233,8 @@ def race(text:str, id: int=None):
2246
2233
 
2247
2234
  if id != None:
2248
2235
  if cache_size < 2:
2249
- print("Cache size must be at least 2")
2250
- return "error"
2236
+ print("korcen: Cache size must be at least 2")
2237
+ return False
2251
2238
  text = save_text(id=id, text=text)
2252
2239
 
2253
2240
  text = text.lower()
@@ -2268,8 +2255,8 @@ def parent(text:str, id: int=None):
2268
2255
 
2269
2256
  if id != None:
2270
2257
  if cache_size < 2:
2271
- print("Cache size must be at least 2")
2272
- return "error"
2258
+ print("korcen: Cache size must be at least 2")
2259
+ return False
2273
2260
  text = save_text(id=id, text=text)
2274
2261
 
2275
2262
  text = text.lower()
@@ -2314,8 +2301,8 @@ def english(text:str, id: int=None):
2314
2301
 
2315
2302
  if id != None:
2316
2303
  if cache_size < 2:
2317
- print("Cache size must be at least 2")
2318
- return "error"
2304
+ print("korcen: Cache size must be at least 2")
2305
+ return False
2319
2306
  text = save_text(id=id, text=text)
2320
2307
 
2321
2308
  text = re.sub('𝗌', 's', text)
@@ -2337,6 +2324,7 @@ def english(text:str, id: int=None):
2337
2324
  text = re.sub('🅢', 's', text)
2338
2325
  text = re.sub('🆂', 's', text)
2339
2326
  text = re.sub('🅂', 's', text)
2327
+ text = re.sub('𝑺', 's', text)
2340
2328
  text = re.sub('𝖾', 'e', text)
2341
2329
  text = re.sub('𝘦', 'e', text)
2342
2330
  text = re.sub('𝙚', 'e', text)
@@ -2441,6 +2429,7 @@ def chinese(text:str, id: int=None):
2441
2429
  text = re.sub('🅢', 's', text)
2442
2430
  text = re.sub('🆂', 's', text)
2443
2431
  text = re.sub('🅂', 's', text)
2432
+ text = re.sub('𝑺', 's', text)
2444
2433
  text = re.sub('𝖾', 'e', text)
2445
2434
  text = re.sub('𝘦', 'e', text)
2446
2435
  text = re.sub('𝙚', 'e', text)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: korcen
3
- Version: 0.3.8
3
+ Version: 0.3.10
4
4
  Summary: 한국어 비속어 검열
5
5
  Home-page: https://github.com/KR-korcen/korcen
6
6
  Author: Tanat
@@ -5,7 +5,7 @@ with open("README", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="korcen", # Replace with your own PyPI username(id)
8
- version="0.3.8",
8
+ version="0.3.10",
9
9
  author="Tanat",
10
10
  author_email="shrbwjd05@naver.com",
11
11
  description="한국어 비속어 검열",
File without changes
File without changes