onvkv_seteyoposecetv 0.1.1
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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +13 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +12 -0
- data/lib/conjugators/action_verbs/future_tense.rb +191 -0
- data/lib/conjugators/action_verbs/imperative_mood.rb +153 -0
- data/lib/conjugators/action_verbs/past_one.rb +260 -0
- data/lib/conjugators/action_verbs/past_three.rb +294 -0
- data/lib/conjugators/action_verbs/past_two.rb +295 -0
- data/lib/conjugators/action_verbs/present_tense.rb +353 -0
- data/lib/conjugators/action_verbs/shared.rb +97 -0
- data/lib/conjugators/action_verbs.rb +12 -0
- data/lib/conjugators/ometv/past_three.rb +36 -0
- data/lib/conjugators/ometv/past_two.rb +36 -0
- data/lib/conjugators/ometv/present_tense.rb +36 -0
- data/lib/conjugators/ometv.rb +8 -0
- data/lib/conjugators/stative_verbs/past_one.rb +16 -0
- data/lib/conjugators/stative_verbs/present_tense.rb +212 -0
- data/lib/conjugators/stative_verbs.rb +7 -0
- data/lib/conjugators.rb +6 -0
- data/lib/onvkv_seteyoposecetv/version.rb +5 -0
- data/lib/onvkv_seteyoposecetv.rb +9 -0
- data/sig/onvkv_seteyoposecetv.rbs +4 -0
- metadata +72 -0
@@ -0,0 +1,295 @@
|
|
1
|
+
module Conjugators
|
2
|
+
module ActionVerbs
|
3
|
+
class PastTwo
|
4
|
+
extend Conjugators::ActionVerbs::Shared
|
5
|
+
# Note, MVSKOKE language here
|
6
|
+
def initialize(verb)
|
7
|
+
@verb = verb
|
8
|
+
|
9
|
+
raise "Invalid verb. Verb must end with 'etv'." unless @verb.end_with?("etv")
|
10
|
+
|
11
|
+
@irregular = !!irregulars[@verb]
|
12
|
+
end
|
13
|
+
|
14
|
+
def conjugate!
|
15
|
+
{
|
16
|
+
verb: @verb,
|
17
|
+
first_person_singular: {
|
18
|
+
basic: conjugate(tense: :conjugate_1ps, type: :basic),
|
19
|
+
tos_auxiliary: conjugate(tense: :conjugate_1ps, type: :tos_auxiliary),
|
20
|
+
ometv_conjugated_auxiliary: conjugate(tense: :conjugate_1ps, type: :ometv_conjugated_auxiliary)
|
21
|
+
},
|
22
|
+
second_person_singular: {
|
23
|
+
basic: conjugate(tense: :conjugate_2ps, type: :basic),
|
24
|
+
tos_auxiliary: conjugate(tense: :conjugate_2ps, type: :tos_auxiliary),
|
25
|
+
ometv_conjugated_auxiliary: conjugate(tense: :conjugate_2ps, type: :ometv_conjugated_auxiliary)
|
26
|
+
},
|
27
|
+
third_person_singular: {
|
28
|
+
basic: conjugate(tense: :conjugate_3ps, type: :basic),
|
29
|
+
tos_auxiliary: conjugate(tense: :conjugate_3ps, type: :tos_auxiliary),
|
30
|
+
ometv_conjugated_auxiliary: conjugate(tense: :conjugate_3ps, type: :ometv_conjugated_auxiliary)
|
31
|
+
},
|
32
|
+
first_person_plural: {
|
33
|
+
basic: conjugate(tense: :conjugate_1pp, type: :basic),
|
34
|
+
tos_auxiliary: conjugate(tense: :conjugate_1pp, type: :tos_auxiliary),
|
35
|
+
ometv_conjugated_auxiliary: conjugate(tense: :conjugate_1pp, type: :ometv_conjugated_auxiliary)
|
36
|
+
},
|
37
|
+
second_person_plural: {
|
38
|
+
basic: conjugate(tense: :conjugate_2pp, type: :basic),
|
39
|
+
tos_auxiliary: conjugate(tense: :conjugate_2pp, type: :tos_auxiliary),
|
40
|
+
ometv_conjugated_auxiliary: conjugate(tense: :conjugate_2pp, type: :ometv_conjugated_auxiliary)
|
41
|
+
},
|
42
|
+
third_person_plural: {
|
43
|
+
basic: conjugate(tense: :conjugate_3pp, type: :basic),
|
44
|
+
tos_auxiliary: conjugate(tense: :conjugate_3pp, type: :tos_auxiliary),
|
45
|
+
ometv_conjugated_auxiliary: conjugate(tense: :conjugate_3pp, type: :ometv_conjugated_auxiliary)
|
46
|
+
}
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
def conjugate(type:, tense:)
|
52
|
+
@type = type
|
53
|
+
case type
|
54
|
+
when :basic
|
55
|
+
result = send(tense)
|
56
|
+
if result[0].is_a?(String)
|
57
|
+
[result.map {|r| r + ?s }]
|
58
|
+
else
|
59
|
+
if @irregular
|
60
|
+
case result.size
|
61
|
+
when 1
|
62
|
+
rr_2plus = result[0].map {|r| "#{r}s (of 2+)"}
|
63
|
+
[rr_2plus]
|
64
|
+
when 2
|
65
|
+
rr2 = result[0].map {|r| "#{r}s (of 2)" }
|
66
|
+
rr3_plus = result[1].map {|r| "#{r}s (of 3+)"}
|
67
|
+
[rr2, rr3_plus]
|
68
|
+
end
|
69
|
+
else
|
70
|
+
result.map do |verb_form|
|
71
|
+
verb_form.map do |dialectic_option|
|
72
|
+
"#{dialectic_option}s"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
when :tos_auxiliary
|
78
|
+
return "N/A" if @verb == "ometv" || @verb == "owetv"
|
79
|
+
result = send(tense)
|
80
|
+
if result[0].is_a?(String)
|
81
|
+
[result.map {|r| r + " towvnks" }]
|
82
|
+
else
|
83
|
+
if @irregular
|
84
|
+
case result.size
|
85
|
+
when 1
|
86
|
+
rr_2plus = result[0].map {|r| "#{r} towvnks (of 2+)" }
|
87
|
+
[rr_2plus]
|
88
|
+
when 2
|
89
|
+
rr2 = result[0].map {|r| "#{r} towvnks (of 2)" }
|
90
|
+
rr3_plus = result[1].map {|r| "#{r} towvnks (of 3+)"}
|
91
|
+
[rr2, rr3_plus]
|
92
|
+
end
|
93
|
+
else
|
94
|
+
result.map do |verb_form|
|
95
|
+
verb_form.map do |dialectic_option|
|
96
|
+
"#{dialectic_option} towvnks"
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
when :ometv_conjugated_auxiliary
|
102
|
+
return "N/A" if @verb == "ometv" || @verb == "owetv"
|
103
|
+
result = ometv(tense.to_s.split(?_).last)
|
104
|
+
|
105
|
+
# Do we need towakes? Right now believing so (even if the verb is plural already???)
|
106
|
+
#result.map! {|r| r.gsub("towakes", "tos") } if @irregular
|
107
|
+
|
108
|
+
verbs_to_conjugate = if self.class.irregulars[@verb] && tense =~ /p\z/
|
109
|
+
self.class.irregulars[@verb].values_at(2,3).compact
|
110
|
+
else
|
111
|
+
@verb
|
112
|
+
end
|
113
|
+
results = if verbs_to_conjugate.is_a?(String)
|
114
|
+
[result.map {|r| verbs_to_conjugate.gsub(/etv\z/, 'e ') + r }]
|
115
|
+
else
|
116
|
+
verbs_to_conjugate.map do |verb_to_conjugate|
|
117
|
+
result.map {|r| verb_to_conjugate.gsub(/etv\z/, 'e ') + r }
|
118
|
+
end
|
119
|
+
end
|
120
|
+
if verbs_to_conjugate == @verb
|
121
|
+
return results
|
122
|
+
end
|
123
|
+
if tense =~ /s\z/
|
124
|
+
results
|
125
|
+
else
|
126
|
+
case results.size
|
127
|
+
when 1
|
128
|
+
rr_2plus = results[0].map {|r| "#{r} (of 2+)"}
|
129
|
+
[rr_2plus]
|
130
|
+
when 2
|
131
|
+
rr2 = results[0].map {|r| "#{r} (of 2)" }
|
132
|
+
rr3_plus = results[1].map {|r| "#{r} (of 3+)"}
|
133
|
+
[rr2, rr3_plus]
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
def conjugating_each_dialectic_option(dialectic_person_marker_options)
|
140
|
+
dialectic_person_marker_options.map do |person_marker|
|
141
|
+
yield(person_marker)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
def conjugate_1ps
|
146
|
+
conjugating_each_dialectic_option(person_markers['1ps']) do |person_marker|
|
147
|
+
@verb_to_conjugate = @verb.dup
|
148
|
+
drop_the_etv!
|
149
|
+
add_person_marker!(person_marker)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
def conjugate_2ps
|
154
|
+
conjugating_each_dialectic_option(person_markers['2ps']) do |person_marker|
|
155
|
+
@verb_to_conjugate = @verb.dup
|
156
|
+
drop_the_etv!
|
157
|
+
add_person_marker!(person_marker)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
def conjugate_3ps
|
162
|
+
conjugating_each_dialectic_option(person_markers['3ps']) do |person_marker|
|
163
|
+
@verb_to_conjugate = @verb.dup
|
164
|
+
drop_the_etv!
|
165
|
+
add_person_marker!(person_marker)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
def conjugate_1pp
|
170
|
+
results = []
|
171
|
+
if plural_forms = self.class.irregulars[@verb]&.values_at(2,3)&.compact
|
172
|
+
plural_forms.each do |verb|
|
173
|
+
results << conjugating_each_dialectic_option(person_markers['1pp']) do |person_marker|
|
174
|
+
@verb_to_conjugate = verb.dup
|
175
|
+
drop_the_etv!
|
176
|
+
|
177
|
+
if @type == :tos_auxiliary
|
178
|
+
@verb_to_conjugate + 'eyē'
|
179
|
+
else
|
180
|
+
add_person_marker!(person_marker)
|
181
|
+
end
|
182
|
+
|
183
|
+
end
|
184
|
+
end
|
185
|
+
else
|
186
|
+
results << conjugating_each_dialectic_option(person_markers['1pp']) do |person_marker|
|
187
|
+
@verb_to_conjugate = @verb.dup
|
188
|
+
drop_the_etv!
|
189
|
+
if @type == :tos_auxiliary
|
190
|
+
@verb_to_conjugate + 'eyē'
|
191
|
+
else
|
192
|
+
add_person_marker!(person_marker)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
results
|
198
|
+
end
|
199
|
+
|
200
|
+
def conjugate_2pp
|
201
|
+
results = []
|
202
|
+
if plural_forms = self.class.irregulars[@verb]&.values_at(2,3)&.compact
|
203
|
+
plural_forms.each do |verb|
|
204
|
+
results << conjugating_each_dialectic_option(person_markers['2pp']) do |person_marker|
|
205
|
+
@verb_to_conjugate = verb.dup
|
206
|
+
drop_the_etv!
|
207
|
+
add_person_marker!(person_marker)
|
208
|
+
end
|
209
|
+
end
|
210
|
+
else
|
211
|
+
results << conjugating_each_dialectic_option(person_markers['2pp']) do |person_marker|
|
212
|
+
@verb_to_conjugate = @verb.dup
|
213
|
+
drop_the_etv!
|
214
|
+
add_person_marker!(person_marker)
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
results
|
219
|
+
end
|
220
|
+
|
221
|
+
def conjugate_3pp
|
222
|
+
results = []
|
223
|
+
if plural_forms = self.class.irregulars[@verb]&.values_at(2,3)&.compact
|
224
|
+
plural_forms.each do |verb|
|
225
|
+
results << conjugating_each_dialectic_option(person_markers['3pp']) do |person_marker|
|
226
|
+
@verb_to_conjugate = verb.dup
|
227
|
+
drop_the_etv!
|
228
|
+
|
229
|
+
if @type == :tos_auxiliary
|
230
|
+
@verb_to_conjugate + 'ē'
|
231
|
+
else
|
232
|
+
@verb_to_conjugate + 'vnk'
|
233
|
+
end
|
234
|
+
|
235
|
+
# don't need 'ak' in 'akes' because it's already plural
|
236
|
+
end
|
237
|
+
end
|
238
|
+
else
|
239
|
+
results << conjugating_each_dialectic_option(person_markers['3pp']) do |person_marker|
|
240
|
+
@verb_to_conjugate = @verb.dup
|
241
|
+
drop_the_etv!
|
242
|
+
add_person_marker!(person_marker)
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
results
|
247
|
+
end
|
248
|
+
|
249
|
+
def drop_the_etv!
|
250
|
+
@verb_to_conjugate.gsub!(/etv\z/, "")
|
251
|
+
end
|
252
|
+
|
253
|
+
def consonants
|
254
|
+
%w{ c f h k l m n p r s t w }
|
255
|
+
end
|
256
|
+
|
257
|
+
def irregulars
|
258
|
+
self.class.irregulars
|
259
|
+
end
|
260
|
+
|
261
|
+
def add_person_marker!(person_marker)
|
262
|
+
if @type == :tos_auxiliary
|
263
|
+
(@verb_to_conjugate + person_marker).gsub(/e$/, 'ē').gsub(/i$/, "iyē")
|
264
|
+
else
|
265
|
+
@verb_to_conjugate + person_marker
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
def ometv(tense)
|
270
|
+
Conjugators::Ometv::PastTwo.new(tense).conjugate![tense]
|
271
|
+
end
|
272
|
+
|
273
|
+
def self.past_two_person_markers
|
274
|
+
#etske ecke ecce etce
|
275
|
+
{
|
276
|
+
'1ps' => %w{ ivnk },
|
277
|
+
'2ps' => %w{ etskvnk eckvnk eccvnk etcvnk },
|
278
|
+
'3ps' => %w{ vnk }, # (e)
|
279
|
+
'1pp' => %w{ ēyvnk },
|
280
|
+
'2pp' => %w{ atskvnk ackvnk },
|
281
|
+
'3pp' => %w{ akvnk }, # ak(e) *
|
282
|
+
}
|
283
|
+
end
|
284
|
+
|
285
|
+
def person_markers
|
286
|
+
if @type == :basic
|
287
|
+
self.class.past_two_person_markers
|
288
|
+
else
|
289
|
+
self.class.person_markers
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
293
|
+
end
|
294
|
+
end
|
295
|
+
end
|
@@ -0,0 +1,353 @@
|
|
1
|
+
module Conjugators
|
2
|
+
module ActionVerbs
|
3
|
+
class PresentTense
|
4
|
+
NA ="N/A".freeze
|
5
|
+
OMETV_REGEX = /o[mw]etv/.freeze
|
6
|
+
ETV_REGEX = /etv$/.freeze
|
7
|
+
S = ?s.freeze
|
8
|
+
ETV = "etv".freeze
|
9
|
+
L = ?l.freeze
|
10
|
+
M = ?m.freeze
|
11
|
+
N = ?n.freeze
|
12
|
+
UE_REGEX = /ue\Z/
|
13
|
+
|
14
|
+
UE ="ue".freeze
|
15
|
+
EMPTY_STRING = "".freeze
|
16
|
+
VOWEL_REGEX = /[aeēiovu]/.freeze
|
17
|
+
LGRADES = {
|
18
|
+
'v'.freeze => 'a'.freeze,
|
19
|
+
'e'.freeze => 'ē'.freeze,
|
20
|
+
}.freeze
|
21
|
+
NULL_E_ENDING_REGEX = /e\z/.freeze
|
22
|
+
I_ENDING_REGEX = /i$/.freeze
|
23
|
+
Ē = 'ē'.freeze
|
24
|
+
IYĒ = 'iyē'.freeze
|
25
|
+
E_SPACE = 'e '.freeze
|
26
|
+
SPACE_TOS = ' tos'.freeze
|
27
|
+
|
28
|
+
extend Conjugators::ActionVerbs::Shared
|
29
|
+
# Note, MVSKOKE language here
|
30
|
+
def initialize(verb)
|
31
|
+
@verb = verb
|
32
|
+
|
33
|
+
raise "Invalid verb. Verb must end with 'etv'." unless @verb.end_with?(ETV)
|
34
|
+
raise "Invalid verb. Verb must be at least 5 letters long" unless @verb.size > 4
|
35
|
+
raise "Invalid verb. Verb must contain at least one vowel (excluding those in the '-etv' suffix)" unless @verb[0..-4].match?(VOWEL_REGEX)
|
36
|
+
|
37
|
+
@irregular = !!irregulars[@verb]
|
38
|
+
end
|
39
|
+
|
40
|
+
def word_filter
|
41
|
+
@@word_filter ||= {
|
42
|
+
"yvfketv" => {
|
43
|
+
:conjugate_1ps => { basic_present: [NA], basic_durative: [NA], tos_auxiliary: [NA], ometv_conjugated_auxiliary: [NA] },
|
44
|
+
:conjugate_2ps => { basic_present: [NA], basic_durative: [NA], tos_auxiliary: [NA], ometv_conjugated_auxiliary: [NA] },
|
45
|
+
:conjugate_1pp => { basic_present: [NA], basic_durative: [NA], tos_auxiliary: [NA], ometv_conjugated_auxiliary: [NA] },
|
46
|
+
:conjugate_2pp => { basic_present: [NA], basic_durative: [NA], tos_auxiliary: [NA], ometv_conjugated_auxiliary: [NA] },
|
47
|
+
#:conjugate_3ps => { basic_present: [NA], basic_durative: [NA], ometv_conjugated_auxiliary: [NA] },
|
48
|
+
:conjugate_3pp => { basic_present: [NA], basic_durative: [NA], ometv_conjugated_auxiliary: [NA] },
|
49
|
+
}
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
def conjugate!
|
54
|
+
{
|
55
|
+
verb: @verb,
|
56
|
+
first_person_singular: {
|
57
|
+
basic_present: conjugate(tense: :conjugate_1ps, type: :basic_present),
|
58
|
+
basic_durative: conjugate(tense: :conjugate_1ps, type: :basic_durative),
|
59
|
+
tos_auxiliary: conjugate(tense: :conjugate_1ps, type: :tos_auxiliary),
|
60
|
+
ometv_conjugated_auxiliary: conjugate(tense: :conjugate_1ps, type: :ometv_conjugated_auxiliary)
|
61
|
+
},
|
62
|
+
second_person_singular: {
|
63
|
+
basic_present: conjugate(tense: :conjugate_2ps, type: :basic_present),
|
64
|
+
basic_durative: conjugate(tense: :conjugate_2ps, type: :basic_durative),
|
65
|
+
tos_auxiliary: conjugate(tense: :conjugate_2ps, type: :tos_auxiliary),
|
66
|
+
ometv_conjugated_auxiliary: conjugate(tense: :conjugate_2ps, type: :ometv_conjugated_auxiliary)
|
67
|
+
},
|
68
|
+
third_person_singular: {
|
69
|
+
basic_present: conjugate(tense: :conjugate_3ps, type: :basic_present),
|
70
|
+
basic_durative: conjugate(tense: :conjugate_3ps, type: :basic_durative),
|
71
|
+
tos_auxiliary: conjugate(tense: :conjugate_3ps, type: :tos_auxiliary),
|
72
|
+
ometv_conjugated_auxiliary: conjugate(tense: :conjugate_3ps, type: :ometv_conjugated_auxiliary)
|
73
|
+
},
|
74
|
+
first_person_plural: {
|
75
|
+
basic_present: conjugate(tense: :conjugate_1pp, type: :basic_present),
|
76
|
+
basic_durative: conjugate(tense: :conjugate_1pp, type: :basic_durative),
|
77
|
+
tos_auxiliary: conjugate(tense: :conjugate_1pp, type: :tos_auxiliary),
|
78
|
+
ometv_conjugated_auxiliary: conjugate(tense: :conjugate_1pp, type: :ometv_conjugated_auxiliary)
|
79
|
+
},
|
80
|
+
second_person_plural: {
|
81
|
+
basic_present: conjugate(tense: :conjugate_2pp, type: :basic_present),
|
82
|
+
basic_durative: conjugate(tense: :conjugate_2pp, type: :basic_durative),
|
83
|
+
tos_auxiliary: conjugate(tense: :conjugate_2pp, type: :tos_auxiliary),
|
84
|
+
ometv_conjugated_auxiliary: conjugate(tense: :conjugate_2pp, type: :ometv_conjugated_auxiliary)
|
85
|
+
},
|
86
|
+
third_person_plural: {
|
87
|
+
basic_present: conjugate(tense: :conjugate_3pp, type: :basic_present),
|
88
|
+
basic_durative: conjugate(tense: :conjugate_3pp, type: :basic_durative),
|
89
|
+
tos_auxiliary: conjugate(tense: :conjugate_3pp, type: :tos_auxiliary),
|
90
|
+
ometv_conjugated_auxiliary: conjugate(tense: :conjugate_3pp, type: :ometv_conjugated_auxiliary)
|
91
|
+
}
|
92
|
+
}
|
93
|
+
end
|
94
|
+
|
95
|
+
private
|
96
|
+
def conj_send(tense)
|
97
|
+
send(tense)
|
98
|
+
end
|
99
|
+
|
100
|
+
def conjugate(type:, tense:)
|
101
|
+
return [word_filter.dig(@verb, tense, type)] if word_filter.dig(@verb, tense, type)
|
102
|
+
@type = type
|
103
|
+
case type
|
104
|
+
when :basic_present, :basic_durative
|
105
|
+
return NA if @verb.match?(OMETV_REGEX)
|
106
|
+
result = conj_send(tense)
|
107
|
+
if result[0].is_a?(String)
|
108
|
+
[result.map {|r| r + S }]
|
109
|
+
else
|
110
|
+
if @irregular
|
111
|
+
case result.size
|
112
|
+
when 1
|
113
|
+
rr_2plus = result[0].map {|r| "#{r}s (of 2+)"}
|
114
|
+
[rr_2plus]
|
115
|
+
when 2
|
116
|
+
rr2 = result[0].map {|r| "#{r}s (of 2)" }
|
117
|
+
rr3_plus = result[1].map {|r| "#{r}s (of 3+)"}
|
118
|
+
[rr2, rr3_plus]
|
119
|
+
end
|
120
|
+
else
|
121
|
+
result.map do |verb_form|
|
122
|
+
verb_form.map do |dialectic_option|
|
123
|
+
"#{dialectic_option}s"
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
when :tos_auxiliary
|
129
|
+
return NA if @verb.match?(OMETV_REGEX)
|
130
|
+
result = send(tense)
|
131
|
+
if result[0].is_a?(String)
|
132
|
+
[result.map {|r| r + SPACE_TOS }]
|
133
|
+
else
|
134
|
+
if @irregular
|
135
|
+
case result.size
|
136
|
+
when 1
|
137
|
+
rr_2plus = result[0].map {|r| "#{r} tos (of 2+)" }
|
138
|
+
[rr_2plus]
|
139
|
+
when 2
|
140
|
+
rr2 = result[0].map {|r| "#{r} tos (of 2)" }
|
141
|
+
rr3_plus = result[1].map {|r| "#{r} tos (of 3+)"}
|
142
|
+
[rr2, rr3_plus]
|
143
|
+
end
|
144
|
+
else
|
145
|
+
result.map do |verb_form|
|
146
|
+
verb_form.map do |dialectic_option|
|
147
|
+
"#{dialectic_option} tos"
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
when :ometv_conjugated_auxiliary
|
153
|
+
return NA if @verb.match?(OMETV_REGEX)
|
154
|
+
result = ometv(tense.to_s.split(?_).last)
|
155
|
+
|
156
|
+
# Do we need towakes? Right now believing so (even if the verb is plural already???)
|
157
|
+
#result.map! {|r| r.gsub("towakes", "tos") } if @irregular
|
158
|
+
|
159
|
+
verbs_to_conjugate = if self.class.irregulars[@verb] && tense =~ /p\z/
|
160
|
+
self.class.irregulars[@verb].values_at(2,3).compact
|
161
|
+
else
|
162
|
+
@verb
|
163
|
+
end
|
164
|
+
results = if verbs_to_conjugate.is_a?(String)
|
165
|
+
[result.map {|r| verbs_to_conjugate.gsub(ETV_REGEX, E_SPACE) + r }]
|
166
|
+
else
|
167
|
+
verbs_to_conjugate.map do |verb_to_conjugate|
|
168
|
+
result.map {|r| verb_to_conjugate.gsub(ETV_REGEX, E_SPACE) + r }
|
169
|
+
end
|
170
|
+
end
|
171
|
+
if verbs_to_conjugate == @verb
|
172
|
+
return results
|
173
|
+
end
|
174
|
+
if tense =~ /s\z/
|
175
|
+
results
|
176
|
+
else
|
177
|
+
case results.size
|
178
|
+
when 1
|
179
|
+
rr_2plus = results[0].map {|r| "#{r} (of 2+)"}
|
180
|
+
[rr_2plus]
|
181
|
+
when 2
|
182
|
+
rr2 = results[0].map {|r| "#{r} (of 2)" }
|
183
|
+
rr3_plus = results[1].map {|r| "#{r} (of 3+)"}
|
184
|
+
[rr2, rr3_plus]
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
def conjugating_each_dialectic_option(dialectic_person_marker_options)
|
191
|
+
dialectic_person_marker_options.map do |person_marker|
|
192
|
+
yield(person_marker)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
def conjugate_1ps
|
197
|
+
conjugating_each_dialectic_option(self.class.person_markers['1ps']) do |person_marker|
|
198
|
+
@verb_to_conjugate = @verb.dup
|
199
|
+
drop_the_etv!
|
200
|
+
lgrade_final_vowel!
|
201
|
+
add_person_marker!(person_marker)
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
def conjugate_2ps
|
206
|
+
conjugating_each_dialectic_option(self.class.person_markers['2ps']) do |person_marker|
|
207
|
+
@verb_to_conjugate = @verb.dup
|
208
|
+
drop_the_etv!
|
209
|
+
lgrade_final_vowel!
|
210
|
+
add_person_marker!(person_marker)
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
def conjugate_3ps
|
215
|
+
conjugating_each_dialectic_option(self.class.person_markers['3ps']) do |person_marker|
|
216
|
+
@verb_to_conjugate = @verb.dup
|
217
|
+
drop_the_etv!
|
218
|
+
lgrade_final_vowel!
|
219
|
+
add_person_marker!(person_marker)
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
def conjugate_1pp
|
224
|
+
results = []
|
225
|
+
if plural_forms = self.class.irregulars[@verb]&.values_at(2,3)&.compact
|
226
|
+
plural_forms.each do |verb|
|
227
|
+
results << conjugating_each_dialectic_option(self.class.person_markers['1pp']) do |person_marker|
|
228
|
+
@verb_to_conjugate = verb.dup
|
229
|
+
drop_the_etv!
|
230
|
+
lgrade_final_vowel!
|
231
|
+
|
232
|
+
if @type == :tos_auxiliary
|
233
|
+
@verb_to_conjugate + 'eyē'
|
234
|
+
else
|
235
|
+
add_person_marker!(person_marker)
|
236
|
+
end
|
237
|
+
|
238
|
+
end
|
239
|
+
end
|
240
|
+
else
|
241
|
+
results << conjugating_each_dialectic_option(self.class.person_markers['1pp']) do |person_marker|
|
242
|
+
@verb_to_conjugate = @verb.dup
|
243
|
+
drop_the_etv!
|
244
|
+
lgrade_final_vowel!
|
245
|
+
if @type == :tos_auxiliary
|
246
|
+
@verb_to_conjugate + 'eyē'
|
247
|
+
else
|
248
|
+
add_person_marker!(person_marker)
|
249
|
+
end
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
results
|
254
|
+
end
|
255
|
+
|
256
|
+
def conjugate_2pp
|
257
|
+
results = []
|
258
|
+
if plural_forms = self.class.irregulars[@verb]&.values_at(2,3)&.compact
|
259
|
+
plural_forms.each do |verb|
|
260
|
+
results << conjugating_each_dialectic_option(self.class.person_markers['2pp']) do |person_marker|
|
261
|
+
@verb_to_conjugate = verb.dup
|
262
|
+
drop_the_etv!
|
263
|
+
lgrade_final_vowel!
|
264
|
+
add_person_marker!(person_marker)
|
265
|
+
end
|
266
|
+
end
|
267
|
+
else
|
268
|
+
results << conjugating_each_dialectic_option(self.class.person_markers['2pp']) do |person_marker|
|
269
|
+
@verb_to_conjugate = @verb.dup
|
270
|
+
drop_the_etv!
|
271
|
+
lgrade_final_vowel!
|
272
|
+
add_person_marker!(person_marker)
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
results
|
277
|
+
end
|
278
|
+
|
279
|
+
def conjugate_3pp
|
280
|
+
results = []
|
281
|
+
if plural_forms = self.class.irregulars[@verb]&.values_at(2,3)&.compact
|
282
|
+
plural_forms.each do |verb|
|
283
|
+
results << conjugating_each_dialectic_option(self.class.person_markers['3pp']) do |person_marker|
|
284
|
+
@verb_to_conjugate = verb.dup
|
285
|
+
drop_the_etv!
|
286
|
+
lgrade_final_vowel!
|
287
|
+
|
288
|
+
if @type == :tos_auxiliary
|
289
|
+
@verb_to_conjugate + 'ē'
|
290
|
+
else
|
291
|
+
@verb_to_conjugate + 'e'
|
292
|
+
end
|
293
|
+
|
294
|
+
# don't need 'ak' in 'akes' because it's already plural
|
295
|
+
#add_person_marker!(person_marker)
|
296
|
+
end
|
297
|
+
end
|
298
|
+
else
|
299
|
+
results << conjugating_each_dialectic_option(self.class.person_markers['3pp']) do |person_marker|
|
300
|
+
@verb_to_conjugate = @verb.dup
|
301
|
+
drop_the_etv!
|
302
|
+
lgrade_final_vowel!
|
303
|
+
add_person_marker!(person_marker)
|
304
|
+
end
|
305
|
+
end
|
306
|
+
|
307
|
+
results
|
308
|
+
end
|
309
|
+
|
310
|
+
def drop_the_etv!
|
311
|
+
@verb_to_conjugate.gsub!(ETV_REGEX, EMPTY_STRING)
|
312
|
+
end
|
313
|
+
|
314
|
+
def consonants
|
315
|
+
@@consonants ||= %w{ c f h k l m n p r s t w }.freeze
|
316
|
+
end
|
317
|
+
|
318
|
+
def irregulars
|
319
|
+
self.class.irregulars
|
320
|
+
end
|
321
|
+
|
322
|
+
def lgrade_final_vowel!
|
323
|
+
# vowels: a e ē i o u v
|
324
|
+
# for example:
|
325
|
+
# - the final vowel in 'homp' is 'o'
|
326
|
+
# - the final vowel in 'vwelvpec' is 'e'
|
327
|
+
final_vowel_index = @verb_to_conjugate.rindex(VOWEL_REGEX)
|
328
|
+
return unless final_vowel_index
|
329
|
+
|
330
|
+
# L-M-N rule
|
331
|
+
ue_rule_substring = @verb_to_conjugate[(final_vowel_index-1)..final_vowel_index]
|
332
|
+
return if ue_rule_substring == UE
|
333
|
+
return if %w{ l m n }.include?(@verb_to_conjugate[final_vowel_index+1]) &&
|
334
|
+
consonants.include?(@verb_to_conjugate[final_vowel_index+2])
|
335
|
+
|
336
|
+
# replace the final vowel with the l-graded vowel
|
337
|
+
@verb_to_conjugate[final_vowel_index] = LGRADES.fetch(@verb_to_conjugate[final_vowel_index], @verb_to_conjugate[final_vowel_index])
|
338
|
+
end
|
339
|
+
|
340
|
+
def add_person_marker!(person_marker)
|
341
|
+
if @type == :tos_auxiliary || @type == :basic_durative
|
342
|
+
(@verb_to_conjugate + person_marker).gsub(NULL_E_ENDING_REGEX, Ē).gsub(I_ENDING_REGEX, IYĒ)
|
343
|
+
else
|
344
|
+
@verb_to_conjugate + person_marker
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
348
|
+
def ometv(tense)
|
349
|
+
Conjugators::Ometv::PresentTense.new(tense).conjugate![tense]
|
350
|
+
end
|
351
|
+
end
|
352
|
+
end
|
353
|
+
end
|