zenlish 0.2.05 → 0.2.07

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +228 -0
  3. data/CHANGELOG.md +19 -0
  4. data/Gemfile +5 -3
  5. data/LICENSE.txt +1 -1
  6. data/Rakefile +5 -3
  7. data/lib/zenlish/feature/boolean_domain.rb +6 -4
  8. data/lib/zenlish/feature/boolean_value.rb +3 -2
  9. data/lib/zenlish/feature/enumeration_domain.rb +5 -2
  10. data/lib/zenlish/feature/feature.rb +9 -7
  11. data/lib/zenlish/feature/feature_def.rb +9 -6
  12. data/lib/zenlish/feature/feature_domain.rb +4 -2
  13. data/lib/zenlish/feature/feature_struct.rb +3 -1
  14. data/lib/zenlish/feature/feature_struct_def.rb +5 -3
  15. data/lib/zenlish/feature/feature_struct_def_bearer.rb +6 -4
  16. data/lib/zenlish/feature/feature_value.rb +4 -2
  17. data/lib/zenlish/feature/identifier_domain.rb +5 -3
  18. data/lib/zenlish/feature/identifier_value.rb +3 -2
  19. data/lib/zenlish/feature/symbol_value.rb +3 -1
  20. data/lib/zenlish/inflect/atomic_o_expression.rb +2 -1
  21. data/lib/zenlish/inflect/composite_o_expression.rb +3 -1
  22. data/lib/zenlish/inflect/concatenation.rb +3 -2
  23. data/lib/zenlish/inflect/equals_literal.rb +3 -1
  24. data/lib/zenlish/inflect/feature_heading.rb +2 -5
  25. data/lib/zenlish/inflect/formal_argument.rb +3 -1
  26. data/lib/zenlish/inflect/function_call.rb +4 -1
  27. data/lib/zenlish/inflect/heading.rb +2 -0
  28. data/lib/zenlish/inflect/inflection_rule.rb +2 -0
  29. data/lib/zenlish/inflect/inflection_table.rb +6 -4
  30. data/lib/zenlish/inflect/inflection_table_builder.rb +21 -18
  31. data/lib/zenlish/inflect/input_asis.rb +3 -0
  32. data/lib/zenlish/inflect/input_expression.rb +4 -2
  33. data/lib/zenlish/inflect/literal_asis.rb +4 -1
  34. data/lib/zenlish/inflect/matches_pattern.rb +2 -0
  35. data/lib/zenlish/inflect/membership.rb +2 -0
  36. data/lib/zenlish/inflect/method_heading.rb +3 -6
  37. data/lib/zenlish/inflect/not_equals_literal.rb +2 -0
  38. data/lib/zenlish/inflect/nullary_input_expression.rb +3 -1
  39. data/lib/zenlish/inflect/output_expression.rb +6 -0
  40. data/lib/zenlish/inflect/substitution.rb +3 -1
  41. data/lib/zenlish/inflect/unary_input_expression.rb +4 -1
  42. data/lib/zenlish/inflect/unconditionally_true.rb +4 -2
  43. data/lib/zenlish/lang/dictionary.rb +19 -16
  44. data/lib/zenlish/lang/lemmatizer.rb +40 -0
  45. data/lib/zenlish/lang/zenlish_grammar.rb +6 -4
  46. data/lib/zenlish/lex/empty_lexicon_factory.rb +3 -2
  47. data/lib/zenlish/lex/lexeme.rb +6 -4
  48. data/lib/zenlish/lex/lexical_entry.rb +6 -4
  49. data/lib/zenlish/lex/lexicon.rb +4 -3
  50. data/lib/zenlish/lex/literal.rb +3 -1
  51. data/lib/zenlish/lexer/lexer.rb +144 -0
  52. data/lib/zenlish/trie/base_trie_node.rb +27 -0
  53. data/lib/zenlish/trie/trie.rb +132 -0
  54. data/lib/zenlish/trie/trie_node.rb +21 -0
  55. data/lib/zenlish/trie/trie_root.rb +10 -0
  56. data/lib/zenlish/version.rb +3 -1
  57. data/lib/zenlish/wclasses/adjective.rb +4 -2
  58. data/lib/zenlish/wclasses/adverb.rb +3 -1
  59. data/lib/zenlish/wclasses/adverb_maybe.rb +3 -1
  60. data/lib/zenlish/wclasses/adverb_not.rb +2 -0
  61. data/lib/zenlish/wclasses/all_word_classes.rb +3 -1
  62. data/lib/zenlish/wclasses/article.rb +2 -0
  63. data/lib/zenlish/wclasses/auxiliary.rb +2 -0
  64. data/lib/zenlish/wclasses/auxiliary_be.rb +7 -6
  65. data/lib/zenlish/wclasses/auxiliary_do.rb +6 -5
  66. data/lib/zenlish/wclasses/cardinal.rb +3 -1
  67. data/lib/zenlish/wclasses/common_noun.rb +2 -0
  68. data/lib/zenlish/wclasses/comparative_particle.rb +5 -3
  69. data/lib/zenlish/wclasses/conjunction.rb +2 -0
  70. data/lib/zenlish/wclasses/conjunctive_pronoun.rb +2 -0
  71. data/lib/zenlish/wclasses/coordinator.rb +4 -2
  72. data/lib/zenlish/wclasses/definite_article.rb +2 -0
  73. data/lib/zenlish/wclasses/degree_adverb.rb +2 -0
  74. data/lib/zenlish/wclasses/demonstrative_determiner.rb +6 -4
  75. data/lib/zenlish/wclasses/demonstrative_pronoun.rb +2 -0
  76. data/lib/zenlish/wclasses/determiner.rb +3 -1
  77. data/lib/zenlish/wclasses/distributive_determiner.rb +2 -0
  78. data/lib/zenlish/wclasses/existential_there.rb +2 -0
  79. data/lib/zenlish/wclasses/fronting_quantifier.rb +3 -1
  80. data/lib/zenlish/wclasses/indefinite_article.rb +2 -0
  81. data/lib/zenlish/wclasses/indefinite_pronoun.rb +3 -1
  82. data/lib/zenlish/wclasses/irregular_linking_verb.rb +3 -1
  83. data/lib/zenlish/wclasses/irregular_verb.rb +13 -15
  84. data/lib/zenlish/wclasses/irregular_verb_be.rb +8 -7
  85. data/lib/zenlish/wclasses/irregular_verb_can.rb +8 -7
  86. data/lib/zenlish/wclasses/irregular_verb_do.rb +7 -6
  87. data/lib/zenlish/wclasses/irregular_verb_extension.rb +8 -7
  88. data/lib/zenlish/wclasses/irregular_verb_have.rb +12 -11
  89. data/lib/zenlish/wclasses/irregular_verb_know.rb +3 -1
  90. data/lib/zenlish/wclasses/irregular_verb_say.rb +3 -1
  91. data/lib/zenlish/wclasses/irregular_verb_think.rb +3 -1
  92. data/lib/zenlish/wclasses/lexical_verb.rb +3 -4
  93. data/lib/zenlish/wclasses/linking_adverb.rb +2 -0
  94. data/lib/zenlish/wclasses/modal_verb_can.rb +7 -5
  95. data/lib/zenlish/wclasses/noun.rb +4 -2
  96. data/lib/zenlish/wclasses/numeral.rb +2 -0
  97. data/lib/zenlish/wclasses/personal_pronoun.rb +8 -6
  98. data/lib/zenlish/wclasses/possessive_determiner.rb +13 -12
  99. data/lib/zenlish/wclasses/preposition.rb +3 -1
  100. data/lib/zenlish/wclasses/preposition_of.rb +2 -0
  101. data/lib/zenlish/wclasses/preposition_than.rb +2 -0
  102. data/lib/zenlish/wclasses/pronoun.rb +3 -1
  103. data/lib/zenlish/wclasses/proper_noun.rb +10 -8
  104. data/lib/zenlish/wclasses/quantifier.rb +3 -1
  105. data/lib/zenlish/wclasses/regular_verb.rb +9 -9
  106. data/lib/zenlish/wclasses/regular_verb_want.rb +4 -2
  107. data/lib/zenlish/wclasses/relative_pronoun.rb +4 -2
  108. data/lib/zenlish/wclasses/subordinating_conjunction.rb +7 -5
  109. data/lib/zenlish/wclasses/verb.rb +5 -3
  110. data/lib/zenlish/wclasses/word_class.rb +7 -5
  111. data/lib/zenlish.rb +3 -3
  112. data/spec/spec_helper.rb +3 -1
  113. data/spec/zenlish/feature/boolean_domain_spec.rb +16 -16
  114. data/spec/zenlish/feature/boolean_value_spec.rb +7 -6
  115. data/spec/zenlish/feature/enumeration_domain_spec.rb +21 -21
  116. data/spec/zenlish/feature/feature_def_spec.rb +15 -14
  117. data/spec/zenlish/feature/feature_spec.rb +17 -17
  118. data/spec/zenlish/feature/feature_struct_def_bearer_spec.rb +23 -21
  119. data/spec/zenlish/feature/feature_struct_def_spec.rb +26 -25
  120. data/spec/zenlish/feature/identifier_domain_spec.rb +15 -15
  121. data/spec/zenlish/feature/identifier_value_spec.rb +10 -9
  122. data/spec/zenlish/feature/symbol_value_spec.rb +9 -8
  123. data/spec/zenlish/inflect/concatenation_spec.rb +14 -14
  124. data/spec/zenlish/inflect/equals_literal_spec.rb +17 -16
  125. data/spec/zenlish/inflect/feature_heading_spec.rb +22 -21
  126. data/spec/zenlish/inflect/formal_argument_spec.rb +7 -7
  127. data/spec/zenlish/inflect/function_call_spec.rb +11 -12
  128. data/spec/zenlish/inflect/inflection_rule_spec.rb +28 -24
  129. data/spec/zenlish/inflect/inflection_table_builder_spec.rb +62 -57
  130. data/spec/zenlish/inflect/inflection_table_spec.rb +49 -46
  131. data/spec/zenlish/inflect/input_asis_spec.rb +12 -15
  132. data/spec/zenlish/inflect/literal_asis_spec.rb +10 -10
  133. data/spec/zenlish/inflect/matches_pattern_spec.rb +16 -15
  134. data/spec/zenlish/inflect/membership_spec.rb +17 -16
  135. data/spec/zenlish/inflect/method_heading_spec.rb +15 -14
  136. data/spec/zenlish/inflect/not_equals_literal_spec.rb +17 -16
  137. data/spec/zenlish/inflect/substitution_spec.rb +10 -11
  138. data/spec/zenlish/inflect/unconditionally_true_spec.rb +8 -6
  139. data/spec/zenlish/lang/dictionary_spec.rb +28 -31
  140. data/spec/zenlish/lang/lemmatizer_spec.rb +43 -0
  141. data/spec/zenlish/lang/zenlish_grammar_spec.rb +5 -5
  142. data/spec/zenlish/lex/empty_lexicon_factory_spec.rb +8 -8
  143. data/spec/zenlish/lex/lexeme_spec.rb +27 -28
  144. data/spec/zenlish/lex/lexical_entry_spec.rb +15 -15
  145. data/spec/zenlish/lex/lexicon_spec.rb +52 -50
  146. data/spec/zenlish/lex/literal_spec.rb +8 -8
  147. data/spec/zenlish/lexer/lexer_spec.rb +52 -0
  148. data/spec/zenlish/parser/lesson1_spec.rb +81 -81
  149. data/spec/zenlish/parser/lesson2_spec.rb +133 -138
  150. data/spec/zenlish/parser/lesson3_spec.rb +186 -226
  151. data/spec/zenlish/parser/zparser_spec.rb +8 -7
  152. data/spec/zenlish/support/minimal_lexicon.rb +2 -0
  153. data/spec/zenlish/support/var2word.rb +16 -9
  154. data/spec/zenlish/trie/base_trie_node_spec.rb +33 -0
  155. data/spec/zenlish/trie/trie_spec.rb +108 -0
  156. data/spec/zenlish/wclasses/common_noun_spec.rb +15 -19
  157. data/spec/zenlish/wclasses/demonstrative_determiner_spec.rb +12 -12
  158. data/spec/zenlish/wclasses/irregular_verb_can_spec.rb +18 -18
  159. data/spec/zenlish/wclasses/irregular_verb_extension_spec.rb +10 -10
  160. data/spec/zenlish/wclasses/irregular_verb_spec.rb +28 -28
  161. data/spec/zenlish/wclasses/lexical_verb_spec.rb +9 -9
  162. data/spec/zenlish/wclasses/modal_verb_can_spec.rb +12 -12
  163. data/spec/zenlish/wclasses/noun_spec.rb +7 -7
  164. data/spec/zenlish/wclasses/personal_pronoun_spec.rb +20 -23
  165. data/spec/zenlish/wclasses/possessive_determiner_spec.rb +28 -31
  166. data/spec/zenlish/wclasses/preposition_spec.rb +5 -5
  167. data/spec/zenlish/wclasses/proper_noun_spec.rb +3 -3
  168. data/spec/zenlish/wclasses/regular_verb_spec.rb +30 -30
  169. data/spec/zenlish/wclasses/regular_verb_want_spec.rb +30 -0
  170. data/spec/zenlish/wclasses/verb_spec.rb +9 -9
  171. data/spec/zenlish_spec.rb +4 -2
  172. data/zenlish.gemspec +18 -14
  173. metadata +49 -16
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require_relative '../../spec_helper' # Use the RSpec framework
3
4
  require_relative '../support/var2word'
