Showing
1 changed file
with
2 additions
and
4 deletions
| @@ -4,7 +4,7 @@ import re | @@ -4,7 +4,7 @@ import re | ||
| 4 | def main(): | 4 | def main(): |
| 5 | reader = open('./cutComments.txt','r',encoding='utf8') | 5 | reader = open('./cutComments.txt','r',encoding='utf8') |
| 6 | strs = reader.read() | 6 | strs = reader.read() |
| 7 | - result = open('cipingTotal.csv', 'w', encoding='utf8') | 7 | + result = open('./utils/cipingTotal.csv', 'w', encoding='utf8') |
| 8 | 8 | ||
| 9 | # 分词,去重,列表 | 9 | # 分词,去重,列表 |
| 10 | word_list = jieba.cut(strs,cut_all=True) | 10 | word_list = jieba.cut(strs,cut_all=True) |
| @@ -27,6 +27,4 @@ def main(): | @@ -27,6 +27,4 @@ def main(): | ||
| 27 | # return list_count | 27 | # return list_count |
| 28 | for i in range(100): | 28 | for i in range(100): |
| 29 | print(list_count[i],file=result) | 29 | print(list_count[i],file=result) |
| 30 | - | ||
| 31 | -if __name__ == '__main__': | ||
| 32 | - print(main()) | ||
| 30 | + |
-
Please register or login to post a comment