From 4400add706c01ebf1460701c651d66bbf592cfa5 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Wed, 7 May 2014 22:05:31 +0200 Subject: added self-filling, fixing stuff --- grammar.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'grammar.rb') diff --git a/grammar.rb b/grammar.rb index cf321f8..3ee8105 100644 --- a/grammar.rb +++ b/grammar.rb @@ -70,8 +70,8 @@ class Grammar def initialize fn @rules = [] ReadFile.readlines_strip(fn).each_with_index { |s,j| - STDERR.write '.' - STDERR.write "\n" if j%100==0&&j>0 + #STDERR.write '.' + #puts "\n" if j%100==0&&j>0 @rules << Rule.from_s(s) } end @@ -90,8 +90,8 @@ class Grammar end def add_pass_through_rules input - input.each { |w| - @rules << Rule.new(NT.new('X'), [T.new(w)]) + input.each { |terminal| + @rules << Rule.new(NT.new('X'), [T.new(terminal.word)]) } end end -- cgit v1.2.3