|
@@ -47,6 +47,11 @@ func saveBayesToFile() {
|
|
|
tmpJSON = []byte(err.Error())
|
|
|
}
|
|
|
|
|
|
+ statsJSON, err := json.MarshalIndent(Classifier.STATS, "", " ")
|
|
|
+ if err != nil {
|
|
|
+ statsJSON = []byte(err.Error())
|
|
|
+ }
|
|
|
+
|
|
|
dumpfile := os.Getenv("DUMPFILE")
|
|
|
if dumpfile == "" {
|
|
|
dumpfile = "bayes.json"
|
|
@@ -55,7 +60,7 @@ func saveBayesToFile() {
|
|
|
if DebugLog {
|
|
|
log.Println("DUMP: ", string(tmpJSON))
|
|
|
} else {
|
|
|
- writeToFile(dumpfile, string(tmpJSON))
|
|
|
+ writeToFile(dumpfile, string(tmpJSON)+string(statsJSON))
|
|
|
|
|
|
log.Println("File saved: ", dumpfile)
|
|
|
}
|