mirror of
https://github.com/fxsjy/jieba.git
synced 2025-07-10 00:01:33 +08:00
remove a bug prone role
This commit is contained in:
parent
004f720bd0
commit
c8b1cb0c88
@ -27,10 +27,7 @@ def viterbi(obs, states, start_p, trans_p, emit_p):
|
|||||||
newpath[y] = path[state] + [y]
|
newpath[y] = path[state] + [y]
|
||||||
path = newpath
|
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 states])
|
||||||
(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')])
|
|
||||||
|
|
||||||
return (prob, path[state])
|
return (prob, path[state])
|
||||||
|
|
||||||
|
2
setup.py
2
setup.py
@ -1,6 +1,6 @@
|
|||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
setup(name='jieba',
|
setup(name='jieba',
|
||||||
version='0.14',
|
version='0.15',
|
||||||
description='Chinese Words Segementation Utilities',
|
description='Chinese Words Segementation Utilities',
|
||||||
author='Sun, Junyi',
|
author='Sun, Junyi',
|
||||||
author_email='ccnusjy@gmail.com',
|
author_email='ccnusjy@gmail.com',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user