From b8f2919959e1a31979df4476a188517896870e26 Mon Sep 17 00:00:00 2001 From: 03 <1930154319@qq.com> Date: Mon, 25 Mar 2024 10:15:11 +0800 Subject: [PATCH] Fix bug 553 --- app/wordfreqCMD.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/wordfreqCMD.py b/app/wordfreqCMD.py index dfdde2e..4cf550e 100644 --- a/app/wordfreqCMD.py +++ b/app/wordfreqCMD.py @@ -41,7 +41,7 @@ def file2str(fname):#文件转字符 def remove_punctuation(s): # 这里是s是形参 (parameter)。函数被调用时才给s赋值。 special_characters = '\_©~<=>+/[]*&$%^@.,?!:;#()"“”—‘’{}|,。?!¥……()、《》:;·' # 把里面的字符都去掉 - s = html.unescape(s) + s = html.unescape(s) # 将HTML实体转换为对应的字符,比如<会被识别为小于号 for c in special_characters: s = s.replace(c, ' ') # 防止出现把 apple,apple 移掉逗号后变成 appleapple 情况 s = s.replace('--', ' ')