zenlish 0.2.05 → 0.2.06

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +455 -0
  3. data/CHANGELOG.md +11 -0
  4. data/Gemfile +5 -3
  5. data/Rakefile +5 -3
  6. data/lib/zenlish/feature/boolean_domain.rb +6 -4
  7. data/lib/zenlish/feature/boolean_value.rb +3 -2
  8. data/lib/zenlish/feature/enumeration_domain.rb +5 -2
  9. data/lib/zenlish/feature/feature.rb +9 -7
  10. data/lib/zenlish/feature/feature_def.rb +9 -6
  11. data/lib/zenlish/feature/feature_domain.rb +4 -2
  12. data/lib/zenlish/feature/feature_struct.rb +3 -1
  13. data/lib/zenlish/feature/feature_struct_def.rb +5 -1
  14. data/lib/zenlish/feature/feature_struct_def_bearer.rb +6 -4
  15. data/lib/zenlish/feature/feature_value.rb +4 -2
  16. data/lib/zenlish/feature/identifier_domain.rb +5 -3
  17. data/lib/zenlish/feature/identifier_value.rb +3 -2
  18. data/lib/zenlish/feature/symbol_value.rb +3 -1
  19. data/lib/zenlish/inflect/atomic_o_expression.rb +2 -1
  20. data/lib/zenlish/inflect/composite_o_expression.rb +3 -1
  21. data/lib/zenlish/inflect/concatenation.rb +3 -2
  22. data/lib/zenlish/inflect/equals_literal.rb +3 -1
  23. data/lib/zenlish/inflect/feature_heading.rb +2 -5
  24. data/lib/zenlish/inflect/formal_argument.rb +3 -1
  25. data/lib/zenlish/inflect/function_call.rb +4 -1
  26. data/lib/zenlish/inflect/heading.rb +2 -0
  27. data/lib/zenlish/inflect/inflection_rule.rb +2 -0
  28. data/lib/zenlish/inflect/inflection_table.rb +6 -4
  29. data/lib/zenlish/inflect/inflection_table_builder.rb +21 -18
  30. data/lib/zenlish/inflect/input_asis.rb +3 -0
  31. data/lib/zenlish/inflect/input_expression.rb +4 -2
  32. data/lib/zenlish/inflect/literal_asis.rb +4 -1
  33. data/lib/zenlish/inflect/matches_pattern.rb +2 -0
  34. data/lib/zenlish/inflect/membership.rb +2 -0
  35. data/lib/zenlish/inflect/method_heading.rb +3 -6
  36. data/lib/zenlish/inflect/not_equals_literal.rb +2 -0
  37. data/lib/zenlish/inflect/nullary_input_expression.rb +3 -1
  38. data/lib/zenlish/inflect/output_expression.rb +2 -0
  39. data/lib/zenlish/inflect/substitution.rb +3 -1
  40. data/lib/zenlish/inflect/unary_input_expression.rb +4 -1
  41. data/lib/zenlish/inflect/unconditionally_true.rb +4 -2
  42. data/lib/zenlish/lang/dictionary.rb +19 -16
  43. data/lib/zenlish/lang/lemmatizer.rb +40 -0
  44. data/lib/zenlish/lang/zenlish_grammar.rb +6 -4
  45. data/lib/zenlish/lex/empty_lexicon_factory.rb +3 -2
  46. data/lib/zenlish/lex/lexeme.rb +6 -4
  47. data/lib/zenlish/lex/lexical_entry.rb +6 -4
  48. data/lib/zenlish/lex/lexicon.rb +4 -3
  49. data/lib/zenlish/lex/literal.rb +3 -1
  50. data/lib/zenlish/lexer/lexer.rb +144 -0
  51. data/lib/zenlish/trie/base_trie_node.rb +27 -0
  52. data/lib/zenlish/trie/trie.rb +132 -0
  53. data/lib/zenlish/trie/trie_node.rb +21 -0
  54. data/lib/zenlish/trie/trie_root.rb +10 -0
  55. data/lib/zenlish/version.rb +3 -1
  56. data/lib/zenlish/wclasses/adjective.rb +4 -2
  57. data/lib/zenlish/wclasses/adverb.rb +3 -1
  58. data/lib/zenlish/wclasses/adverb_maybe.rb +3 -1
  59. data/lib/zenlish/wclasses/adverb_not.rb +2 -0
  60. data/lib/zenlish/wclasses/all_word_classes.rb +3 -1
  61. data/lib/zenlish/wclasses/article.rb +2 -0
  62. data/lib/zenlish/wclasses/auxiliary.rb +2 -0
  63. data/lib/zenlish/wclasses/auxiliary_be.rb +7 -6
  64. data/lib/zenlish/wclasses/auxiliary_do.rb +6 -5
  65. data/lib/zenlish/wclasses/cardinal.rb +3 -1
  66. data/lib/zenlish/wclasses/common_noun.rb +2 -0
  67. data/lib/zenlish/wclasses/comparative_particle.rb +5 -3
  68. data/lib/zenlish/wclasses/conjunction.rb +2 -0
  69. data/lib/zenlish/wclasses/conjunctive_pronoun.rb +2 -0
  70. data/lib/zenlish/wclasses/coordinator.rb +4 -2
  71. data/lib/zenlish/wclasses/definite_article.rb +2 -0
  72. data/lib/zenlish/wclasses/degree_adverb.rb +2 -0
  73. data/lib/zenlish/wclasses/demonstrative_determiner.rb +6 -4
  74. data/lib/zenlish/wclasses/demonstrative_pronoun.rb +2 -0
  75. data/lib/zenlish/wclasses/determiner.rb +3 -1
  76. data/lib/zenlish/wclasses/distributive_determiner.rb +2 -0
  77. data/lib/zenlish/wclasses/existential_there.rb +2 -0
  78. data/lib/zenlish/wclasses/fronting_quantifier.rb +3 -1
  79. data/lib/zenlish/wclasses/indefinite_article.rb +2 -0
  80. data/lib/zenlish/wclasses/indefinite_pronoun.rb +3 -1
  81. data/lib/zenlish/wclasses/irregular_linking_verb.rb +3 -1
  82. data/lib/zenlish/wclasses/irregular_verb.rb +13 -15
  83. data/lib/zenlish/wclasses/irregular_verb_be.rb +8 -7
  84. data/lib/zenlish/wclasses/irregular_verb_can.rb +8 -7
  85. data/lib/zenlish/wclasses/irregular_verb_do.rb +7 -6
  86. data/lib/zenlish/wclasses/irregular_verb_extension.rb +8 -6
  87. data/lib/zenlish/wclasses/irregular_verb_have.rb +12 -11
  88. data/lib/zenlish/wclasses/irregular_verb_know.rb +3 -1
  89. data/lib/zenlish/wclasses/irregular_verb_say.rb +3 -1
  90. data/lib/zenlish/wclasses/irregular_verb_think.rb +3 -1
  91. data/lib/zenlish/wclasses/lexical_verb.rb +3 -4
  92. data/lib/zenlish/wclasses/linking_adverb.rb +2 -0
  93. data/lib/zenlish/wclasses/modal_verb_can.rb +7 -5
  94. data/lib/zenlish/wclasses/noun.rb +4 -2
  95. data/lib/zenlish/wclasses/numeral.rb +2 -0
  96. data/lib/zenlish/wclasses/personal_pronoun.rb +8 -6
  97. data/lib/zenlish/wclasses/possessive_determiner.rb +13 -12
  98. data/lib/zenlish/wclasses/preposition.rb +3 -1
  99. data/lib/zenlish/wclasses/preposition_of.rb +2 -0
  100. data/lib/zenlish/wclasses/preposition_than.rb +2 -0
  101. data/lib/zenlish/wclasses/pronoun.rb +3 -1
  102. data/lib/zenlish/wclasses/proper_noun.rb +10 -8
  103. data/lib/zenlish/wclasses/quantifier.rb +3 -1
  104. data/lib/zenlish/wclasses/regular_verb.rb +9 -9
  105. data/lib/zenlish/wclasses/regular_verb_want.rb +4 -2
  106. data/lib/zenlish/wclasses/relative_pronoun.rb +4 -2
  107. data/lib/zenlish/wclasses/subordinating_conjunction.rb +7 -5
  108. data/lib/zenlish/wclasses/verb.rb +5 -3
  109. data/lib/zenlish/wclasses/word_class.rb +7 -5
  110. data/spec/spec_helper.rb +3 -1
  111. data/spec/zenlish/feature/boolean_domain_spec.rb +2 -2
  112. data/spec/zenlish/feature/boolean_value_spec.rb +1 -1
  113. data/spec/zenlish/feature/enumeration_domain_spec.rb +7 -7
  114. data/spec/zenlish/feature/feature_spec.rb +3 -3
  115. data/spec/zenlish/feature/feature_struct_def_bearer_spec.rb +10 -8
  116. data/spec/zenlish/feature/feature_struct_def_spec.rb +3 -2
  117. data/spec/zenlish/feature/identifier_domain_spec.rb +3 -3
  118. data/spec/zenlish/feature/identifier_value_spec.rb +4 -4
  119. data/spec/zenlish/feature/symbol_value_spec.rb +3 -3
  120. data/spec/zenlish/inflect/concatenation_spec.rb +7 -7
  121. data/spec/zenlish/inflect/feature_heading_spec.rb +9 -9
  122. data/spec/zenlish/inflect/formal_argument_spec.rb +2 -2
  123. data/spec/zenlish/inflect/function_call_spec.rb +4 -4
  124. data/spec/zenlish/inflect/inflection_rule_spec.rb +9 -5
  125. data/spec/zenlish/inflect/inflection_table_builder_spec.rb +26 -21
  126. data/spec/zenlish/inflect/inflection_table_spec.rb +18 -16
  127. data/spec/zenlish/inflect/input_asis_spec.rb +2 -6
  128. data/spec/zenlish/inflect/literal_asis_spec.rb +3 -3
  129. data/spec/zenlish/inflect/matches_pattern_spec.rb +1 -1
  130. data/spec/zenlish/inflect/membership_spec.rb +2 -2
  131. data/spec/zenlish/inflect/method_heading_spec.rb +3 -3
  132. data/spec/zenlish/inflect/substitution_spec.rb +1 -1
  133. data/spec/zenlish/inflect/unconditionally_true_spec.rb +2 -2
  134. data/spec/zenlish/lang/dictionary_spec.rb +11 -12
  135. data/spec/zenlish/lang/lemmatizer_spec.rb +43 -0
  136. data/spec/zenlish/lang/zenlish_grammar_spec.rb +2 -2
  137. data/spec/zenlish/lex/lexeme_spec.rb +11 -12
  138. data/spec/zenlish/lex/lexical_entry_spec.rb +1 -2
  139. data/spec/zenlish/lex/lexicon_spec.rb +9 -8
  140. data/spec/zenlish/lex/literal_spec.rb +2 -2
  141. data/spec/zenlish/lexer/lexer_spec.rb +52 -0
  142. data/spec/zenlish/parser/lesson1_spec.rb +2 -2
  143. data/spec/zenlish/parser/lesson2_spec.rb +31 -36
  144. data/spec/zenlish/parser/lesson3_spec.rb +98 -138
  145. data/spec/zenlish/parser/zparser_spec.rb +2 -1
  146. data/spec/zenlish/support/minimal_lexicon.rb +2 -0
  147. data/spec/zenlish/support/var2word.rb +18 -9
  148. data/spec/zenlish/trie/base_trie_node_spec.rb +33 -0
  149. data/spec/zenlish/trie/trie_spec.rb +108 -0
  150. data/spec/zenlish/wclasses/common_noun_spec.rb +6 -10
  151. data/spec/zenlish/wclasses/demonstrative_determiner_spec.rb +2 -2
  152. data/spec/zenlish/wclasses/irregular_verb_can_spec.rb +9 -9
  153. data/spec/zenlish/wclasses/irregular_verb_spec.rb +9 -9
  154. data/spec/zenlish/wclasses/lexical_verb_spec.rb +3 -3
  155. data/spec/zenlish/wclasses/modal_verb_can_spec.rb +4 -4
  156. data/spec/zenlish/wclasses/personal_pronoun_spec.rb +6 -9
  157. data/spec/zenlish/wclasses/possessive_determiner_spec.rb +19 -22
  158. data/spec/zenlish/wclasses/regular_verb_spec.rb +20 -20
  159. data/spec/zenlish/wclasses/regular_verb_want_spec.rb +30 -0
  160. data/spec/zenlish_spec.rb +3 -1
  161. data/zenlish.gemspec +17 -14
  162. metadata +26 -9
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base_trie_node'
4
+
5
+ module Zenlish
6
+ module Trie
7
+ class TrieNode < BaseTrieNode
8
+ # @return [String] the matching character
9
+ attr_reader :key
10
+
11
+ # @return [Object, NilClass] Result when this character matches end-of-word.
12
+ attr_accessor :value
13
+
14
+ def initialize(aChar)
15
+ super()
16
+ @key = aChar
17
+ @value = nil
18
+ end
19
+ end # class
20
+ end # module
21
+ end # module
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base_trie_node'
4
+
5
+ module Zenlish
6
+ module Trie
7
+ class TrieRoot < BaseTrieNode
8
+ end # class
9
+ end # module
10
+ end # module
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Zenlish
2
- VERSION = '0.2.05'.freeze
4
+ VERSION = '0.2.06'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'word_class'
2
4
 
