diff options
author | Patrick Simianer <p@simianer.de> | 2014-05-05 21:01:06 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-05-05 21:01:06 +0200 |
commit | 2fd4fc6933d67684ae25e91a6d43c8bd8ddc8ec3 (patch) | |
tree | f1ed55b2029e905de3aeae84dde567936b403c7f | |
parent | 9a48eeb5afbbece30b4be425c9f24649307d3ed6 (diff) |
fix
-rw-r--r-- | intersect.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/intersect.rb b/intersect.rb index 42c4b92..cff926f 100644 --- a/intersect.rb +++ b/intersect.rb @@ -94,7 +94,7 @@ def scan item, passive_chart, input, i, j while item.rhs[item.dot].class == Terminal if item.rhs[item.dot].w == input[item.span.left+item.dot].w item.dot += 1 - item.span.right += 1 + item.span.right = item.span.left+item.dot if item.dot == item.rhs.size passive_chart.at(i,j) << Item.new(item) passive_chart.at(i,j).last.span.right = item.span.left+item.dot @@ -133,6 +133,7 @@ def main init active_chart, passive_chart, g, input, n visit(n, n, 1) { |i,j| parse i, j, n, active_chart, passive_chart, g, input } passive_chart.at(0,5).each { |item| puts item.to_s } + passive_chart.at(1,5).each { |item| puts item.to_s } end |