diff --git a/evaluate/resh-evaluate.go b/evaluate/resh-evaluate.go index 78532ef..abca32e 100644 --- a/evaluate/resh-evaluate.go +++ b/evaluate/resh-evaluate.go @@ -67,7 +67,7 @@ func main() { } defer writer.Flush() - evaluator := evaluator{sanitizedInput: *sanitizedInput, writer: writer, maxCandidates: 42} + evaluator := evaluator{sanitizedInput: *sanitizedInput, writer: writer, maxCandidates: 50} err := evaluator.init(*inputPath) if err != nil { log.Fatal("Evaluator init() error:", err) diff --git a/evaluate/statistics.go b/evaluate/statistics.go index 98bd2dd..7a42c9d 100644 --- a/evaluate/statistics.go +++ b/evaluate/statistics.go @@ -69,4 +69,31 @@ func (s *statistics) printCumulative() { if n == 0 { log.Fatal("Nothing was written", n) } + + charsRecall := 0.0 + out = "### Characters recalled per submission ###\n" + for i := 0; i < s.size; i++ { + charsRecall += float64(s.charactersRecalled[i]) / float64(s.dataPointCount) + out += strconv.Itoa(i) + " ->" + out += fmt.Sprintf(" (%.2f)\n", charsRecall) + for j := 0; j < int(math.Round(charsRecall)); j++ { + out += "#" + } + out += "\n" + } + charsRecall = float64(s.charactersRecalledTotal) / float64(s.dataPointCount) + out += "TOTAL ->" + out += fmt.Sprintf(" (%.2f)\n", charsRecall) + for j := 0; j < int(math.Round(charsRecall)); j++ { + out += "#" + } + out += "\n" + + n, err = s.writer.WriteString(string(out) + "\n\n") + if err != nil { + log.Fatal(err) + } + if n == 0 { + log.Fatal("Nothing was written", n) + } }