mirror of
https://github.com/fxsjy/jieba.git
synced 2025-07-10 00:01:33 +08:00
将tab换成空格,使用is判断对象是否为None
This commit is contained in:
parent
7ce5116a93
commit
a2d2078465
@ -18,16 +18,13 @@ if len(args) <1:
|
|||||||
|
|
||||||
file_name = args[0]
|
file_name = args[0]
|
||||||
|
|
||||||
if opt.topK==None:
|
if opt.topK is None:
|
||||||
topK = 10
|
topK = 10
|
||||||
else:
|
else:
|
||||||
topK = int(opt.topK)
|
topK = int(opt.topK)
|
||||||
|
|
||||||
|
|
||||||
content = open(file_name, 'rb').read()
|
content = open(file_name, 'rb').read()
|
||||||
|
|
||||||
tags = jieba.analyse.extract_tags(content, topK=topK)
|
tags = jieba.analyse.extract_tags(content, topK=topK)
|
||||||
|
|
||||||
print ",".join(tags)
|
print ",".join(tags)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user