exlucde word fragments from FREQ

This commit is contained in:
Wang Bin 2015-04-02 11:06:55 +08:00
parent 885417aed1
commit 84ffa0d4bf

View File

@ -189,7 +189,7 @@ def __cut_DAG(sentence):
if buf:
if len(buf) == 1:
yield pair(buf, word_tag_tab.get(buf, 'x'))
elif buf not in jieba.FREQ:
elif not jieba.FREQ.get(buf):
recognized = __cut_detail(buf)
for t in recognized:
yield t
@ -203,7 +203,7 @@ def __cut_DAG(sentence):
if buf:
if len(buf) == 1:
yield pair(buf, word_tag_tab.get(buf, 'x'))
elif (buf not in jieba.FREQ):
elif not jieba.FREQ.get(buf):
recognized = __cut_detail(buf)
for t in recognized:
yield t