From a4e62df53b4bbac77cb967997dae41fb8dc674d7 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Wed, 18 Apr 2012 22:34:57 -0400 Subject: damn off by one error --- rst_parser/arc_ff.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rst_parser/arc_ff.cc b/rst_parser/arc_ff.cc index b3560b73..673648d1 100644 --- a/rst_parser/arc_ff.cc +++ b/rst_parser/arc_ff.cc @@ -75,7 +75,8 @@ struct ArcFFImpl { const string& mod_pos = TD::Convert(sent.pos[m]); const string& mod_pos_L = (m > 0 ? TD::Convert(sent.pos[m-1]) : kLEFT_POS); const string& mod_pos_R = (m < sent.pos.size() - 1 ? TD::Convert(sent.pos[m]) : kRIGHT_POS); - const string dir = (m < h ? "MLeft" : "MRight"); + const bool bdir = m < h; + const string dir = (bdir ? "MLeft" : "MRight"); int v = m - h; if (v < 0) { v= -1 - int(log(-v) / log(2)); @@ -119,7 +120,7 @@ struct ArcFFImpl { int left = min(h,m); int right = max(h,m); if (right - left >= 2) { - --right; + if (bdir) --right; else ++left; for (map >::const_iterator it = pcs.begin(); it != pcs.end(); ++it) { if (it->second[left] != it->second[right]) { Fire(features, "BT", head_pos, TD::Convert(it->first), mod_pos); -- cgit v1.2.3