1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-07-02 10:00:27 +08:00

fixed the bug from issue #132 from original jieba issue track

- issue details from https://github.com/fxsjy/jieba/issues/132
 - updated tests
 - also some code refactors
This commit is contained in:
Wang Bin
2014-08-08 17:59:49 +08:00
parent 08cb04815c
commit 3d685f1980
7 changed files with 107 additions and 19 deletions

View File

@@ -86,6 +86,11 @@ func Viterbi(obs []rune) (float64, []StateTag) {
obs_states = append(obs_states, tmp_obs_states[index])
}
}
if len(obs_states) == 0 {
for key := range prev_states_expect_next {
obs_states = append(obs_states, key)
}
}
if len(obs_states) == 0 {
obs_states = ProbTransKeys
}