From a3434180474e832eeea7d775893ce85244f8145c Mon Sep 17 00:00:00 2001
From: Chris Dyer <redpony@gmail.com>
Date: Thu, 17 Apr 2014 20:55:34 -0400
Subject: fix rescoring

---
 decoder/trule.cc | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'decoder')

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;
 }
 
-- 
cgit v1.2.3