4
5
  require_relative '../../../lib/zenlish/parser/zparser' # Load the class under test
@@ -8,39 +9,37 @@ module Zenlish
8
9
  describe ZParser do
9
10
  include Var2Word
10
11
 
11
- subject { ZParser.new }
12
+ subject(:parser) { described_class.new }
12
13
 
13
14
  context 'Parsing lesson 3:' do
14
- it 'should parse sample sentences from lesson 3-A' do
15
+ it 'parses sample sentences from lesson 3-A' do
15
16
  # Sentence 3-01a definiendum: 'J happens to something that does K.'
16
17
  literals = [j_, happens, to, something, that, does, k_, dot]
17
- expect { subject.to_pforest(literals) }.not_to raise_error
18
+ expect { parser.to_pforest(literals) }.not_to raise_error
18
19
 
19
20
  # Sentence 3-01b definiens: 'J happens to something.
20
21
  # This same something does K.
21
22
  # [Tony has something that Lisa wants.]'
22
23
  literals = [j_, happens, to, something, dot,
23
24
  this, same, thing, does, k_, dot,
24
- tony, has, something, that, lisa, wants, dot
25
- ]
26
- expect { subject.to_pforest(literals) }.not_to raise_error
25
+ tony, has, something, that, lisa, wants, dot]
26
+ expect { parser.to_pforest(literals) }.not_to raise_error
27
27
 
