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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user