summaryrefslogtreecommitdiff
path: root/grammar.rb
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-05-02 19:05:29 +0200
committerPatrick Simianer <p@simianer.de>2014-05-02 19:05:29 +0200
commitf714aa1be20cc92d77cc3cffd203a848868d98e2 (patch)
tree4d8b4d63f9d618b8cf734b2ff18c653ea38b908e /grammar.rb
parent2f65a33d9e55bd53de73389330a8c36665a98b03 (diff)
arity-0 rules with rhs.size > 1
Diffstat (limited to 'grammar.rb')
-rw-r--r--grammar.rb8
1 files changed, 2 insertions, 6 deletions
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
-
-
-
-
-