优化无效词汇过滤
This commit is contained in:
parent
33522e4791
commit
6f6df9479b
4
task.py
4
task.py
@ -50,7 +50,9 @@ def do_task():
|
||||
word_amount = {}
|
||||
# print(word_amount)
|
||||
for word in word_list:
|
||||
if word in ["。", ",", "!", ":", "“", "”", "!", ".", ",", ":", '"', "+", "-", "[", "]", "\\", "/"]:
|
||||
if re.search(
|
||||
r"[。|,|、|?|!|,|.|!|?|\\|/|+|\-|`|~|·|@|#|¥|$|%|^|&|*|(|)|;|;|‘|’|“|”|'|_|=|\"]",
|
||||
word) is not None:
|
||||
continue
|
||||
# 判断该词是否之前已经出现
|
||||
if word_amount.get(word) is not None:
|
||||
|
Loading…
Reference in New Issue
Block a user