28
28
  # Sentence 3-02a definiendum: 'J is true, and K is true.'
29
29
  literals = [j_, is, true_, comma, and_, k_, is, true_, dot]
30
- expect { subject.to_pforest(literals) }.not_to raise_error
30
+ expect { parser.to_pforest(literals) }.not_to raise_error
31
31
 
32
32
  # Sentence 3-02b definiens: 'These two things are true: J is true.
33
33
  # K is true.'
34
34
  # [Lisa sees Tony, and Tony sees Lisa.]'
35
35
  literals = [these, two, things, are, true_, colon, j_, is, true_, dot,
36
36
  k_, is, true_, dot,
37
- lisa, sees, tony, comma, and_, tony, sees, lisa, dot
38
- ]
39
- expect { subject.to_pforest(literals) }.not_to raise_error
37
+ lisa, sees, tony, comma, and_, tony, sees, lisa, dot]
38
+ expect { parser.to_pforest(literals) }.not_to raise_error
40
39
 
41
40
  # Sentence 3-02c definiendum: 'J and K do X.'
42
41
  literals = [j_, and_, k_, do_, x_as_noun, dot]
43
- expect { subject.to_pforest(literals) }.not_to raise_error
42
+ expect { parser.to_pforest(literals) }.not_to raise_error
44
43
 
45
44
  # Sentence 3-02d definiens: 'These two things do X.
46
45
  # J is one that does this.
@@ -51,112 +50,100 @@ module Zenlish
51
50
  j_, is, one_as_adj, that, does, this_as_pronoun, dot,
52
51
  k_, is, another, that, does, this_as_pronoun, dot,
53
52
  tony, and_, lisa, want, to, see, me, dot,
54
- i_pronoun, see, tony, and_, lisa, dot
55
- ]
56
- expect { subject.to_pforest(literals) }.not_to raise_error
53
+ i_pronoun, see, tony, and_, lisa, dot]
54
+ expect { parser.to_pforest(literals) }.not_to raise_error
57
55
 
58
56
  # Sentence 3-03a definiendum: 'J is true, or K is true.'
59
57
  literals = [j_, is, true_, comma, or_, k_, is, true_, dot]
60
- expect { subject.to_pforest(literals) }.not_to raise_error
58
+ expect { parser.to_pforest(literals) }.not_to raise_error
61
59
 
62
60
  # Sentence 3-03b definiens: 'If J is not true, then K is true.
63
61
  # [Tony saw me, or Lisa heard me.]
64
62
  literals = [if_, j_, is, not_, true_, comma,
65
- then_, k_, is, true_, dot,
66
- tony, saw, me, comma, or_, lisa, heard, me, dot
67
- ]
68
- expect { subject.to_pforest(literals) }.not_to raise_error
63
+ then_, k_, is, true_, dot,
64
+ tony, saw, me, comma, or_, lisa, heard, me, dot]
65
+ expect { parser.to_pforest(literals) }.not_to raise_error
69
66
 
70
67
  # Sentence 3-03c definiendum: 'J or K does this.'
71
68
  literals = [j_, or_, k_, does, this_as_pronoun, dot]
72
- expect { subject.to_pforest(literals) }.not_to raise_error
69
+ expect { parser.to_pforest(literals) }.not_to raise_error
73
70
 
74
71
  # Sentence 3-03d definiendum: 'If J does not do this, then K does this.'
75
72
  literals = [if_, j_, does_aux, not_, do_, this_as_pronoun, comma,
76
73
  then_, k_, does, this_as_pronoun, dot]
77
- expect { subject.to_pforest(literals) }.not_to raise_error
74
+ expect { parser.to_pforest(literals) }.not_to raise_error
78
75
 
79
76
  # Sentence 3-03e: '[Lisa or Tony said something.]
80
77
  # [This belongs to Tony or Lisa.]'
81
78
  literals = [lisa, or_, tony, said, something, dot,
82
- this_as_pronoun, belongs, to, tony, or_, lisa, dot
83
- ]
84
- expect { subject.to_pforest(literals) }.not_to raise_error
79
+ this_as_pronoun, belongs, to, tony, or_, lisa, dot]
80
+ expect { parser.to_pforest(literals) }.not_to raise_error
85
81
 
86
82
  # Sentence 3-04a definiendum: 'It does something.'
87
83
  literals = [it_, does, something, dot]
88
- expect { subject.to_pforest(literals) }.not_to raise_error
84
+ expect { parser.to_pforest(literals) }.not_to raise_error
89
85
 
90
86
  # Sentence 3-04b definiens: 'This thing does something.'
91
87
  # [I touched this thing, and it moved.]
92
88
  literals = [this, thing, does, something, dot,
93
- i_pronoun, touched, this, thing, comma, and_, it_, moved, dot
94
- ]
95
- expect { subject.to_pforest(literals) }.not_to raise_error
89
+ i_pronoun, touched, this, thing, comma, and_, it_, moved, dot]
90
+ expect { parser.to_pforest(literals) }.not_to raise_error
96
91
 
97
92
  # Sentence 3-04c definiendum: 'They do something.'
98
- literals = [they, does, something, dot
99
- ]
100
- expect { subject.to_pforest(literals) }.not_to raise_error
93
+ literals = [they, does, something, dot]
94
+ expect { parser.to_pforest(literals) }.not_to raise_error
101
95
 
102
96
  # Sentence 3-04d definiens: 'These things or people do something.'
103
97
  # [Something happens to them.] = Something happens to these things or people.
104
- literals = [ these, things, or_, people, do_, something, dot,
98
+ literals = [these, things, or_, people, do_, something, dot,
105
99
  something, happens, to, them, dot,
106
- something, happens, to, these, things, or_, people, dot
107
- ]
108
- expect { subject.to_pforest(literals) }.not_to raise_error
100
+ something, happens, to, these, things, or_, people, dot]
101
+ expect { parser.to_pforest(literals) }.not_to raise_error
109
102
  end
110
103
 
111
- it 'should parse sample sentences from lesson 3-B' do
104
+ it 'parses sample sentences from lesson 3-B' do
112
105
  # Sentence 3-05a definiendum: 'This is its X.'
113
- literals = [this_as_pronoun, is, its, x_as_noun, dot
114
- ]
115
- expect { subject.to_pforest(literals) }.not_to raise_error
106
+ literals = [this_as_pronoun, is, its, x_as_noun, dot]
107
+ expect { parser.to_pforest(literals) }.not_to raise_error
116
108
 
117
109
  # Sentence 3-05b definiens: 'This X belongs to it.
118
110
  # [I saw this thing and touched some of its parts.]
119
111
  # [These things are their things.] = These things belong to them.
120
112
  literals = [this, x_as_noun, belongs, to, it_, dot,
121
- i_pronoun, saw, this, thing, and_, touched, some, of, its, parts, dot
122
- ]
123
- expect { subject.to_pforest(literals) }.not_to raise_error
113
+ i_pronoun, saw, this, thing, and_, touched, some, of, its, parts, dot]
114
+ expect { parser.to_pforest(literals) }.not_to raise_error
124
115
 
