Commit d3f2cc2b authored by Arne Köhn's avatar Arne Köhn

add some checking to get-errortypes, plot2latextable is now able to round

parent aa910339
......@@ -35,8 +35,17 @@ def get_errors(goldfile, testfile):
if __name__ == "__main__":
import os,sys
from operator import itemgetter
goldfile = open(os.path.abspath(sys.argv[1]))
testfile = open(os.path.abspath(sys.argv[2]))
try:
goldfile = open(os.path.abspath(sys.argv[1]))
testfile = open(os.path.abspath(sys.argv[2]))
except:
print "usage: get-errortypes.py [goldfile] [testfile]"
sys.exit(1)
(g,t,e) = get_errors(goldfile, testfile)
num_errors = 0
for error in e.iteritems():
num_errors += error[1]
print num_errors, " errors"
print "===== ERRORS: ====="
for error in sorted(e.iteritems(), key=itemgetter(1), reverse=True):
print error
print error[0], ":", error[1], " (",(error[1]*1.0/num_errors)*100, " )"
......@@ -20,7 +20,7 @@ foreach my $tagger (@files) {
while (<$fh>) {
$_ =~ s/\d+ ([^ ]+) .*/$1/;
chomp;
print " & ", $_;
print " & ", sprintf("%.3f",$_);
}
print " \\\\ \n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment