From 35205d2066a5264b494e5d4b0376b01ff416a9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E6=AE=B7=E6=9D=B0?= <1583091881@qq.com> Date: Mon, 20 Jun 2022 13:13:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'app/wordfreqCMD.py'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/wordfreqCMD.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/wordfreqCMD.py b/app/wordfreqCMD.py index c4cfc2f..e00f1cd 100644 --- a/app/wordfreqCMD.py +++ b/app/wordfreqCMD.py @@ -44,7 +44,7 @@ def remove_punctuation(s): # 这里是s是形参 (parameter)。函数被调用 for c in special_characters: s = s.replace(c, ' ') # 防止出现把 apple,apple 移掉逗号后变成 appleapple 情况 s = s.replace('--', ' ')''' - cop = re.compile("[^a-z^A-Z^\\']")#通过正则表达式保留英文字符和-、'两个特殊字符 + cop = re.compile("[^a-z^A-Z^\\']")#通过正则表达式保留英文字符和'特殊字符 s=cop.sub(' ' , s) s = s.strip() # 去除前后的空格 #s=keep_need_punctuation(s,'-')