From c8b1cb0c8835d95a1f8d64b26fe740bb14ba241c Mon Sep 17 00:00:00 2001 From: fxsjy Date: Mon, 8 Oct 2012 20:52:35 +0800 Subject: [PATCH] remove a bug prone role --- jieba/finalseg/__init__.py | 5 +---- setup.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/jieba/finalseg/__init__.py b/jieba/finalseg/__init__.py index dd124fe..7680e95 100644 --- a/jieba/finalseg/__init__.py +++ b/jieba/finalseg/__init__.py @@ -27,10 +27,7 @@ def viterbi(obs, states, start_p, trans_p, emit_p): newpath[y] = path[state] + [y] path = newpath - if emit_p['M'].get(obs[-1],0)> emit_p['S'].get(obs[-1],0): - (prob, state) = max([(V[len(obs) - 1][y], y) for y in ('E',)]) - else: - (prob, state) = max([(V[len(obs) - 1][y], y) for y in ('E','S')]) + (prob, state) = max([(V[len(obs) - 1][y], y) for y in states]) return (prob, path[state]) diff --git a/setup.py b/setup.py index 045d2b0..e4265b6 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from distutils.core import setup setup(name='jieba', - version='0.14', + version='0.15', description='Chinese Words Segementation Utilities', author='Sun, Junyi', author_email='ccnusjy@gmail.com',