lib/zenlish/parser/zenlish_grammar.rb in zenlish-0.1.01 vs lib/zenlish/parser/zenlish_grammar.rb in zenlish-0.1.02
- old
+ new
@@ -12,27 +12,39 @@
rule 'language' => 'sentence'
rule 'sentence' => 'simple_sentence'
rule 'simple_sentence' => 'declarative_simple_sentence Period'
rule 'declarative_simple_sentence' => 'noun_phrase verb_phrase'
- rule 'noun_phrase' => 'noun_bar'
- rule 'noun_phrase' => 'determiner noun_bar'
- rule 'noun_phrase' => 'numeral noun_bar'
- rule 'noun_phrase' => 'determiner numeral noun_bar'
+ rule 'noun_phrase' => 'nominal'
+ rule 'noun_phrase' => 'determiner nominal'
+ rule 'noun_phrase' => 'numeral nominal'
+ rule 'noun_phrase' => 'determiner numeral nominal'
rule 'noun_phrase' => 'ProperNoun'
rule 'noun_phrase' => 'IndefinitePronoun'
- rule 'noun_bar' => 'CommonNoun'
- rule 'noun_bar' => 'Adjective CommonNoun'
- rule 'noun_bar' => 'Adjective CommonNoun comparative_clause'
- rule 'determiner' => 'DemonstrativeDeterminer'
- rule 'determiner' => 'DefiniteArticle'
- rule 'verb_phrase' => 'lexical_verb'
+ rule 'nominal' => 'CommonNoun'
+ rule 'nominal' => 'Adjective CommonNoun'
+ rule 'nominal' => 'Adjective CommonNoun comparative_clause'
+ rule 'determiner' => 'determiner single_determiner'
+ rule 'determiner' => 'single_determiner'
+ rule 'single_determiner' => 'DemonstrativeDeterminer'
+ rule 'single_determiner' => 'DefiniteArticle'
+ rule 'single_determiner' => 'IndefiniteQuantifier'
+ rule 'verb_phrase' => 'lexical_verb'
rule 'verb_phrase' => 'lexical_verb noun_phrase'
+ rule 'verb_phrase' => 'lexical_verb adverb_phrase'
+ rule 'verb_phrase' => 'lexical_verb propositional_phrase'
+ rule 'verb_phrase' => 'lexical_verb noun_phrase adverb_phrase'
+ rule 'verb_phrase' => 'lexical_verb noun_phrase propositional_phrase'
rule 'lexical_verb' => 'IrregularVerb'
rule 'numeral' => 'Cardinal'
rule 'comparative_clause' => 'comparative_start noun_phrase verb_phrase'
rule 'comparative_start' => 'ComparativeParticle'
+ rule 'adverb_phrase' => 'Adverb'
+ rule 'adverb_phrase' => 'Adverb propositional_phrase'
+ rule 'propositional_phrase' => 'Preposition propositional_complement'
+ rule 'propositional_complement' => 'noun_phrase'
end
+
# CGE p. 354 The order of determiners: quantifier > article or demonstrative
# or possessive > numeral > head
# And now build the grammar...