3
5
  module Zenlish
@@ -7,8 +9,8 @@ module Zenlish
7
9
  # @return [FalseClass] Indicates that an adjective may inflect.
8
10
  def invariable?
9
11
  # TODO: set to false once we introduce the degrees (basic, comparative, superlative)
10
- true
11
- end
12
+ true
13
+ end
12
14
  end # class
13
15
  end # module
14
16
  end # module
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'word_class'
2
4
 
3
5
  module Zenlish
4
6
  module WClasses
5
7
  # TODO: document
6
- class Adverb < WordClass
8
+ class Adverb < WordClass
7
9
  end # class
8
10
  end # module
9
11
  end # module
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'adverb'
2
4
 
3
5
  module Zenlish
4
6
  module WClasses
5
- # The adverb maybe expresses uncertainty and is often placed in front
7
+ # The adverb maybe expresses uncertainty and is often placed in front
6
8
  # of clauses.
7
9
  class AdverbMaybe < Adverb
8
10
  end # class
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'adverb'
2
4
 
3
5
  module Zenlish
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Load the WordClass class hierarchy
2
4
  # Algorithm: load the leaf classes from hierarchy
3
5
 
@@ -43,4 +45,4 @@ require_relative 'fronting_quantifier'
43
45
  require_relative 'regular_verb'
