summaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2014-04-17 20:55:34 -0400
committerChris Dyer <redpony@gmail.com>2014-04-17 20:55:34 -0400
commita3434180474e832eeea7d775893ce85244f8145c (patch)
tree5411ce71f278edc140723b91813208201c18eff1 /decoder
parent649b5ffc7c81182ba39d338b11bfe2e9a05544b5 (diff)
fix rescoring
Diffstat (limited to 'decoder')
-rw-r--r--decoder/trule.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/decoder/trule.cc b/decoder/trule.cc
index 1bd5425f..bee211d5 100644
--- a/decoder/trule.cc
+++ b/decoder/trule.cc
@@ -56,6 +56,12 @@ bool TRule::ReadFromString(const string& line, bool mono) {
RuleLexer::ReadRule(line + '\n', assign_trule, mono, this);
if (n_assigned > 1)
cerr<<"\nWARNING: more than one rule parsed from multi-line string; kept last: "<<line<<".\n";
+ if (mono) {
+ e_ = f_;
+ int ntc = 0;
+ for (auto& i : e_)
+ if (i < 0) i = -ntc++;
+ }
return n_assigned;
}