125
116
  # Sentence 3-05c definiendum: 'These things are their things.'
126
- literals = [these, things, are, their, things, dot
127
- ]
128
- expect { subject.to_pforest(literals) }.not_to raise_error
117
+ literals = [these, things, are, their, things, dot]
118
+ expect { parser.to_pforest(literals) }.not_to raise_error
129
119
 
130
120
  # Sentence 3-05d definiens: 'These things belong to them.
131
121
  literals = [these, things, belong, to, them, dot]
132
- expect { subject.to_pforest(literals) }.not_to raise_error
122
+ expect { parser.to_pforest(literals) }.not_to raise_error
133
123
 
134
124
  # Sentence 3-06a definiendum: 'This is your X.'
135
125
  literals = [this_as_pronoun, is, your, x_as_noun, dot]
136
- expect { subject.to_pforest(literals) }.not_to raise_error
126
+ expect { parser.to_pforest(literals) }.not_to raise_error
137
127
 
138
128
  # Sentence 3-06b definien: 'This X belongs to you.
139
129
  # [You feel something touching your body.]
140
130
  literals = [this, x_as_noun, belongs, to, you, dot,
141
- you, feel, something, touching, your, body, dot
142
- ]
143
- expect { subject.to_pforest(literals) }.not_to raise_error
131
+ you, feel, something, touching, your, body, dot]
132
+ expect { parser.to_pforest(literals) }.not_to raise_error
144
133
 
145
134
  # Sentence 3-07a definiendum: 'This is my X.'
146
- literals = [this_as_pronoun, is, my, x_as_noun, dot,
147
- ]
148
- expect { subject.to_pforest(literals) }.not_to raise_error
135
+ literals = [this_as_pronoun, is, my, x_as_noun, dot]
136
+ expect { parser.to_pforest(literals) }.not_to raise_error
149
137
 
150
138
  # Sentence 3-07b definiens: 'This X belongs to me.
151
139
  # [I do not want you to touch my body.]
152
140
  literals = [this, x_as_noun, belongs, to, me, dot,
153
- i_pronoun, do_aux, not_, want, to, touch, my, body, dot
154
- ]
155
- expect { subject.to_pforest(literals) }.not_to raise_error
141
+ i_pronoun, do_aux, not_, want, to, touch, my, body, dot]
142
+ expect { parser.to_pforest(literals) }.not_to raise_error
156
143
 
157
144
  # Sentence 3-08a definiendum: 'There is an X here.'
158
145
  literals = [there, is, an, x_as_noun, here, dot]
159
- expect { subject.to_pforest(literals) }.not_to raise_error
146
+ expect { parser.to_pforest(literals) }.not_to raise_error
160
147
 
161
148
  # Sentence 3-08b definiens: 'X is some kind of thing.
162
149
  # There is one of this kind of thing here.
@@ -165,24 +152,23 @@ module Zenlish
165
152
  literals = [x_as_noun, is, some, kind, of, thing, dot,
166
153
  there, is, one, of, this, kind, of, thing, here, dot,
167
154
  this_as_pronoun, is, not_, one_as_adj, that, you, said, something,
168
- about, a_as_art, short, time, before_as_adj, now_as_noun, dot
169
- ]
170
- expect { subject.to_pforest(literals) }.not_to raise_error
155
+ about, a_as_art, short, time, before_as_adj, now_as_noun, dot]
156
+ expect { parser.to_pforest(literals) }.not_to raise_error
171
157
 
172
158
  # Sentence 3-Bxa 'Lisa sees a living thing that is very big.
173
159
  # Lisa says: "I see one living thing. Its body is bigger than my body.", dot
174
160
  literals = [
175
161
  lisa, sees, a_as_art, living, thing, that, is, very, big, dot,
176
162
  lisa, says, colon, quote, i_pronoun, see, one, living, thing, dot,
177
- its, body, is, bigger, than, my, body, dot, quote, dot
163
+ its, body, is, bigger, than, my, body, dot, quote, dot
178
164
  ]
179
- expect { subject.to_pforest(literals) }.not_to raise_error
165
+ expect { parser.to_pforest(literals) }.not_to raise_error
180
166
  end
181
167
 
182
- it 'should parse sample sentences from lesson 3-C' do
168
+ it 'parses sample sentences from lesson 3-C' do
183
169
  # Sentence 3-09a definiendum: 'Something happens to the X.'
184
170
  literals = [something, happens, to, the, x_as_noun, dot]
185
- expect { subject.to_pforest(literals) }.not_to raise_error
171
+ expect { parser.to_pforest(literals) }.not_to raise_error
186
172
 
187
173
  # Sentence 3-09b definiens: Something happens to X.
188
174
  # This is the same X that someone said something about a short time before,
@@ -190,87 +176,81 @@ module Zenlish
190
176
  # [I saw two people here before, and now I do not see the people.]
191
177
  literals = [something, happens, to, x_as_noun, dot,
192
178
  this_as_pronoun, is, the, same, x_as_noun, that, someone, said, something, about,
193
- a_as_art, short, time, before_as_adj, comma,
194
- or_, there, is, not_, another, thing, that, is, the, same, kind,
195
- as, x_as_noun, dot,
179
+ a_as_art, short, time, before_as_adj, comma,
180
+ or_, there, is, not_, another, thing, that, is, the, same, kind,
181
+ as, x_as_noun, dot,
196
182
  i_pronoun, saw, two, people, here, before_adverb, comma,
197
- and_, now, i_pronoun, do_aux, not_, see, the, people, dot
198
- ]
199
- expect { subject.to_pforest(literals) }.not_to raise_error
183
+ and_, now, i_pronoun, do_aux, not_, see, the, people, dot]
184
+ expect { parser.to_pforest(literals) }.not_to raise_error
200
185
 
201
186
  # Sentence 3-10a definiendum: 'X is an animal.'
202
187
  literals = [x_as_noun, is, an, animal, dot]
203
- expect { subject.to_pforest(literals) }.not_to raise_error
188
+ expect { parser.to_pforest(literals) }.not_to raise_error
204
189
 
205
190
  # Sentence 3-10b definiens: There are many kinds of living things
206
191
  # that can feel and can move when they want. X is one of these.
207
192
  # [The animal moved when someone touched its body.]
208
- literals = [ there, are, many, kinds, of, living, things,
209
- that, can, feel, and_, can, move, when_, they, want, dot,
210
- x_as_noun, is, one, of, these_as_pronoun, dot,
211
- the, animal, moved, when_, someone, touched, its, body, dot
212
- ]
213
- expect { subject.to_pforest(literals) }.not_to raise_error
193
+ literals = [there, are, many, kinds, of, living, things,
194
+ that, can, feel, and_, can, move, when_, they, want, dot,
195
+ x_as_noun, is, one, of, these_as_pronoun, dot,
196
+ the, animal, moved, when_, someone, touched, its, body, dot]
197
+ expect { parser.to_pforest(literals) }.not_to raise_error
214
198
 
215
199
  # Sentence 3-11a definiendum: 'J causes K to happen.'
216
200
  literals = [j_, causes, k_, to, happen, dot]
217
- expect { subject.to_pforest(literals) }.not_to raise_error
201
+ expect { parser.to_pforest(literals) }.not_to raise_error
218
202
 
219
203
  # Sentence 3-11b definiens: K happens because J happens
