summaryrefslogtreecommitdiff
path: root/tests/tools/filter-stderr.pl
blob: 54fe92105da64004d4dc55bad4ed0808770e6c69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl -w
use strict;

my $REAL = '(\+|-)?[1-9][0-9]*(\.[0-9]*)?|(\+|-)?[1-9]\.[0-9]*e(\+|-)?[0-9]+';

while(<>) {
if (/Init.*forest\s+\(nodes\/edges\): (\d+)\/(\d+)/) { print "-lm_nodes $1\n-lm_edges $2\n"; }
if (/Init.*forest\s+\(paths\): (.+)$/) { print "-lm_paths $1\n"; }
# -LM Viterbi: -12.7893
if (/Init.*\s+Viterbi:\s+($REAL)/) {
  print "-lm_viterbi $1\n";
} elsif (/-LM\s+Viterbi:\s+(.+)$/) {
  # -LM Viterbi: australia is have diplomatic relations with north korea one of the few countries .
  print "-lm_trans $1\n";
}
if (/NODES NOT UNIQUELY IDENTIFIED/) { print "NODES_NOT_UNIQUE 1\n"; }
#Constr. forest (nodes/edges): 111/305
#Constr. forest       (paths): 9899
if (/Constr\. forest\s+\(nodes\/edges\): (\d+)\/(\d+)/) { print "constr_nodes $1\nconstr_edges $2\n"; }
if (/Constr\. forest\s+\(paths\): (.+)$/) { print "constr_paths $1\n"; }

if (/Pass1.*forest\s+\(nodes\/edges\): (\d+)\/(\d+)/) { print "+lm_nodes $1\n+lm_edges $2\n"; }
if (/Pass1.*forest\s+\(paths\): (.+)$/) { print "+lm_paths $1\n"; }
if (/Pass1.*Viterbi:\s+($REAL)/) {
  print "+lm_viterbi $1\n";
} elsif (/Pass1.*Viterbi:\s+(.+)$/) {
  # -LM Viterbi: australia is have diplomatic relations with north korea one of the few countries .
  print "+lm_trans $1\n";
}

}