44
46
  require_relative 'regular_verb_want'
45
47
  require_relative 'relative_pronoun'
46
- require_relative 'subordinating_conjunction'
48
+ require_relative 'subordinating_conjunction'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'determiner'
2
4
 
3
5
  module Zenlish
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'verb'
2
4
 
3
5
  module Zenlish
@@ -1,20 +1,20 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'auxiliary'
2
4
 
3
5
  module Zenlish
4
6
  module WClasses
5
7
  class AuxiliaryBe < Auxiliary
6
- def initialize
7
- super()
8
- end
8
+ # rubocop: disable Layout/SpaceInsideArrayLiteralBrackets
9
9
 
10
10
  private
11
11
 
12
12
  def init_feature_defs
13
13
  super
14
14
  # Create standard feature definitions for modal verb can.
15
- feature_def_dsl {
15
+ feature_def_dsl do
16
16
  feature_def 'PARADIGM' => [identifier, 'Verb_be_inflection'] # 2nd item is default value
17
- }
17
+ end
18
18
  end
19
19
 
20
20
  def init_paradigms
@@ -35,7 +35,8 @@ module Zenlish
35
35
  rule([dont_care, dont_care, equals(:past_participle)], literal('been'))
36
36
  end
37
37
  add_paradigm(table)
38
- end
38
+ end
39
+ # rubocop: enable Layout/SpaceInsideArrayLiteralBrackets
39
40
  end # class