220
204
  # or because J does something.
221
205
  # [Someone bad caused these people to die.]
222
- literals = [ k_, happens, because, j_, happens,
206
+ literals = [k_, happens, because, j_, happens,
223
207
  or_, because, j_, does, something, dot,
224
- something, bad, caused, these, people, to, die, dot
225
- ]
226
- expect { subject.to_pforest(literals) }.not_to raise_error
208
+ something, bad, caused, these, people, to, die, dot]
209
+ expect { parser.to_pforest(literals) }.not_to raise_error
227
210
 
228
211
  # Sentence 3-12a definiendum: 'J is true, but K is not true.'
229
212
  literals = [j_, is, true_, comma, but, k_, is, not_, true_, dot]
230
- expect { subject.to_pforest(literals) }.not_to raise_error
213
+ expect { parser.to_pforest(literals) }.not_to raise_error
231
214
 
232
215
  # Sentence 3-12b definiens: You say J is true.
233
216
  # Maybe when some people hear J is true,
234
217
  # they think K is true because of this.
235
218
  # You want them to know K is not true, and you say this.
236
219
  # [I hear Tony, but I do not see Tony.]
237
- literals = [ maybe, when_, some, people, hear, j_, is, true_, comma,
238
- they, think, k_, is, true_, because, of, this_as_pronoun, dot,
220
+ literals = [maybe, when_, some, people, hear, j_, is, true_, comma,
221
+ they, think, k_, is, true_, because, of, this_as_pronoun, dot,
239
222
  you, want, them, to, know, k_, is, not_, true_, comma,
240
223
  and_, you, say, this_as_pronoun, dot,
241
- i_pronoun, hear, tony, comma, but, i_pronoun, do_aux, not_, see, lisa, dot
242
- ]
243
- expect { subject.to_pforest(literals) }.not_to raise_error
224
+ i_pronoun, hear, tony, comma, but, i_pronoun, do_aux, not_, see, lisa, dot]
225
+ expect { parser.to_pforest(literals) }.not_to raise_error
244
226
 
245
227
  # Sentence 3-C Xtra Lisa says: "I can hear an animal, but I do not see it."
246
228
  # Tony says: "I can see the animal that you hear.".
247
- literals = [ lisa, says, colon, quote, i_pronoun, can, hear, an,
248
- animal, comma, but, i_pronoun, do_aux, not_, see, it_, dot, quote,
229
+ literals = [lisa, says, colon, quote, i_pronoun, can, hear, an,
230
+ animal, comma, but, i_pronoun, do_aux, not_, see, it_, dot, quote,
249
231
  dot, tony, says, colon, quote, i_pronoun, can, see, the, animal,
250
- that, you, hear, dot, quote, dot
251
- ]
252
- expect { subject.to_pforest(literals) }.not_to raise_error
232
+ that, you, hear, dot, quote, dot]
233
+ expect { parser.to_pforest(literals) }.not_to raise_error
253
234
  end
254
235
 
255
- it 'should parse sample sentences from lesson 3-D' do
236
+ it 'parses sample sentences from lesson 3-D' do
256
237
  # Sentence 3-13a definiendum: 'You use this thing.'
257
238
  literals = [you, use, this, thing, dot]
258
- expect { subject.to_pforest(literals) }.not_to raise_error
239
+ expect { parser.to_pforest(literals) }.not_to raise_error
259
240
 
260
241
  # Sentence 3-13b definiens: You do something with this thing
261
242
  # because you think this can cause something to happen that you want.
262
243
  # [I used something big to cause people far from here to see me.]
263
- literals = [ you, do_, something, with, this, thing, because, you,
244
+ literals = [you, do_, something, with, this, thing, because, you,
264
245
  think, this_as_pronoun, can, cause, something, to, happen,
265
246
  that, you, want, dot,
266
247
  i_pronoun, used, something, big, to, cause, people, far, from,
267
- here_as_noun, to, see, me, dot
268
- ]
269
- expect { subject.to_pforest(literals) }.not_to raise_error
248
+ here_as_noun, to, see, me, dot]
249
+ expect { parser.to_pforest(literals) }.not_to raise_error
270
250
 
271
251
  # Sentence 3-14a definiendum: 'You know X about each of these things.'
272
252
  literals = [you, know, x_as_noun, about, each_, of, these, things, dot]
273
- expect { subject.to_pforest(literals) }.not_to raise_error
253
+ expect { parser.to_pforest(literals) }.not_to raise_error
274
254
 
275
255
  # Sentence 3-14b definiens: There are two or more things.
276
256
  # You think about all these things like this:
@@ -278,70 +258,66 @@ module Zenlish
278
258
  # [Each person here said something to me.]
279
259
  # because you think this can cause something to happen that you want.
280
260
  # [I used something big to cause people far from here to see me.]
281
- literals = [ there, are, two, or_, more, things, dot,
261
+ literals = [there, are, two, or_, more, things, dot,
282
262
  you, think, about, all, these, things, like, this_as_pronoun, colon,
283
- if_, something, is, one, of, these, things, comma,
284
- then_, you, know, x_as_noun, about, it_, dot,
285
- each_, person, here, said, something, to, me, dot
286
- ]
287
- expect { subject.to_pforest(literals) }.not_to raise_error
263
+ if_, something, is, one, of, these, things, comma,
264
+ then_, you, know, x_as_noun, about, it_, dot,
265
+ each_, person, here, said, something, to, me, dot]
266
+ expect { parser.to_pforest(literals) }.not_to raise_error
288
267
 
289
268
  # Sentence 3-15a definiendum: 'Someplace an X exists.'
290
269
  literals = [someplace, an, x_as_noun, exists, dot]
291
- expect { subject.to_pforest(literals) }.not_to raise_error
270
+ expect { parser.to_pforest(literals) }.not_to raise_error
292
271
 
293
272
  # Sentence 3-15b definiens: Someplace there is an X,
294
273
  # or someplace an X is alive.
295
274
  # [This kind of thing did not exist before this time.]
296
- literals = [ someplace, there, is, an, x_as_noun, comma,
275
+ literals = [someplace, there, is, an, x_as_noun, comma,
297
276
  or_, someplace, an, x_as_noun, is, alive, dot,
298
277
  this, kind, of, thing, did, not_, exist, before, this, time, dot]
299
- expect { subject.to_pforest(literals) }.not_to raise_error
278
+ expect { parser.to_pforest(literals) }.not_to raise_error
300
279
 
301
280
  # Sentence 3-16a definiendum: 'J became K.'
302
281
  literals = [j_, became, k_, dot]
303
- expect { subject.to_pforest(literals) }.not_to raise_error
282
+ expect { parser.to_pforest(literals) }.not_to raise_error
304
283
 
305
284
  # Sentence 3-16b definiens: Something happened to J for some time.
306
285
  # After this happened, K is something true you can know about J.
307
286
  # But before this happened, K was not true.
308
287
  # [These two animals were small before, but they became big.]
309
- literals = [ something, happened, to, j_, for_, some, time, dot,
288
+ literals = [something, happened, to, j_, for_, some, time, dot,
310
289
  after_, this_as_pronoun, happened, comma, k_, is, something, true_,
311
- you, can, know, about, j_, dot,
290
+ you, can, know, about, j_, dot,
312
291
  these, two, animals, were, small, before_adverb, comma,
313
- but, they, became, big, dot
314
- ]
315
- expect { subject.to_pforest(literals) }.not_to raise_error
292
+ but, they, became, big, dot]
293
+ expect { parser.to_pforest(literals) }.not_to raise_error
316
294
 
317
295
  # Sentence 3-Dx: There are some animals here.
318
296
  # Each of these animals was small when it existed a short time.
319
297
  # After a long time, each of these animals became big.
320
298
  literals = [there, are, some, animal, here, dot,
321
299
  each_, of, these, animals, was, small, when_, it_,
322
- existed, a_as_art, short, time, dot,
300
+ existed, a_as_art, short, time, dot,
323
301
  after_, a_as_art, long, time, comma, each_, of, these, animals,
324
- became, big, dot
325
- ]
326
- expect { subject.to_pforest(literals) }.not_to raise_error
302
+ became, big, dot]
303
+ expect { parser.to_pforest(literals) }.not_to raise_error
327
304
  end
