From 128affd724483c2d9ac8276722ca9e89b973710b Mon Sep 17 00:00:00 2001 From: feilong Date: Fri, 19 Nov 2021 18:32:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B8=E9=A2=98+fix4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style.md" | 2 ++ 1 file changed, 2 insertions(+) diff --git "a/data/1.python\345\210\235\351\230\266/1.\351\242\204\345\244\207\347\237\245\350\257\206/6.\347\274\226\347\240\201\350\247\204\350\214\203/style.md" "b/data/1.python\345\210\235\351\230\266/1.\351\242\204\345\244\207\347\237\245\350\257\206/6.\347\274\226\347\240\201\350\247\204\350\214\203/style.md" index e8f1fea..480a1c5 100644 --- "a/data/1.python\345\210\235\351\230\266/1.\351\242\204\345\244\207\347\237\245\350\257\206/6.\347\274\226\347\240\201\350\247\204\350\214\203/style.md" +++ "b/data/1.python\345\210\235\351\230\266/1.\351\242\204\345\244\207\347\237\245\350\257\206/6.\347\274\226\347\240\201\350\247\204\350\214\203/style.md" @@ -55,10 +55,12 @@ def top_words(splits, text, top_n=5): while i < len(text): c = text[i] if c in splits: + # 过滤掉分隔字符串 while i+1 < len(text) and text[i+1] in splits: i += 1 word = ''.join(chars).lower() + # 统计词频 # TODO(You): 请在此添加代码 chars = [] -- GitLab