mirror of
https://github.com/fumiama/jieba.git
synced 2026-06-08 18:40:24 +08:00
small refactor
This commit is contained in:
@@ -4,13 +4,15 @@ import (
|
||||
"math"
|
||||
)
|
||||
|
||||
var inf = math.Inf(-1)
|
||||
|
||||
type probTransMap map[string]float64
|
||||
|
||||
func (m probTransMap) Get(key string) float64 {
|
||||
if value, ok := m[key]; ok {
|
||||
return value
|
||||
} else {
|
||||
return math.Inf(-1)
|
||||
return inf
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user