diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2012-04-18 22:34:57 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2012-04-18 22:34:57 -0400 |
commit | f419e830faa6c47a8c0ba55fc0d10a113405a210 (patch) | |
tree | 825ef1ab1b6e660a47360bafe347bb488f94d390 /rst_parser | |
parent | d4e9d2678903d92115f981097debf305876b7180 (diff) |
damn off by one error
Diffstat (limited to 'rst_parser')
-rw-r--r-- | rst_parser/arc_ff.cc | 5 |
1 files 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<WordID, vector<int> >::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); |