328
305
 
329
- it 'should parse sample sentences from lesson 3-E' do
306
+ it 'parses sample sentences from lesson 3-E' do
330
307
  # Sentence 3-17a definiendum: 'These things are different.'
331
308
  literals = [things, are, different, dot]
332
- expect { subject.to_pforest(literals) }.not_to raise_error
309
+ expect { parser.to_pforest(literals) }.not_to raise_error
333
310
 
334
311
  # Sentence 3-17b definiens: These things are not the same.
335
312
  # [I want this kind of thing, but you want something different.]
336
- literals = [ these, things, are, not_, the, same_as_pronoun, dot,
313
+ literals = [these, things, are, not_, the, same_as_pronoun, dot,
337
314
  i_pronoun, want, this, kind, of, thing, comma,
338
- but, you, want, something, different, dot
339
- ]
340
- expect { subject.to_pforest(literals) }.not_to raise_error
315
+ but, you, want, something, different, dot]
316
+ expect { parser.to_pforest(literals) }.not_to raise_error
341
317
 
342
318
  # Sentence 3-18a definiendum: 'J made K.'
343
319
  literals = [j_, made, k_, dot]
344
- expect { subject.to_pforest(literals) }.not_to raise_error
320
+ expect { parser.to_pforest(literals) }.not_to raise_error
345
321
 
346
322
  # Sentence 3-18b definiens: J did something to some things
347
323
  # and caused them to become parts of one different
@@ -349,96 +325,89 @@ module Zenlish
349
325
  # K is this thing that now exists because of this.
350
326
  # [I used many small things to make this big thing.]
351
327
  # [J made K happen.] = J caused K to happen.
352
- literals = [ j_, did, something, to, some, things, and_,
328
+ literals = [j_, did, something, to, some, things, and_,
353
329
  caused, them, to, become, parts, of, one, different, kind, of,
354
330
  thing, that, was, not_, here, before_adverb, dot,
355
331
  k_, is, this, thing, that, now, exists, because, of, this_as_pronoun, dot,
356
332
  i_pronoun, used, many, small, things, to, make, this, big, thing, dot,
357
333
  j_, made, k_, happen, dot,
358
- j_, caused, k_, to, happen, dot
359
- ]
360
- expect { subject.to_pforest(literals) }.not_to raise_error
334
+ j_, caused, k_, to, happen, dot]
335
+ expect { parser.to_pforest(literals) }.not_to raise_error
361
336
 
362
337
  # Sentence 3-19a definiendum: 'J contains K.'
363
338
  literals = [j_, contains, k_, dot]
364
- expect { subject.to_pforest(literals) }.not_to raise_error
339
+ expect { parser.to_pforest(literals) }.not_to raise_error
365
340
 
366
341
  # Sentence 3-19b definiens: K is inside J.
367
342
  # [I made something to contain all these small things.]
368
343
  # [Your body contains many parts.]
369
- literals = [ k_, is, inside, j_, dot,
344
+ literals = [k_, is, inside, j_, dot,
370
345
  i_pronoun, made, something, to, contain, all, these, small, things, dot,
371
- your, body, contains, many, parts, dot,
372
- ]
373
- expect { subject.to_pforest(literals) }.not_to raise_error
346
+ your, body, contains, many, parts, dot]
347
+ expect { parser.to_pforest(literals) }.not_to raise_error
374
348
 
375
349
  # Sentence 3-20a definiendum: 'X is a container.'
376
350
  literals = [x_as_noun, is, a_as_art, container, dot]
377
- expect { subject.to_pforest(literals) }.not_to raise_error
351
+ expect { parser.to_pforest(literals) }.not_to raise_error
378
352
 
379
353
  # Sentence 3-20b definiens: X is something that people make because
380
354
  # they want to use it to contain other things.
381
355
  # [There are two things inside this container.]
382
- literals = [ x_as_noun, is, something, that, people, make, because,
356
+ literals = [x_as_noun, is, something, that, people, make, because,
383
357
  they, want, to, use, it_, to, contain, other, things, dot,
384
- there, are, two, things, inside, this, container, dot
385
- ]
386
- expect { subject.to_pforest(literals) }.not_to raise_error
358
+ there, are, two, things, inside, this, container, dot]
359
+ expect { parser.to_pforest(literals) }.not_to raise_error
387
360
 
388
361
  # Sentence 3-Extra: Someone made these containers.
389
362
  # Each contains a different kind of animal.
390
363
  literals = [someone, made, these, containers, dot,
391
- each_as_pronoun, contains, a_as_art, different, kind, of, animal, dot
392
- ]
393
- expect { subject.to_pforest(literals) }.not_to raise_error
364
+ each_as_pronoun, contains, a_as_art, different, kind, of, animal, dot]
365
+ expect { parser.to_pforest(literals) }.not_to raise_error
394
366
  end
395
367
 
396
- it 'should parse sample sentences from lesson 3-F' do
368
+ it 'parses sample sentences from lesson 3-F' do
397
369
  # Sentence 3-21a definiendum: 'You try to do X.'
398
370
  literals = [you, try_, to, do_, x_as_noun, dot]
399
- expect { subject.to_pforest(literals) }.not_to raise_error
371
+ expect { parser.to_pforest(literals) }.not_to raise_error
400
372
 
401
373
  # Sentence 3-21b definiens: Because you want X to happen,
402
374
  # you do things that you think can cause X to happen.
403
375
  # [I tried to do something good.]
404
- literals = [ because, you, want, x_as_noun, to, happen, comma,
405
- you, do_, things, that, you, think, can, cause, x_as_noun,
376
+ literals = [because, you, want, x_as_noun, to, happen, comma,
377
+ you, do_, things, that, you, think, can, cause, x_as_noun,
406
378
  to, happen, dot,
407
- i_pronoun, tried, to, do_, something, good, dot
408
- ]
409
- expect { subject.to_pforest(literals) }.not_to raise_error
379
+ i_pronoun, tried, to, do_, something, good, dot]
380
+ expect { parser.to_pforest(literals) }.not_to raise_error
410
381
 
411
382
  # Sentence 3-22a definiendum: 'X changed.'
412
383
  literals = [x_as_noun, changed, dot]
413
- expect { subject.to_pforest(literals) }.not_to raise_error
384
+ expect { parser.to_pforest(literals) }.not_to raise_error
414
385
 
415
386
  # Sentence 3-22b definiens: Something happened to X.
416
387
  # Because of this, X is not the same as before.
