1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-07-01 17:40:29 +08:00

small refactor

This commit is contained in:
Wang Bin
2015-03-25 16:01:05 +08:00
parent 8687ca58b8
commit 800ecaa8c9
2 changed files with 3 additions and 7 deletions

View File

@@ -50,10 +50,10 @@ func viterbi(obs []rune) []string {
}
}
//use Go's map to implement Python's Set()
prev_states_expect_next := make(map[string]string)
prev_states_expect_next := make(map[string]int)
for _, x := range prev_states {
for y, _ := range probTrans[x] {
prev_states_expect_next[y] = y
prev_states_expect_next[y] = 1
}
}
tmp_obs_states := charStateTab.get(obs[t])