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

small refactor

This commit is contained in:
Wang Bin
2015-04-04 15:30:11 +08:00
parent bbe302a351
commit e8cf1e9a9c

View File

@@ -4,13 +4,15 @@ import (
"math" "math"
) )
var inf = math.Inf(-1)
type probTransMap map[string]float64 type probTransMap map[string]float64
func (m probTransMap) Get(key string) float64 { func (m probTransMap) Get(key string) float64 {
if value, ok := m[key]; ok { if value, ok := m[key]; ok {
return value return value
} else { } else {
return math.Inf(-1) return inf
} }
} }