417
388
  # [After this kind of animal is alive for some time, its body changes.]
418
- literals = [ something, happened, to, x_as_noun, dot,
389
+ literals = [something, happened, to, x_as_noun, dot,
419
390
  because, of, this_as_pronoun, comma, x_as_noun, is, not_, the, same_as_pronoun,
420
391
  as, before_adverb, dot,
421
392
  after_, this, kind, of, animal, is, alive, for_, some, time, comma,
422
- its, body, changes, dot
423
- ]
424
- expect { subject.to_pforest(literals) }.not_to raise_error
393
+ its, body, changes, dot]
394
+ expect { parser.to_pforest(literals) }.not_to raise_error
425
395
 
426
396
  # Sentence 3-22c definiendum: 'J changed K.'
427
397
  literals = [j_, changed, k_, dot]
428
- expect { subject.to_pforest(literals) }.not_to raise_error
398
+ expect { parser.to_pforest(literals) }.not_to raise_error
429
399
 
430
400
  # Sentence 3-22d definiens: J caused K to change.
431
401
  # Because of this, X is not the same as before.
432
402
  # [When these people did something bad, it changed what I thought about them.]
433
- literals = [ j_, caused, k_, to, change_, dot,
403
+ literals = [j_, caused, k_, to, change_, dot,
434
404
  when_, these, people, did, something, bad, comma,
435
- it_, changed, what, i_pronoun, thought, about, them, dot
436
- ]
437
- expect { subject.to_pforest(literals) }.not_to raise_error
405
+ it_, changed, what, i_pronoun, thought, about, them, dot]
406
+ expect { parser.to_pforest(literals) }.not_to raise_error
438
407
 
439
408
  # Sentence 3-23a definiendum: 'You see the surface of X.'
440
409
  literals = [you, see, the, surface, of, x_as_noun, dot]
441
- expect { subject.to_pforest(literals) }.not_to raise_error
410
+ expect { parser.to_pforest(literals) }.not_to raise_error
442
411
 
443
412
  # Sentence 3-23b definiens: You see part of X.
444
413
  # This part is where other things can touch X.
@@ -446,33 +415,31 @@ module Zenlish
446
415
  # [When I touched this thing, I could feel parts of it moving below its surface.]
447
416
  # comment: `where` word was implicitly defined in section 1-25.
448
417
  # `could` verb was implicitly defined in section 2-10.
449
- literals = [ i_pronoun, can, see, the, surface, of, this, thing, comma,
418
+ literals = [i_pronoun, can, see, the, surface, of, this, thing, comma,
450
419
  but, i_pronoun, can, not_, see, what, is, inside, dot,
451
420
  when_, i_pronoun, touched, this, thing, comma, i_pronoun, could,
452
- feel, parts, of, it_, moving, below, its, surface, dot
453
- ]
454
- expect { subject.to_pforest(literals) }.not_to raise_error
421
+ feel, parts, of, it_, moving, below, its, surface, dot]
422
+ expect { parser.to_pforest(literals) }.not_to raise_error
455
423
 
456
424
  # Sentence 3-23c definiendum: 'J is on the surface of K.'
457
425
  literals = [j_, is, on, the, surface, of, k_, dot]
458
- expect { subject.to_pforest(literals) }.not_to raise_error
426
+ expect { parser.to_pforest(literals) }.not_to raise_error
459
427
 
460
428
  # Sentence 3-23d definiens: J is touching the surface of K.
461
- literals = [ j_, is, touching, the, surface, of, k_, dot]
462
- expect { subject.to_pforest(literals) }.not_to raise_error
429
+ literals = [j_, is, touching, the, surface, of, k_, dot]
430
+ expect { parser.to_pforest(literals) }.not_to raise_error
463
431
 
464
432
  # Sentence 3-F xtra: Tony wants to know what is inside this container.
465
433
  # Tony tries to touch things inside the container.
466
- literals = [ tony, wants, to, know, what, is, inside, this, container, dot,
467
- tony, tries, to, touch, things, inside, the, container, dot
468
- ]
469
- expect { subject.to_pforest(literals) }.not_to raise_error
434
+ literals = [tony, wants, to, know, what, is, inside, this, container, dot,
435
+ tony, tries, to, touch, things, inside, the, container, dot]
436
+ expect { parser.to_pforest(literals) }.not_to raise_error
470
437
  end
471
438
 
472
- it 'should parse sample sentences from lesson 3-G' do
439
+ it 'parses sample sentences from lesson 3-G' do
473
440
  # Sentence 3-24a definiendum: 'You choose one of these things.'
474
441
  literals = [you, choose, one, of, these, things, dot]
475
- expect { subject.to_pforest(literals) }.not_to raise_error
442
+ expect { parser.to_pforest(literals) }.not_to raise_error
476
443
 
477
444
  # Sentence 3-24b definiendum: 'There are two or more things you can do.
478
445
  # If you do one of these, you cannot do another.
@@ -483,52 +450,49 @@ module Zenlish
483
450
  # [I chose this big one.]'
484
451
  literals = [there, are, two, or_, more, things, you, can, do_, dot,
485
452
  if_, you, do_, one, of, these_as_pronoun, comma,
486
- you, can, not_, do_, another_as_pronoun, dot,
453
+ you, can, not_, do_, another_as_pronoun, dot,
487
454
  you, think, about, these_as_pronoun, and_,
488
- what, you, want, to, do_, dot,
455
+ what, you, want, to, do_, dot,
489
456
  there, is, one, moment, when_, you, know, what, one, of, these_as_pronoun,
490
- you, want, more_as_adverb, comma, and_,
491
- after_adverb, this, moment, comma, you, try_, for_, some, time,
492
- to, do_, this, one_as_pronoun, dot,
493
- you, can, choose, to, have, one, of, these, things, dot,
494
- i_pronoun, chose, this, big, one_as_pronoun, dot
495
- ]
496
- expect { subject.to_pforest(literals) }.not_to raise_error
457
+ you, want, more_as_adverb, comma, and_,
458
+ after_adverb, this, moment, comma, you, try_, for_, some, time,
459
+ to, do_, this, one_as_pronoun, dot,
460
+ you, can, choose, to, have, one, of, these, things, dot,
461
+ i_pronoun, chose, this, big, one_as_pronoun, dot]
462
+ expect { parser.to_pforest(literals) }.not_to raise_error
497
463
 
498
464
  # Sentence 3-25a definiendum: 'X is in a place between J and K.'
499
465
  literals = [x_as_noun, is, in_, a_as_art, place, between, j_, and_, k_, dot]
500
- expect { subject.to_pforest(literals) }.not_to raise_error
466
+ expect { parser.to_pforest(literals) }.not_to raise_error
501
467
 
502
468
  # Sentence 3-25b definiens: X is in a place.
503
469
  # J is on one side of X, and K is on the other side of X.
504
470
  literals = [x_as_noun, is, in_, a_as_art, place, dot,
505
471
  j_, is, on, one, side, of, x_as_noun, comma, and_,
506
- k_, is, on, the, other, side, of, x_as_noun, dot
507
- ]
508
- expect { subject.to_pforest(literals) }.not_to raise_error
472
+ k_, is, on, the, other, side, of, x_as_noun, dot]
473
+ expect { parser.to_pforest(literals) }.not_to raise_error
509
474
 
510
475
  # Sentence 3-25c definiendum: 'X happens at a time between J and K.'
