mirror of
https://github.com/fumiama/jieba.git
synced 2026-06-05 08:40:36 +08:00
24 lines
380 B
Go
24 lines
380 B
Go
package dictionary
|
|
|
|
type Token struct {
|
|
text string
|
|
frequency float64
|
|
pos string
|
|
}
|
|
|
|
func (t Token) Text() string {
|
|
return t.text
|
|
}
|
|
|
|
func (t Token) Frequency() float64 {
|
|
return t.frequency
|
|
}
|
|
|
|
func (t Token) Pos() string {
|
|
return t.pos
|
|
}
|
|
|
|
func NewToken(text string, frequency float64, pos string) Token {
|
|
return Token{text: text, frequency: frequency, pos: pos}
|
|
}
|