From f714aa1be20cc92d77cc3cffd203a848868d98e2 Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Fri, 2 May 2014 19:05:29 +0200 Subject: arity-0 rules with rhs.size > 1 --- grammar.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'grammar.rb') diff --git a/grammar.rb b/grammar.rb index 02f4270..ac97fbd 100644 --- a/grammar.rb +++ b/grammar.rb @@ -1,5 +1,6 @@ require 'nlp_ruby' + class Terminal attr_accessor :w @@ -44,7 +45,7 @@ class Rule end def to_s - "#{lhs} -> #{rhs.map{|i|i.to_s}.join ' '} (#{arity}) (#{@span.left}, #{@span.right})" + "#{lhs} -> #{rhs.map{|i|i.to_s}.join ' '} a:#{arity} (#{@span.left}, #{@span.right})" end def arity @@ -89,8 +90,3 @@ class Grammar end end - - - - - -- cgit v1.2.3