Tried 基本功能完成.
This commit is contained in:
parent
b92f270429
commit
c7dd130342
|
@ -27,7 +27,6 @@ type Node struct {
|
||||||
func New() *Tried {
|
func New() *Tried {
|
||||||
tried := &Tried{}
|
tried := &Tried{}
|
||||||
tried.root = new(Node)
|
tried.root = new(Node)
|
||||||
|
|
||||||
tried.wiStore = WordIndexDict[WordIndexLower]
|
tried.wiStore = WordIndexDict[WordIndexLower]
|
||||||
return tried
|
return tried
|
||||||
}
|
}
|
||||||
|
|
|
@ -317,7 +317,10 @@ func TesStoreData(t *testing.T) {
|
||||||
|
|
||||||
func Load() []string {
|
func Load() []string {
|
||||||
var result []string
|
var result []string
|
||||||
f, _ := os.Open("tried.log")
|
f, err := os.Open("tried.log")
|
||||||
|
if err != nil {
|
||||||
|
panic("先执行TesStoreData 然后再测试Benchmark")
|
||||||
|
}
|
||||||
gob.NewDecoder(f).Decode(&result)
|
gob.NewDecoder(f).Decode(&result)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user