From 84ffa0d4bf00cba0c75b678b15b2b2a66d3c5bf2 Mon Sep 17 00:00:00 2001 From: Wang Bin Date: Thu, 2 Apr 2015 11:06:55 +0800 Subject: [PATCH] exlucde word fragments from FREQ --- jieba/posseg/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jieba/posseg/__init__.py b/jieba/posseg/__init__.py index 194b2dc..680050c 100644 --- a/jieba/posseg/__init__.py +++ b/jieba/posseg/__init__.py @@ -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