onvkv_seteyoposecetv 0.1.6 → 0.1.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af41863c354c278014204fc6ce331c41d3b894893849de327444c7f72835f0fb
4
- data.tar.gz: 103a9d8e8f9d29a857c2ca78428112f1a4d8d6cf902d8d515c63aa24ce4131ca
3
+ metadata.gz: 7cbc888ccbcb53e2f62a58989dd74f6c0f52ae3777cd3be4beb657082c3f4d43
4
+ data.tar.gz: c066f5812741d3ad9f265fba3cc6c5752d0ce92da3cb9ac4aaec8179ab47b410
5
5
  SHA512:
6
- metadata.gz: c3f8bc40798c1f9eae15bd59c1369b582ce5af0bf80c8e463dfe4d1fe0fcbf0ac0c6d22f02859638de9be417d89a087ed05b9e1b9957a4c545376e8081dd75af
7
- data.tar.gz: 234459f3ea47a2229006297bbe2f00c3303e7297f0bf7c343ae61e9bd610fee9ff660dba636341281bb65786c68fff88417aabd321723e875959609f94751e34
6
+ metadata.gz: '02438d2b37c577c3bbcdf9fdff7abebea4e9f4766b462113af4a7818309723a2f101a036ef9fbc622beafc4fdfeb0a6a3e207d8e352da41043c6ea2c5aa6b7d9'
7
+ data.tar.gz: e7d37000060d90989e2904bff73dfdcac21e68b30b1b27697f4b42ddae1695960aba531047405af45e749eaee5c1bfc36f996127dca990512b29a9e2c271e155
@@ -0,0 +1,307 @@
1
+ module Conjugators
2
+ module ActionVerbs
3
+ class Vhan
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
+ @tense = tense
54
+ case type
55
+ when :basic
56
+ result = send(tense)
57
+ if result[0].is_a?(String)
58
+ [result.map {|r| r + ?s }]
59
+ else
60
+ if @irregular
61
+ case result.size
62
+ when 1
63
+ rr_2plus = result[0].map {|r| "#{r}s (of 2+)"}
64
+ [rr_2plus]
65
+ when 2
66
+ rr2 = result[0].map {|r| "#{r}s (of 2)" }
67
+ rr3_plus = result[1].map {|r| "#{r}s (of 3+)"}
68
+ [rr2, rr3_plus]
69
+ end
70
+ else
71
+ result.map do |verb_form|
72
+ verb_form.map do |dialectic_option|
73
+ "#{dialectic_option}s"
74
+ end
75
+ end
76
+ end
77
+ end
78
+ when :tos_auxiliary
79
+ return "N/A" if @verb == "ometv" || @verb == "owetv"
80
+ result = send(tense)
81
+ if result[0].is_a?(String)
82
+ [result.map {|r| r + "t os" }]
83
+ else
84
+ if @irregular
85
+ case result.size
86
+ when 1
87
+ rr_2plus = result[0].map {|r| "#{r}t os (of 2+)" }
88
+ [rr_2plus]
89
+ when 2
90
+ rr2 = result[0].map {|r| "#{r}t os (of 2)" }
91
+ rr3_plus = result[1].map {|r| "#{r}t os (of 3+)"}
92
+ [rr2, rr3_plus]
93
+ end
94
+ else
95
+ result.map do |verb_form|
96
+ verb_form.map do |dialectic_option|
97
+ "#{dialectic_option}t os"
98
+ end
99
+ end
100
+ end
101
+ end
102
+ when :ometv_conjugated_auxiliary
103
+ return "N/A" if @verb == "ometv" || @verb == "owetv"
104
+ result = ometv(tense.to_s.split(?_).last)
105
+
106
+ # Do we need towakes? Right now believing so (even if the verb is plural already???)
107
+ #result.map! {|r| r.gsub("towakes", "tos") } if @irregular
108
+
109
+ verbs_to_conjugate = if self.class.irregulars[@verb] && tense =~ /p\z/
110
+ self.class.irregulars[@verb].values_at(2,3).compact
111
+ else
112
+ @verb
113
+ end
114
+ results = if verbs_to_conjugate.is_a?(String)
115
+ [result.map {|r| verbs_to_conjugate.gsub(/etv\z/, 'vhanet ') + r }]
116
+ else
117
+ verbs_to_conjugate.map do |verb_to_conjugate|
118
+ result.map {|r| verb_to_conjugate.gsub(/etv\z/, 'vhanet ') + r }
119
+ end
120
+ end
121
+ if verbs_to_conjugate == @verb
122
+ return results
123
+ end
124
+ if tense =~ /s\z/
125
+ results
126
+ else
127
+ case results.size
128
+ when 1
129
+ rr_2plus = results[0].map {|r| "#{r} (of 2+)"}
130
+ [rr_2plus]
131
+ when 2
132
+ rr2 = results[0].map {|r| "#{r} (of 2)" }
133
+ rr3_plus = results[1].map {|r| "#{r} (of 3+)"}
134
+ [rr2, rr3_plus]
135
+ end
136
+ end
137
+ end
138
+ end
139
+
140
+ def conjugating_each_dialectic_option(dialectic_person_marker_options)
141
+ dialectic_person_marker_options.map do |person_marker|
142
+ yield(person_marker)
143
+ end
144
+ end
145
+
146
+ def conjugate_1ps
147
+ conjugating_each_dialectic_option(person_markers['1ps']) do |person_marker|
148
+ @verb_to_conjugate = @verb.dup
149
+ drop_the_etv!
150
+ add_vhan!
151
+ add_person_marker!(person_marker)
152
+ end
153
+ end
154
+
155
+ def conjugate_2ps
156
+ conjugating_each_dialectic_option(person_markers['2ps']) do |person_marker|
157
+ @verb_to_conjugate = @verb.dup
158
+ drop_the_etv!
159
+ add_vhan!
160
+ add_person_marker!(person_marker)
161
+ end
162
+ end
163
+
164
+ def conjugate_3ps
165
+ conjugating_each_dialectic_option(person_markers['3ps']) do |person_marker|
166
+ @verb_to_conjugate = @verb.dup
167
+ drop_the_etv!
168
+ add_vhan!
169
+ add_person_marker!(person_marker)
170
+ end
171
+ end
172
+
173
+ def conjugate_1pp
174
+ results = []
175
+ if plural_forms = self.class.irregulars[@verb]&.values_at(2,3)&.compact
176
+ plural_forms.each do |verb|
177
+ results << conjugating_each_dialectic_option(person_markers['1pp']) do |person_marker|
178
+ @verb_to_conjugate = verb.dup
179
+ drop_the_etv!
180
+ add_vhan!
181
+
182
+ #if @type == :tos_auxiliary
183
+ # @verb_to_conjugate + 'eyē'
184
+ #else
185
+ add_person_marker!(person_marker)
186
+ #end
187
+
188
+ end
189
+ end
190
+ else
191
+ results << conjugating_each_dialectic_option(person_markers['1pp']) do |person_marker|
192
+ @verb_to_conjugate = @verb.dup
193
+ drop_the_etv!
194
+ add_vhan!
195
+ #if @type == :tos_auxiliary
196
+ # @verb_to_conjugate + 'eyē'
197
+ #else
198
+ add_person_marker!(person_marker)
199
+ #end
200
+ end
201
+ end
202
+
203
+ results
204
+ end
205
+
206
+ def conjugate_2pp
207
+ results = []
208
+ if plural_forms = self.class.irregulars[@verb]&.values_at(2,3)&.compact
209
+ plural_forms.each do |verb|
210
+ results << conjugating_each_dialectic_option(person_markers['2pp']) do |person_marker|
211
+ @verb_to_conjugate = verb.dup
212
+ drop_the_etv!
213
+ add_vhan!
214
+ add_person_marker!(person_marker)
215
+ end
216
+ end
217
+ else
218
+ results << conjugating_each_dialectic_option(person_markers['2pp']) do |person_marker|
219
+ @verb_to_conjugate = @verb.dup
220
+ drop_the_etv!
221
+ add_vhan!
222
+ add_person_marker!(person_marker)
223
+ end
224
+ end
225
+
226
+ results
227
+ end
228
+
229
+ def conjugate_3pp
230
+ results = []
231
+ if plural_forms = self.class.irregulars[@verb]&.values_at(2,3)&.compact
232
+ plural_forms.each do |verb|
233
+ results << conjugating_each_dialectic_option(person_markers['3pp']) do |person_marker|
234
+ @verb_to_conjugate = verb.dup
235
+ drop_the_etv!
236
+ add_vhan!
237
+
238
+ if @type == :tos_auxiliary
239
+ @verb_to_conjugate + 'ē'
240
+ else
241
+ @verb_to_conjugate + 'vnk'
242
+ end
243
+
244
+ # don't need 'ak' in 'akes' because it's already plural
245
+ end
246
+ end
247
+ else
248
+ results << conjugating_each_dialectic_option(person_markers['3pp']) do |person_marker|
249
+ @verb_to_conjugate = @verb.dup
250
+ drop_the_etv!
251
+ add_vkvhan!
252
+ add_person_marker!(person_marker)
253
+ end
254
+ end
255
+
256
+ results
257
+ end
258
+
259
+ def drop_the_etv!
260
+ @verb_to_conjugate.gsub!(/etv\z/, "")
261
+ end
262
+
263
+ def add_vhan!
264
+ @verb_to_conjugate << "vhan"
265
+ end
266
+
267
+ def add_vkvhan!
268
+ @verb_to_conjugate << "vkvhan"
269
+ end
270
+
271
+ def consonants
272
+ %w{ c f h k l m n p r s t w }
273
+ end
274
+
275
+ def irregulars
276
+ self.class.irregulars
277
+ end
278
+
279
+ def add_person_marker!(person_marker)
280
+ if @type == :tos_auxiliary
281
+ (@verb_to_conjugate + person_marker) #.gsub(/e$/, 'ē').gsub(/i$/, "iyē")
282
+ else
283
+ @verb_to_conjugate + person_marker
284
+ end
285
+ end
286
+
287
+ def ometv(tense)
288
+ Conjugators::Ometv::PresentTense.new(tense).conjugate![tense]
289
+ end
290
+
291
+ def self.vhan_person_markers
292
+ #etske ecke ecce etce
293
+ {
294
+ '3pp' => ["e"],
295
+ }
296
+ end
297
+
298
+ def person_markers
299
+ if @tense == :conjugate_3pp
300
+ self.class.vhan_person_markers
301
+ else
302
+ self.class.person_markers
303
+ end
304
+ end
305
+ end
306
+ end
307
+ end
@@ -5,6 +5,7 @@ require_relative 'action_verbs/past_one'
5
5
  require_relative 'action_verbs/past_three'
6
6
  require_relative 'action_verbs/past_two'
7
7
  require_relative 'action_verbs/present_tense'
8
+ require_relative 'action_verbs/vhan'
8
9
 
9
10
  module Conjugators
10
11
  module ActionVerbs
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OnvkvSeteyoposecetv
4
- VERSION = "0.1.6"
4
+ VERSION = "0.1.7"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onvkv_seteyoposecetv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tad Hosford
@@ -31,6 +31,7 @@ files:
31
31
  - lib/conjugators/action_verbs/past_two.rb
32
32
  - lib/conjugators/action_verbs/present_tense.rb
33
33
  - lib/conjugators/action_verbs/shared.rb
34
+ - lib/conjugators/action_verbs/vhan.rb
34
35
  - lib/conjugators/ometv.rb
35
36
  - lib/conjugators/ometv/past_three.rb
36
37
  - lib/conjugators/ometv/past_two.rb