40
41
  end # module
41
42
  end # module
@@ -1,21 +1,21 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'auxiliary'
2
4
 
3
5
  module Zenlish
4
6
  module WClasses
5
7
  # TODO: document
6
8
  class AuxiliaryDo < Auxiliary
7
- def initialize
8
- super()
9
- end
9
+ # rubocop: disable Layout/SpaceInsideArrayLiteralBrackets
10
10
 
11
11
  private
12
12
 
13
13
  def init_feature_defs
14
14
  super
15
15
  # Create standard feature definitions for modal verb can.
16
- feature_def_dsl {
16
+ feature_def_dsl do
17
17
  feature_def 'PARADIGM' => [identifier, 'Verb_do_inflection'] # 2nd item is default value
18
- }
18
+ end
19
19
  end
20
20
 
21
21
  def init_paradigms
@@ -34,6 +34,7 @@ module Zenlish
34
34
  end
35
35
  add_paradigm(table)
36
36
  end
37
+ # rubocop: enable Layout/SpaceInsideArrayLiteralBrackets
37
38
  end # class
38
39
  end # module
39
40
  end # module
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'numeral'
2
4
 
3
5
  module Zenlish
@@ -6,4 +8,4 @@ module Zenlish
6
8
  class Cardinal < Numeral
7
9
  end # class
