|
@@ -56,6 +56,11 @@ func saveBayesToFile() {
|
|
|
tmpJSON = jerr.Error()
|
|
|
}
|
|
|
|
|
|
+ sJSON, serr := json.MarshalIndent(Classifier.STATS, "", " ")
|
|
|
+ if serr != nil {
|
|
|
+ sJSON = serr.Error()
|
|
|
+ }
|
|
|
+
|
|
|
dumpfile := os.Getenv("DUMPFILE")
|
|
|
if dumpfile == "" {
|
|
|
dumpfile = "bayes.json"
|
|
@@ -65,6 +70,7 @@ func saveBayesToFile() {
|
|
|
log.Println(tmpJSON)
|
|
|
} else {
|
|
|
writeToFile(dumpfile, tmpJSON)
|
|
|
+ writeToFile(dumpfile+".stats", sJSON)
|
|
|
log.Println("File saved: ", dumpfile)
|
|
|
}
|
|
|
|