Tried 基本功能完成.

This commit is contained in:
huangsimin 2019-08-20 15:37:35 +08:00
parent b92f270429
commit c7dd130342
2 changed files with 4 additions and 2 deletions

View File

@ -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
} }

View File

@ -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
} }