lib/zenlish/parser/zenlish_grammar.rb in zenlish-0.1.12 vs lib/zenlish/parser/zenlish_grammar.rb in zenlish-0.1.13
- old
+ new
@@ -23,15 +23,19 @@
rule 'declarative_simple_sentence' => 'negative_sentence'
rule 'main_clause' => 'simple_sentence'
rule 'dependent_clause' => 'simple_sentence'
rule 'dependent_clause' => 'DemonstrativePronoun'
rule 'affirmative_sentence' => 'noun_phrase verb_phrase'
+ rule 'affirmative_sentence' => 'propositional_phrase Comma noun_phrase verb_phrase'
rule 'affirmative_sentence' => 'AdverbThere IrregularVerbBe verb_be_complement'
rule 'affirmative_sentence' => 'numeral_of IrregularVerbBe verb_be_complement'
rule 'affirmative_sentence' => 'DemonstrativePronoun IrregularVerbBe verb_be_complement'
rule 'affirmative_sentence' => 'DemonstrativePronoun IrregularVerb verb_complement'
rule 'affirmative_sentence' => 'conjunctive_prefix IrregularVerbBe verb_be_complement'
+
+ # Case of time adjunct adverbial put in fromt position
+ rule 'affirmative_sentence' => 'simple_noun_phrase Adverb Comma noun_phrase verb_phrase'
rule 'negative_sentence' => 'noun_phrase negative_verb_phrase'
rule 'negative_sentence' => 'AdverbThere negative_verb_phrase'
rule 'negative_sentence' => 'numeral_of negative_verb_phrase'
rule 'negative_sentence' => 'DemonstrativePronoun negative_verb_phrase'
rule 'negative_sentence' => 'conjunctive_prefix negative_verb_phrase'
@@ -66,20 +70,24 @@
rule 'nominal' => 'Adjective CommonNoun'
rule 'determiner' => 'determiner single_determiner'
rule 'determiner' => 'single_determiner'
rule 'single_determiner' => 'DemonstrativeDeterminer'
rule 'single_determiner' => 'DefiniteArticle'
+ rule 'single_determiner' => 'IndefiniteArticle'
rule 'single_determiner' => 'IndefiniteQuantifier'
rule 'verb_phrase' => 'verb_group'
rule 'verb_phrase' => 'verb_group verb_complement'
rule 'verb_phrase' => 'RegularVerb propositional_phrase'
rule 'verb_phrase' => 'RegularVerbWant Preposition verb_group'
rule 'verb_phrase' => 'RegularVerbWant Preposition verb_group noun_phrase'
rule 'verb_phrase' => 'IrregularVerbDo DemonstrativePronoun'
+ rule 'verb_phrase' => 'IrregularVerbDo DemonstrativePronoun propositional_phrase'
rule 'verb_phrase' => 'ModalVerbCan verb_group DemonstrativePronoun'
rule 'verb_phrase' => 'IrregularVerbBe verb_be_complement'
rule 'verb_phrase' => 'IrregularVerbSay Colon Quote affirmative_sentence Period Quote'
rule 'verb_complement' => 'noun_phrase'
+ # perception verb (hear, see, watch, notice, ...): verb + object + infinitive
+ rule 'verb_complement' => 'simple_noun_phrase lexical_verb'
rule 'verb_complement' => 'Adjective propositional_phrase'
rule 'verb_complement' => 'noun_phrase IrregularVerbBe verb_be_complement'
rule 'verb_complement' => 'adverb_phrase'
rule 'verb_complement' => 'noun_phrase adverb_phrase'
rule 'verb_be_complement' => 'noun_phrase'