diff options
author | Patrick Simianer <p@simianer.de> | 2014-06-12 11:22:44 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-06-12 11:22:44 +0200 |
commit | a981df066484f799637c8a0b88209110038e3148 (patch) | |
tree | ee9d14e1e99d0aad06854ea8967587aca22e6936 /parse.rb | |
parent | 719a996f9acfefa5ff3dc49d36e0ef6e57e74fe3 (diff) |
feature vectors
Diffstat (limited to 'parse.rb')
-rw-r--r-- | parse.rb | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 |