|
@@ -56,10 +56,10 @@ func saveBayesToFile() {
|
|
|
tmpJSON = jerr.Error()
|
|
|
}
|
|
|
|
|
|
- sJSON, serr := json.MarshalIndent(Classifier.STATS, "", " ")
|
|
|
- if serr != nil {
|
|
|
- sJSON = []byte(serr.Error())
|
|
|
- }
|
|
|
+ Classifier.STATS.Range(func(key interface{}, value interface{}) bool {
|
|
|
+ fmt.Printf("%s : %d", key.(string), value.(int64))
|
|
|
+ return true
|
|
|
+ })
|
|
|
|
|
|
dumpfile := os.Getenv("DUMPFILE")
|
|
|
if dumpfile == "" {
|
|
@@ -70,7 +70,7 @@ func saveBayesToFile() {
|
|
|
log.Println(tmpJSON)
|
|
|
} else {
|
|
|
writeToFile(dumpfile, tmpJSON)
|
|
|
- writeToFile(dumpfile+".stats", string(sJSON))
|
|
|
+
|
|
|
log.Println("File saved: ", dumpfile)
|
|
|
}
|
|
|
|