summaryrefslogtreecommitdiff
path: root/parse.rb
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-06-12 11:22:44 +0200
committerPatrick Simianer <p@simianer.de>2014-06-12 11:22:44 +0200
commita981df066484f799637c8a0b88209110038e3148 (patch)
treeee9d14e1e99d0aad06854ea8967587aca22e6936 /parse.rb
parent719a996f9acfefa5ff3dc49d36e0ef6e57e74fe3 (diff)
feature vectors
Diffstat (limited to 'parse.rb')
-rw-r--r--parse.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/parse.rb b/parse.rb
index 598aade..454bb14 100644
--- a/parse.rb
+++ b/parse.rb
@@ -33,7 +33,7 @@ end
Span = Struct.new(:left, :right)
class Item < Grammar::Rule
- attr_accessor :left, :right, :tail_spans, :dot
+ attr_accessor :left, :right, :tail_spans, :dot, :f
def initialize rule_or_item, left, right, dot
@lhs = Grammar::NT.new(rule_or_item.lhs.symbol, rule_or_item.lhs.index)
@@ -41,6 +41,7 @@ class Item < Grammar::Rule
@right = right
@rhs = []
@tail_spans = {}
+ @f = rule_or_item.f
@map = (rule_or_item.map ? rule_or_item.map.dup : [])
rule_or_item.rhs.each_with_index { |x,i|
if x.class == Grammar::T