8
10
  end # module
9
- end # module
11
+ end # module
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'noun'
2
4
  require_relative '../inflect/inflection_table_builder'
3
5
 
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'word_class'
2
4
 
3
5
  module Zenlish
4
6
  module WClasses
5
- # TODO: document
7
+ # TODO: document
6
8
  # Example: 'as' in 'same ... as'
7
- class ComparativeParticle < WordClass
9
+ class ComparativeParticle < WordClass
8
10
  end # class
9
11
  end # module
10
- end # module
12
+ end # module
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'word_class'
2
4
 
3
5
  module Zenlish
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'pronoun'
2
4
 
3
5
  module Zenlish
@@ -1,12 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'conjunction'
2
4
 
3
5
  module Zenlish
4
6
  module WClasses
5
- # A coordinator (aka coordinating conjunction) is a word or phrase that
7
+ # A coordinator (aka coordinating conjunction) is a word or phrase that
6
8
  # can join words, phrases, and clauses that share some logical relationhip
7
9
  # Common coordinators are enumerated in the FANBOYS acronym:
8
10
  # For, And, Nor, But, Or, Yet and So.
9
- class Coordinator < WordClass
11
+ class Coordinator < WordClass
10
12
  end # class
11
13
  end # module
12
14
  end # module
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'article'
2
4
 
3
5
  module Zenlish
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'adverb'
2
4
 
3
5
  module Zenlish
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'determiner'
2
4
  require_relative '../inflect/inflection_table_builder'
3
5
 
@@ -10,7 +12,7 @@ module Zenlish
10
12
  super()
11
13
  init_feature_defs
12
14
  init_paradigms
13
- end
15
+ end
14
16
 
15
17
  # @return [FalseClass] Indicates that demonstrative determiners inflects.
16
18
  def invariable?
@@ -21,11 +23,11 @@ module Zenlish
21
23
 
22
24
  def init_feature_defs
23
25
  # Create standard feature definitions for irregular verbs.
24
- feature_def_dsl {
26
+ feature_def_dsl do
25
27
  feature_def 'NUMBER' => enumeration(:singular, :plural)
26
28
  feature_def 'DISTANCE' => enumeration(:near, :far)
27
29
  feature_def 'PARADIGM' => [identifier, 'Demonstrative_det_paradigm'] # 2nd item is default value
28
- }
30
+ end
29
31
  end
30
32
 
31
33
  def init_paradigms
@@ -37,7 +39,7 @@ module Zenlish
37
39
  rule([equals(:singular), equals(:near)], func('base_form'))
38
40
  rule([equals(:singular), equals(:far)], literal('that'))
39
41
  rule([equals(:plural), equals(:near)], literal('these'))
40
- rule([equals(:plural), equals(:far), ], literal('those'))
42
+ rule([equals(:plural), equals(:far)], literal('those'))
41
43
  end
42
44
  add_paradigm(table)
43
45
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'pronoun'
2
4
 
3
5
  module Zenlish
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'word_class'
2
4
 
3
5
  module Zenlish
4
6
  module WClasses
5
7
  # TODO: document
6
- class Determiner < WordClass
8
+ class Determiner < WordClass
7
9
  end # class
8
10
  end # module
9
11
  end # module
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'determiner'
2
4
 
