summaryrefslogtreecommitdiff
path: root/mteval/ns_ter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'mteval/ns_ter.cc')
-rw-r--r--mteval/ns_ter.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/mteval/ns_ter.cc b/mteval/ns_ter.cc
index 8c969e58..f75acf1d 100644
--- a/mteval/ns_ter.cc
+++ b/mteval/ns_ter.cc
@@ -473,3 +473,15 @@ float TERMetric::ComputeScore(const SufficientStats& stats) const {
return edits / static_cast<float>(stats[kREF_WORDCOUNT]);
}
+string TERMetric::DetailedScore(const SufficientStats& stats) const {
+ char buf[200];
+ sprintf(buf, "TER = %.2f, %3.f|%3.f|%3.f|%3.f (len=%3.f)",
+ ComputeScore(stats) * 100.0f,
+ stats[kINSERTIONS],
+ stats[kDELETIONS],
+ stats[kSUBSTITUTIONS],
+ stats[kSHIFTS],
+ stats[kREF_WORDCOUNT]);
+ return buf;
+}
+