From baa1c45782cfe1dbc0813863d4e47076daeaab4e Mon Sep 17 00:00:00 2001 From: whiost Date: Thu, 8 Dec 2022 16:03:38 +0800 Subject: [PATCH 1/5] =?UTF-8?q?[Bugfix]=20=E9=83=A8=E5=88=86=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E7=AC=A6=E5=8F=B7=E4=B8=8D=E4=BC=9A=E8=A2=AB=E5=88=86?= =?UTF-8?q?=E9=9A=94?= 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 9ee7e56..342cd2c 100644 --- a/app/wordfreqCMD.py +++ b/app/wordfreqCMD.py @@ -39,7 +39,7 @@ def file2str(fname):#文件转字符 def remove_punctuation(s): # 这里是s是形参 (parameter)。函数被调用时才给s赋值。 - special_characters = '_©~=+[]*&$%^@.,?!:;#()"“”—‘’' # 把里面的字符都去掉 + special_characters = '_©~=+[]*&$%^@.,?!:;#()"“”—‘’|;...' # 把里面的字符都去掉 for c in special_characters: s = s.replace(c, ' ') # 防止出现把 apple,apple 移掉逗号后变成 appleapple 情况 s = s.replace('--', ' ') -- 2.17.1 From ac2046ac2ea76500430f6799bf21b6dabe78f3ed Mon Sep 17 00:00:00 2001 From: CmosQAQ <407775702@qq.com> Date: Thu, 4 May 2023 17:02:28 +0800 Subject: [PATCH 2/5] first commit --- app/wordfreqCMD.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/wordfreqCMD.py b/app/wordfreqCMD.py index 342cd2c..5c84766 100644 --- a/app/wordfreqCMD.py +++ b/app/wordfreqCMD.py @@ -39,7 +39,7 @@ def file2str(fname):#文件转字符 def remove_punctuation(s): # 这里是s是形参 (parameter)。函数被调用时才给s赋值。 - special_characters = '_©~=+[]*&$%^@.,?!:;#()"“”—‘’|;...' # 把里面的字符都去掉 + special_characters = '\_©~<=>+-/[]*&$%^@.,?!:;#()"“”—‘’{}|《》【】、!¥();:?。,' # 把里面的字符都去掉 for c in special_characters: s = s.replace(c, ' ') # 防止出现把 apple,apple 移掉逗号后变成 appleapple 情况 s = s.replace('--', ' ') -- 2.17.1 From 7b55fc185967ba752f14c6b2a51da1e2cd80a5bf Mon Sep 17 00:00:00 2001 From: CmosQAQ <407775702@qq.com> Date: Thu, 4 May 2023 17:18:04 +0800 Subject: [PATCH 3/5] first commit --- app/wordfreqCMD.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/wordfreqCMD.py b/app/wordfreqCMD.py index 5c84766..2d1eade 100644 --- a/app/wordfreqCMD.py +++ b/app/wordfreqCMD.py @@ -117,6 +117,7 @@ if __name__ == '__main__': # 合并频率 lst_history = pickle_idea.dict2lst(d) d = pickle_idea.merge_frequency(L, lst_history) + pickle_idea.save_frequency_to_pickle(d, 'frequency.p') -- 2.17.1 From 96dfadcde63429e68183dcc95aa88332da962835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E7=91=9C?= <1522413812@qq.com> Date: Thu, 4 May 2023 17:39:48 +0800 Subject: [PATCH 4/5] =?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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/wordfreqCMD.py b/app/wordfreqCMD.py index 2d1eade..93dbf6b 100644 --- a/app/wordfreqCMD.py +++ b/app/wordfreqCMD.py @@ -39,7 +39,7 @@ def file2str(fname):#文件转字符 def remove_punctuation(s): # 这里是s是形参 (parameter)。函数被调用时才给s赋值。 - special_characters = '\_©~<=>+-/[]*&$%^@.,?!:;#()"“”—‘’{}|《》【】、!¥();:?。,' # 把里面的字符都去掉 + special_characters = '\_©~<=>+-/[]*&$%^@.,?!:;#()"“”—‘’{}|' # 把里面的字符都去掉 for c in special_characters: s = s.replace(c, ' ') # 防止出现把 apple,apple 移掉逗号后变成 appleapple 情况 s = s.replace('--', ' ') @@ -103,6 +103,7 @@ if __name__ == '__main__': for x in sort_in_descending_order(L): print('%s\t%d\t%s' % (x[0], x[1], youdao_link(x[0])))#函数导出 + # 把频率的结果放result.html中 make_html_page(sort_in_descending_order(L), 'result.html') -- 2.17.1 From 0fedf590e881c7773506b1bfdf2b80372d475e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E7=91=9C?= <1522413812@qq.com> Date: Thu, 4 May 2023 17:40:44 +0800 Subject: [PATCH 5/5] =?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 93dbf6b..b6ee20b 100644 --- a/app/wordfreqCMD.py +++ b/app/wordfreqCMD.py @@ -39,7 +39,7 @@ def file2str(fname):#文件转字符 def remove_punctuation(s): # 这里是s是形参 (parameter)。函数被调用时才给s赋值。 - special_characters = '\_©~<=>+-/[]*&$%^@.,?!:;#()"“”—‘’{}|' # 把里面的字符都去掉 + special_characters = '\_©~<=>+-/[]*&$%^@.,?!:;#()"“”—‘’{}|《》【】、!¥();:?。,' # 把里面的字符都去掉 for c in special_characters: s = s.replace(c, ' ') # 防止出现把 apple,apple 移掉逗号后变成 appleapple 情况 s = s.replace('--', ' ') -- 2.17.1