511
476
  literals = [x_as_noun, happens, at, a_as_art, time, between, j_, and_, k_, dot]
512
- expect { subject.to_pforest(literals) }.not_to raise_error
477
+ expect { parser.to_pforest(literals) }.not_to raise_error
513
478
 
514
479
  # Sentence 3-25d definiens: X happens after J and before K
515
480
  literals = [x_as_noun, happens, after_as_prep, j_, and_,
516
481
  before_as_prep, k_, dot]
517
- expect { subject.to_pforest(literals) }.not_to raise_error
482
+ expect { parser.to_pforest(literals) }.not_to raise_error
518
483
 
519
484
  # Sentence 3-25e definiendum: 'X is between J and K.'
520
485
  literals = [x_as_noun, is, between, j_, and_, k_, dot]
521
- expect { subject.to_pforest(literals) }.not_to raise_error
486
+ expect { parser.to_pforest(literals) }.not_to raise_error
522
487
 
523
488
  # Sentence 3-25f definiens: X is more than J but not more than K.
524
489
  literals = [x_as_noun, is, more, than, j_,
525
- but, not_, more, than, k_, dot
526
- ]
527
- expect { subject.to_pforest(literals) }.not_to raise_error
490
+ but, not_, more, than, k_, dot]
491
+ expect { parser.to_pforest(literals) }.not_to raise_error
528
492
 
529
493
  # Sentence 3-26a definiendum: 'X moved here from this other place.'
530
494
  literals = [x_as_noun, moved, here, from, this, other, place, dot]
531
- expect { subject.to_pforest(literals) }.not_to raise_error
495
+ expect { parser.to_pforest(literals) }.not_to raise_error
532
496
 
533
497
  # Sentence 3-26b definiens: 'X was in this other place before
534
498
  # it moved for some time. Because X moved, it is here after this,
@@ -536,13 +500,12 @@ module Zenlish
536
500
  literals = [x_as_noun, was, in_, this, other, place, before,
537
501
  it_, moved, for_, some, time, dot,
538
502
  because, x_as_noun, moved, comma, it_, is, here, after_,
539
- this_as_pronoun, comma, and_, it_, is, not_, in_, this, other, place, dot
540
- ]
541
- expect { subject.to_pforest(literals) }.not_to raise_error
503
+ this_as_pronoun, comma, and_, it_, is, not_, in_, this, other, place, dot]
504
+ expect { parser.to_pforest(literals) }.not_to raise_error
542
505
 
543
506
  # Sentence 3-27a definiendum: 'X is a machine.'
544
507
  literals = [x_as_noun, is, a_as_art, machine, dot]
545
- expect { subject.to_pforest(literals) }.not_to raise_error
508
+ expect { parser.to_pforest(literals) }.not_to raise_error
546
509
 
547
510
  # Sentence 3-27b definiens: 'X is something people make.
548
511
  # When people make some things like X, they use many parts to make these things.
@@ -552,54 +515,51 @@ module Zenlish
552
515
  # [I used a machine to cause these big things to move.].'
553
516
  literals = [x_as_noun, is, something, people, make, dot,
554
517
  when_, people, make, some, things, like, x_as_noun, comma,
555
- they, use, many, parts, to, make, these, things, dot,
518
+ they, use, many, parts, to, make, these, things, dot,
556
519
  some, parts, of, x_as_noun, move, dot,
557
520
  some, parts, can, cause, other, parts, to, move, dot,
558
521
  people, make, things, like, this_as_pronoun, because, these, things, do_,
559
- something, that, people, want, dot,
522
+ something, that, people, want, dot,
560
523
  these, things, can, do_, more_as_adverb, than, people, can, do_,
561
- and_, more_as_adverb, than, people, want, to, do_, dot,
524
+ and_, more_as_adverb, than, people, want, to, do_, dot,
562
525
  i_pronoun, used, a_as_art, machine, to, cause, these, big, things,
563
- to, move, dot
564
- ]
565
- expect { subject.to_pforest(literals) }.not_to raise_error
526
+ to, move, dot]
527
+ expect { parser.to_pforest(literals) }.not_to raise_error
566
528
 
567
529
  # Sentence 3-G xtra: Tony wants to make something using a machine.
568
530
  # Tony is between two different machines.
569
531
  # Tony says: "I can choose to use one of these machines."
570
- literals = [ tony, wants, to, make, something, using, a_as_art,
532
+ literals = [tony, wants, to, make, something, using, a_as_art,
571
533
  machine, dot,
572
534
  tony, is, between, two, different, machines, dot,
573
535
  tony, says, colon, quote, i_pronoun, can, choose, to, use,
574
- one, of, these, machines, dot, quote, dot
575
- ]
576
- expect { subject.to_pforest(literals) }.not_to raise_error
536
+ one, of, these, machines, dot, quote, dot]
537
+ expect { parser.to_pforest(literals) }.not_to raise_error
577
538
  end
578
-
579
- it 'should parse sample sentences from lesson 3-H' do
539
+
540
+ it 'parses sample sentences from lesson 3-H' do
580
541
  # Sentence 3-28a definiendum: 'J damaged K.'
581
542
  literals = [j_, damaged, k_, dot]
582
- expect { subject.to_pforest(literals) }.not_to raise_error
583
-
584
- # Sentence 3-28b definiens: 'J did something to K that was bad for K
585
- # and it changed K like this: Before this happened,
586
- # some parts of K were good more than now.
543
+ expect { parser.to_pforest(literals) }.not_to raise_error
544
+
545
+ # Sentence 3-28b definiens: 'J did something to K that was bad for K
546
+ # and it changed K like this: Before this happened,
547
+ # some parts of K were good more than now.
587
548
  # Before this happened, K could do some things more than it can now.
588
549
  # [You cannot move now because something damaged part of your body.]'
589
- literals = [j_, did, something, to, k_, that, was, bad, for_, k_,
590
- and_, it_, changed, k_, like, this_as_pronoun, colon,
591
- before, this_as_pronoun, happened, comma, some, parts, of, k_, were,
592
- good, more, than, now_as_noun, dot,
593
- before, this_as_pronoun, happened, comma, k_, could, do_, some,
594
- things, more, than, it_, can_irregular, now, dot,
595
- you, can, not_, move, now, because, something, damaged,
596
- part, of, your, body, dot
597
- ]
598
- expect { subject.to_pforest(literals) }.not_to raise_error
550
+ literals = [j_, did, something, to, k_, that, was, bad, for_, k_,
551
+ and_, it_, changed, k_, like, this_as_pronoun, colon,
552
+ before, this_as_pronoun, happened, comma, some, parts, of, k_, were,
553
+ good, more, than, now_as_noun, dot,
554
+ before, this_as_pronoun, happened, comma, k_, could, do_, some,
555
+ things, more, than, it_, can_irregular, now, dot,
556
+ you, can, not_, move, now, because, something, damaged,
557
+ part, of, your, body, dot]
558
+ expect { parser.to_pforest(literals) }.not_to raise_error
599
559
 
600
560
  # Sentence 3-29a definiendum: 'Doing X is difficult.'
601
561
  # literals = [doing, x_as_noun, is, difficult, dot]
602
- # expect { subject.to_pforest(literals) }.not_to raise_error
562
+ # expect { parser.to_pforest(literals) }.not_to raise_error
603
563
  end
604
564
  =begin
605
565
  3-29. difficult.