// 初始化 func init() { setLogOutput() participleutil.LoadDic("../participleutil/mydic.txt") conf = NewConfig() numFile = 0 wordMap = make(map[string]int) }
// 初始化 func InitSearch() { participleutil.LoadDic(conf.DicPath) wordMapIndexInfo = make(map[string][]*WordIndexInfo) idMapMd5 = make(map[int]string) md5MapUrlInfo = make(map[string]*UrlInfo) readWordMapIndexInfo() readIdMapMd5() readMd5MapUrlInfo() }
// 初始化 func init() { setLogOutput() participleutil.LoadDic("../participleutil/mydic.txt") conf = NewConfig() numFile = 0 numWord = 0 wordIDF = make(map[string]float32) docID = make(map[string]int) words = make([]string, 0) docids = make([]int, 0) tfidfs = make([]float32, 0) readIDF() readDocId() initDatabase() }