3
5
  module Zenlish
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'pronoun'
2
4
 
3
5
  module Zenlish
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'quantifier'
2
4
 
3
5
  module Zenlish
4
6
  module WClasses
5
7
  # Quantifiers that appear in front of determiners: all, both
6
- class FrontingQuantifier < Quantifier
8
+ class FrontingQuantifier < Quantifier
7
9
  end # class
8
10
  end # module
9
11
  end # module
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'article'
2
4
 
3
5
  module Zenlish
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'pronoun'
2
4
 
3
5
  module Zenlish
@@ -6,4 +8,4 @@ module Zenlish
6
8
  class IndefinitePronoun < Pronoun
7
9
  end # class
8
10
  end # module
9
- end # module
11
+ end # module
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'irregular_verb'
2
4
 
3
5
  module Zenlish
@@ -7,4 +9,4 @@ module Zenlish
7
9
  class IrregularLinkingVerb < IrregularVerb
8
10
  end # class
9
11
  end # module
10
- end # module
12
+ end # module
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'lexical_verb'
2
4
  require_relative 'irregular_verb_extension'
3
5
 
@@ -7,24 +9,20 @@ module Zenlish
7
9
  # @return [Array<String>] [the past simple form, past participle form].
8
10
  attr_writer :forms
9
11
 
10
- def initialize
11
- super()
12
- end
13
-
14
12
  # The mix-in module used to extend the lexeme
15
13
  # @return [Module, NilClass]
16
14
  def extension
17
15
  IrregularVerbExtension
18
- end
16
+ end
19
17
 
20
18
  private
21
-
19
+
22
20
  def init_feature_defs
23
21
  super
24
22
  # Create standard feature definitions for irregular verbs.
25
- feature_def_dsl {
23
+ feature_def_dsl do
26
24
  feature_def 'PARADIGM' => [identifier, 'Irregular_inflection'] # 2nd item is default value
27
- }
25
+ end
28
26
  end
29
27
 
30
28
  def init_paradigms
@@ -37,17 +35,17 @@ module Zenlish
37
35
  # PERSON NUMBER TIME base_form
38
36
  rule([not_equal(:third), equals(:singular), equals(:present), dont_care], col('base_form'))
39
37
  rule([equals(:third), equals(:singular), equals(:present), matches(/[^aeiouy]y$/)], sub(col('base_form'), /y$/, 'ies'))
40
- rule([equals(:third), equals(:singular), equals(:present), matches(/(?:[osxz]|ch|sh)$/)], concat(col('base_form'), 'es'))
38
+ rule([equals(:third), equals(:singular), equals(:present), matches(/(?:[osxz]|ch|sh)$/)], concat(col('base_form'), 'es'))
41
39
  rule([equals(:third), equals(:singular), equals(:present), dont_care], concat(col('base_form'), 's'))
42
- rule([dont_care, equals(:plural), equals(:present), dont_care], col('base_form'))
43
- rule([dont_care, dont_care, equals(:progressive), matches(/ie$/)], sub(col('base_form'), /ie$/, 'ying'))
44
- rule([dont_care, dont_care, equals(:progressive), matches(/[^eoy]e$/)], sub(col('base_form'), /e$/, 'ing'))
40
+ rule([dont_care, equals(:plural), equals(:present), dont_care], col('base_form'))
41
+ rule([dont_care, dont_care, equals(:progressive), matches(/ie$/)], sub(col('base_form'), /ie$/, 'ying'))
42
+ rule([dont_care, dont_care, equals(:progressive), matches(/[^eoy]e$/)], sub(col('base_form'), /e$/, 'ing'))
45
43
  rule([dont_care, dont_care, equals(:progressive), dont_care], concat(col('base_form'), 'ing'))
46
- rule([dont_care, dont_care, equals(:past_simple), dont_care], func('past_simple'))
44
+ rule([dont_care, dont_care, equals(:past_simple), dont_care], func('past_simple'))
47
45
  rule([dont_care, dont_care, equals(:past_participle), dont_care], func('past_participle'))
48
46
  end
49
47
  add_paradigm(table)
50
- end
48
+ end
51
49
  end # class
52
50
  end # module
53
- end # module
51
+ end # module