mirror of
https://github.com/fumiama/jieba.git
synced 2026-06-26 23:20:31 +08:00
small refactor the interface, use contructors instead of pointers for entry
This commit is contained in:
@@ -1,21 +1,13 @@
|
||||
package jiebago
|
||||
|
||||
type Pair struct {
|
||||
type Entry struct {
|
||||
Word string
|
||||
Flag string
|
||||
}
|
||||
|
||||
type Entry struct {
|
||||
*Pair
|
||||
Freq float64
|
||||
}
|
||||
|
||||
func NewEntry() *Entry {
|
||||
return &Entry{new(Pair), 0.0}
|
||||
}
|
||||
|
||||
type DictLoader interface {
|
||||
AddEntry(*Entry)
|
||||
AddEntry(Entry)
|
||||
}
|
||||
|
||||
type Cacher interface {
|
||||
|
||||
Reference in New Issue
Block a user