优化无效词汇过滤

This commit is contained in:
机器人总动员 2021-05-07 22:53:15 +08:00
parent 33522e4791
commit 6f6df9479b

View File

@ -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: