latinverb 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/Gemfile +4 -1
  2. data/Gemfile.lock +24 -0
  3. data/Guardfile +10 -0
  4. data/README.markdown +1 -1
  5. data/Rakefile +12 -9
  6. data/latinverb.gemspec +4 -0
  7. data/lib/latinverb/chart.rb +5 -5
  8. data/lib/latinverb/version.rb +1 -1
  9. data/lib/latinverb.rb +266 -534
  10. data/lib/linguistics/latin/verb/classification_types.rb +19 -17
  11. data/lib/linguistics/latin/verb/constants.rb +14 -14
  12. data/lib/linguistics/latin/verb/deponent_tense_methods.rb +8 -21
  13. data/lib/linguistics/latin/verb/imperative_block.rb +118 -0
  14. data/lib/linguistics/latin/verb/infinitive_block.rb +39 -0
  15. data/lib/linguistics/latin/verb/infinitives.rb +181 -181
  16. data/lib/linguistics/latin/verb/irregulars.rb +74 -74
  17. data/lib/linguistics/latin/verb/latinverb/classmethods.rb +36 -117
  18. data/lib/linguistics/latin/verb/latinverb/data.rb +12 -15
  19. data/lib/linguistics/latin/verb/latinverb/defective_checker.rb +17 -0
  20. data/lib/linguistics/latin/verb/latinverb/deponent.rb +159 -0
  21. data/lib/linguistics/latin/verb/latinverb/display.rb +1 -2
  22. data/lib/linguistics/latin/verb/latinverb/impersonal.rb +34 -0
  23. data/lib/linguistics/latin/verb/latinverb/irregular.rb +83 -0
  24. data/lib/linguistics/latin/verb/latinverb/latin_verb_type_evaluator.rb +32 -0
  25. data/lib/linguistics/latin/verb/latinverb/latinverb_classifier.rb +100 -0
  26. data/lib/linguistics/latin/verb/latinverb/latinverb_input_sanitizer.rb +32 -0
  27. data/lib/linguistics/latin/verb/latinverb/latinverb_pp_extractor.rb +106 -0
  28. data/lib/linguistics/latin/verb/latinverb/metaprogramming.rb +30 -29
  29. data/lib/linguistics/latin/verb/latinverb/semideponent.rb +28 -0
  30. data/lib/linguistics/latin/verb/latinverb/validation.rb +5 -29
  31. data/lib/linguistics/latin/verb/latinverb/verbvector_description.rb +50 -0
  32. data/lib/linguistics/latin/verb/participle_block.rb +36 -0
  33. data/lib/linguistics/latin/verb/participles.rb +25 -25
  34. data/lib/linguistics/latin/verb/phonographia.rb +51 -51
  35. data/lib/linguistics/latin/verb/supine.rb +6 -6
  36. data/lib/linguistics/latin/verb/tense_block.rb +227 -0
  37. data/lib/linguistics/latin/verb/tense_definitions/first.rb +92 -0
  38. data/lib/linguistics/latin/verb/tense_definitions/fourth.rb +92 -0
  39. data/lib/linguistics/latin/verb/tense_definitions/impersonal.rb +25 -0
  40. data/lib/linguistics/latin/verb/tense_definitions/invariant.rb +613 -0
  41. data/lib/linguistics/latin/verb/tense_definitions/irregular.rb +82 -0
  42. data/lib/linguistics/latin/verb/tense_definitions/second.rb +97 -0
  43. data/lib/linguistics/latin/verb/tense_definitions/third.rb +86 -0
  44. data/lib/linguistics/latin/verb/tense_definitions/third_io.rb +91 -0
  45. data/test/testClusterResolution.rb +0 -1
  46. data/test/testDataStructures.rb +8 -5
  47. data/test/testDefectSemiImp.rb +9 -10
  48. data/test/testDeponentFirstConjugation.rb +2 -2
  49. data/test/testDeponentFourthConjugation.rb +2 -2
  50. data/test/testDeponentSecondConjugation.rb +2 -2
  51. data/test/testDeponentThirdConjugation.rb +2 -2
  52. data/test/testDeponentThirdIOConjugation.rb +2 -2
  53. data/test/testDeserializeInfinitives.rb +2 -4
  54. data/test/testFirstConjugation.rb +53 -53
  55. data/test/testFourthConjugation.rb +11 -11
  56. data/test/testFreakishVerbs.rb +12 -11
  57. data/test/testIrregulars.rb +24 -23
  58. data/test/testLatinVerb.rb +46 -55
  59. data/test/testSecondConjugation.rb +27 -27
  60. data/test/testThirdConjugation.rb +14 -14
  61. data/test/testThirdIOConjugation.rb +13 -13
  62. metadata +95 -53
  63. data/lib/linguistics/latin/verb/latinverb/auxiliary_classes.rb +0 -208
  64. data/lib/linguistics/latin/verb/tense_methods.rb +0 -950
@@ -0,0 +1,613 @@
1
+ # encoding: UTF-8
2
+ # vim: set fdm=marker tw=80 sw=2:
3
+
4
+ module Linguistics
5
+ module Latin
6
+ module Verb
7
+ module TenseDefinitions
8
+ ##
9
+ #
10
+ # Tense-forming methods that do not vary between the verb types
11
+ #
12
+ ##
13
+ module Invariant
14
+ ##
15
+ #
16
+ # === GRAMMATICAL FUNCTION
17
+ #
18
+ # Commands for immediate action. Always second person.
19
+ #
20
+ # === ARGUMENTS
21
+ #
22
+ # None
23
+ #
24
+ # === RETURNS
25
+ #
26
+ # TenseBlock
27
+ #
28
+ ###
29
+ def active_voice_imperative_mood_present_tense
30
+ imp = imperatives
31
+ TenseBlock.new( [ '', imp.present_tense_singular_number, '',
32
+ '', imp.present_tense_plural_number, ''
33
+ ],
34
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:active_voice_imperative_mood_present_tense] }
35
+ )
36
+ end
37
+
38
+ ##
39
+ #
40
+ # === GRAMMATICAL FUNCTION
41
+ #
42
+ # Commands for immediate action. Only supports second or third
43
+ # person.
44
+ #
45
+ # === ARGUMENTS
46
+ #
47
+ # None
48
+ #
49
+ # === RETURNS
50
+ #
51
+ # TenseBlock
52
+ #
53
+ ###
54
+ def active_voice_imperative_mood_future_tense# {{{
55
+ f = imperatives.future
56
+ return TenseBlock.new( [ '', f[0], f[2],
57
+ '', f[1], f[3]
58
+ ],
59
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:active_voice_imperative_mood_future_tense] }
60
+ )
61
+ end# }}}
62
+
63
+ ##
64
+ #
65
+ # === GRAMMATICAL FUNCTION
66
+ #
67
+ # Action completed in the future.
68
+ # A&G,160,b,3.
69
+ #
70
+ # === ARGUMENTS
71
+ #
72
+ # None
73
+ #
74
+ # === RETURNS
75
+ #
76
+ # TenseBlock
77
+ #
78
+ ###
79
+ def active_voice_indicative_mood_futureperfect_tense# {{{
80
+ substem = first_person_perfect[0..-2]
81
+ return TenseBlock.new [Linguistics::Latin::Verb::LatinVerb::APERF_FUTURE_ENDINGS.collect{|x| substem+x}].flatten,
82
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:active_voice_indicative_mood_futureperfect_tense] }
83
+ end# }}}
84
+
85
+ ##
86
+ #
87
+ # === GRAMMATICAL FUNCTION
88
+ #
89
+ # Action completed in the past prior to an event in the past.
90
+ # A&G,160,b,3.
91
+ #
92
+ # === ARGUMENTS
93
+ #
94
+ # None
95
+ #
96
+ # === RETURNS
97
+ #
98
+ # TenseBlock
99
+ #
100
+ ###
101
+ def active_voice_indicative_mood_pastperfect_tense# {{{
102
+ substem = first_person_perfect[0..-2]
103
+ return TenseBlock.new [Linguistics::Latin::Verb::LatinVerb::APERF_PAST_ENDINGS.collect{|x| substem+x}].flatten,
104
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:active_voice_indicative_mood_pastperfect_tense] }
105
+ end# }}}
106
+
107
+ ##
108
+ #
109
+ # === GRAMMATICAL FUNCTION
110
+ #
111
+ # <em>Refer to "Moods," above. Tense is constrained by function of
112
+ # the verb in context.</em>
113
+ #
114
+ # === ARGUMENTS
115
+ #
116
+ # None
117
+ #
118
+ # === RETURNS
119
+ #
120
+ # TenseBlock
121
+ #
122
+ ###
123
+ def active_voice_subjunctive_mood_imperfect_tense
124
+ TenseBlock.new(
125
+ ['m', Linguistics::Latin::Verb::LatinVerb::AP_FIRST_AND_SECOND_CONJUG_PERS_ENDINGS].flatten!.map do |ending|
126
+ present_active_infinitive.sub(/e$/,'ē') + ending
127
+ end,
128
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:active_voice_subjunctive_mood_imperfect_tense] }
129
+ )
130
+ end
131
+
132
+ ##
133
+ #
134
+ # === GRAMMATICAL FUNCTION
135
+ #
136
+ # Action completed in the past. A&G,160,b,1.
137
+ #
138
+ # === ARGUMENTS
139
+ #
140
+ # None
141
+ #
142
+ # === RETURNS
143
+ #
144
+ # TenseBlock
145
+ #
146
+ ###
147
+ def active_voice_indicative_mood_perfect_tense# {{{
148
+ substem = first_person_perfect[0..-2]
149
+ return TenseBlock.new [first_person_perfect.to_s, Linguistics::Latin::Verb::LatinVerb::APERF_ENDINGS.collect{|x| substem+x.to_s}].flatten,
150
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:active_voice_indicative_mood_perfect_tense] }
151
+ end# }}}
152
+
153
+ ##
154
+ #
155
+ # === GRAMMATICAL FUNCTION
156
+ #
157
+ # <em>Refer to "Moods," above. Tense is constrained by function of
158
+ # the verb in context.</em>
159
+ #
160
+ # === ARGUMENTS
161
+ #
162
+ # None
163
+ #
164
+ # === RETURNS
165
+ #
166
+ # TenseBlock
167
+ #
168
+ ###
169
+ def active_voice_subjunctive_mood_pastperfect_tense# {{{
170
+ asp_base = first_person_perfect[0..first_person_perfect.length-2] + "issē"
171
+ TenseBlock.new( ['m', Linguistics::Latin::Verb::LatinVerb::AP_FIRST_AND_SECOND_CONJUG_PERS_ENDINGS].flatten!.map do |ending|
172
+ asp_base + ending
173
+ end,
174
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:active_voice_subjunctive_mood_pastperfect_tense] }
175
+ )
176
+ end# }}}
177
+
178
+ ##
179
+ #
180
+ # === GRAMMATICAL FUNCTION
181
+ #
182
+ # <em>Refer to "Moods," above. Tense is constrained by function of
183
+ # the verb in context.</em>
184
+ #
185
+ # === ARGUMENTS
186
+ #
187
+ # None
188
+ #
189
+ # === RETURNS
190
+ #
191
+ # TenseBlock
192
+ #
193
+ ###
194
+ def active_voice_subjunctive_mood_perfect_tense
195
+ asp_base =
196
+ first_person_perfect[0..first_person_perfect.length-2] +
197
+ "erī"
198
+ TenseBlock.new(
199
+ ['m', Linguistics::Latin::Verb::LatinVerb::AP_FIRST_AND_SECOND_CONJUG_PERS_ENDINGS].flatten!.map do |ending|
200
+ asp_base + ending
201
+ end,
202
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:active_voice_subjunctive_mood_perfect_tense] }
203
+ )
204
+ end
205
+
206
+ ##
207
+ #
208
+ # === GRAMMATICAL FUNCTION
209
+ #
210
+ # <em>Refer to "Voice" section in reference, for function consult
211
+ # active-voice counterpart.</em>
212
+ # Wheelock, 122
213
+ #
214
+ # === ARGUMENTS
215
+ #
216
+ # None
217
+ #
218
+ # === RETURNS
219
+ #
220
+ # TenseBlock
221
+ #
222
+ ###
223
+ def passive_voice_indicative_mood_futureperfect_tense# {{{
224
+ return TenseBlock.new(
225
+ Linguistics::Latin::Verb::LatinVerb::PASS_PERF_FUTURE_ENDINGS.map{ |helping_verb| "#{passive_perfect_participle} #{helping_verb}" },
226
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:passive_voice_indicative_mood_futureperfect_tense] }
227
+ )
228
+ end# }}}
229
+
230
+ ##
231
+ #
232
+ # === GRAMMATICAL FUNCTION
233
+ #
234
+ # <em>Refer to "Voice" section in reference, for function consult
235
+ # active-voice counterpart.</em>
236
+ # Wheelock, 117
237
+ #
238
+ # === ARGUMENTS
239
+ #
240
+ # None
241
+ #
242
+ # === RETURNS
243
+ #
244
+ # TenseBlock
245
+ #
246
+ ###
247
+ def passive_voice_indicative_mood_pastperfect_tense# {{{
248
+ TenseBlock.new(
249
+ Linguistics::Latin::Verb::LatinVerb::PASS_PERF_PAST_ENDINGS.map{ |helping_verb| "#{passive_perfect_participle} #{helping_verb}" },
250
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:passive_voice_indicative_mood_pastperfect_tense]}
251
+ )
252
+ end# }}}
253
+
254
+ ##
255
+ #
256
+ # === GRAMMATICAL FUNCTION
257
+ #
258
+ # Wheelock, 122
259
+ #
260
+ # === ARGUMENTS
261
+ #
262
+ # None
263
+ #
264
+ # === RETURNS
265
+ #
266
+ # TenseBlock
267
+ #
268
+ ###
269
+ def passive_voice_indicative_mood_perfect_tense
270
+ TenseBlock.new(
271
+ Linguistics::Latin::Verb::LatinVerb::PASS_PERF_PRESENT_ENDINGS.map{ |helping_verb| "#{passive_perfect_participle} #{helping_verb}" },
272
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:passive_voice_indicative_mood_perfect_tense] }
273
+ )
274
+ end
275
+
276
+ ##
277
+ #
278
+ # === GRAMMATICAL FUNCTION
279
+ #
280
+ # <em>Refer to "Moods," above. Tense is constrained by function of
281
+ # the verb in context.</em>
282
+ #
283
+ # === ARGUMENTS
284
+ #
285
+ # None
286
+ #
287
+ # === RETURNS
288
+ #
289
+ # TenseBlock
290
+ #
291
+ ###
292
+ def passive_voice_subjunctive_mood_imperfect_tense
293
+ base = present_active_infinitive.gsub(/(.*)(.)$/,"\\1" + 'ē')
294
+ TenseBlock.new(
295
+ Linguistics::Latin::Verb::LatinVerb::PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG.map do |ending|
296
+ base + ending
297
+ end,
298
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:passive_voice_subjunctive_mood_imperfect_tense] }
299
+ )
300
+ end
301
+
302
+ ##
303
+ #
304
+ # === GRAMMATICAL FUNCTION
305
+ #
306
+ # <em>Refer to "Moods," above. Tense is constrained by function of
307
+ # the verb in context.</em>
308
+ #
309
+ # === ARGUMENTS
310
+ #
311
+ # None
312
+ #
313
+ # === RETURNS
314
+ #
315
+ # TenseBlock
316
+ #
317
+ ###
318
+ def passive_voice_subjunctive_mood_pastperfect_tense# {{{
319
+ count = -1
320
+ TenseBlock.new(Linguistics::Latin::Verb::LatinVerb::PASS_PLUPERF_PAST_ENDINGS.map do |ending|
321
+ count += 1
322
+ (count <= 2 ?
323
+ "[ #{triplicate_and_genderize passive_perfect_participle} ]" :
324
+ "[ #{pluralize_participial_listing(triplicate_and_genderize(passive_perfect_participle))} ]" )+ " " + ending
325
+ end,
326
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:passive_voice_subjunctive_mood_pastperfect_tense] }
327
+ )
328
+ end# }}}
329
+
330
+ ##
331
+ #
332
+ # === GRAMMATICAL FUNCTION
333
+ #
334
+ # <em>Refer to "Moods," above. Tense is constrained by function of
335
+ # the verb in context.</em>
336
+ #
337
+ # === ARGUMENTS
338
+ #
339
+ # None
340
+ #
341
+ # === RETURNS
342
+ #
343
+ # TenseBlock
344
+ #
345
+ ###
346
+ def passive_voice_subjunctive_mood_perfect_tense
347
+ counter = -1
348
+ TenseBlock.new(Linguistics::Latin::Verb::LatinVerb::PASS_PERF_SUBJUNCTIVE_ENDINGS.map do |ending|
349
+ counter += 1
350
+ (counter <=2 ?
351
+ "[ #{triplicate_and_genderize passive_perfect_participle} ]" :
352
+ "[ #{pluralize_participial_listing(triplicate_and_genderize(passive_perfect_participle))} ]" )+ " " + ending
353
+ end,
354
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:passive_voice_subjunctive_mood_perfect_tense] }
355
+ )
356
+ end
357
+
358
+ ##
359
+ #
360
+ # === GRAMMATICAL FUNCTION
361
+ #
362
+ # Used to express command. As A&G notes, oftentimes the Subjunctive
363
+ # is the correct mood for exhortation.
364
+ #
365
+ # === ARGUMENTS
366
+ #
367
+ # None
368
+ #
369
+ # === RETURNS
370
+ #
371
+ # TenseBlock
372
+ #
373
+ ###
374
+ def imperatives
375
+ @imperatives ||= form_imperatives
376
+ end
377
+
378
+ def form_imperatives# {{{
379
+
380
+ imperative_exceptions = {
381
+ "ducere" => %w(duc ducite),
382
+ "dicere" => %w(dic dicite),
383
+ "facere" => %w(fac facite),
384
+ "ferre" => %w(fer ferte),
385
+ "nolere" => %w(nolo nolite)
386
+ }
387
+
388
+ # Exceptional imperatives. If we have one, return it straight away.
389
+ if imperative_exceptions.has_key?(present_active_infinitive)
390
+ return Linguistics::Latin::Verb::ImperativeBlock.new(
391
+ imperative_exceptions[present_active_infinitive])
392
+ end
393
+
394
+ # Therefore, let us assume that we are dealing with a standard verb
395
+ # with standard imperatives. Accordingly, we will create an
396
+ # ImperativeBlock.
397
+
398
+ return Linguistics::Latin::Verb::ImperativeBlock.new stem, present_active_infinitive
399
+ end# }}}
400
+
401
+ ##
402
+ #
403
+ # === DESCRIPTION
404
+ #
405
+ # Used for handling verb states that are compounds like _amatus,
406
+ # amata, amatum sum_ and converting them to amati, amatae, amata,
407
+ # (sumus|estis|sunt).
408
+ #
409
+ # === ARGUMENTS
410
+ #
411
+ # +x:+ :: A string that looks like --us, --a, --um
412
+ # This method mutates those singular endings to plural forms
413
+ #
414
+ # === RETURNS
415
+ #
416
+ # Altered string
417
+ #
418
+ # === EXAMPLE
419
+ #
420
+ # pluralize_participial_listing(qq/amatus, amata, amatum/) #=>
421
+ # amatī, amatae, amata
422
+ #
423
+ ##
424
+ def pluralize_participial_listing(x)
425
+ x.sub!(/us,/, 'ī,' )
426
+ x.sub!(/a,/, 'ae,')
427
+ x.sub!(/um.*$/, 'a' )
428
+ end
429
+
430
+ ##
431
+ #
432
+ # === DESCRIPTION
433
+ #
434
+ # Used for turning a participial form --um into --us, --a, --um
435
+ #
436
+ # === ARGUMENTS
437
+ #
438
+ # +s:+ :: --um
439
+ #
440
+ # === RETURNS
441
+ #
442
+ # Altered string
443
+ #
444
+ # === EXAMPLE
445
+ #
446
+ # triplicate_and_genderize("amatum") #=> amatus, amata, amatum
447
+ #
448
+ ##
449
+ def triplicate_and_genderize(s)# {{{
450
+ stem = s.sub(/^(.*)um$/,"\\1")
451
+ [ stem + 'us',
452
+ stem + 'a',
453
+ s
454
+ ].join(', ')
455
+ end# }}}
456
+
457
+ ##
458
+ #
459
+ # === GRAMMATICAL FUNCTION
460
+ #
461
+ # Action to be completed in the future. A&G,160,a,3.
462
+ #
463
+ # === ARGUMENTS
464
+ #
465
+ # None
466
+ #
467
+ # === RETURNS
468
+ #
469
+ # TenseBlock
470
+ #
471
+ ###
472
+ def active_voice_indicative_mood_future_tense
473
+ end
474
+
475
+ ##
476
+ #
477
+ # === GRAMMATICAL FUNCTION
478
+ #
479
+ # Habitual action in the past. A&G,160,a,2.
480
+ #
481
+ # === ARGUMENTS
482
+ #
483
+ # None
484
+ #
485
+ # === RETURNS
486
+ #
487
+ # TenseBlock
488
+ #
489
+ ###
490
+ def active_voice_indicative_mood_imperfect_tense
491
+ end
492
+
493
+ ##
494
+ #
495
+ # === GRAMMATICAL FUNCTION
496
+ #
497
+ # The canonical building block of learning to conjugate verbs in
498
+ # Latin. Take the present active infinitive, chop off the ending, and
499
+ # add the classic o,s,t,mus,tis,nt
500
+ #
501
+ # Wheelock Reference, p. 4.
502
+ # A&G, 160,a,1.
503
+ #
504
+ # === ARGUMENTS
505
+ #
506
+ # None
507
+ #
508
+ # === RETURNS
509
+ #
510
+ # TenseBlock
511
+ #
512
+ ###
513
+ def active_voice_indicative_mood_present_tense
514
+ end
515
+
516
+ ##
517
+ #
518
+ # === GRAMMATICAL FUNCTION
519
+ #
520
+ # <em>Refer to "Moods," above. Tense is constrained by function of
521
+ # the verb in context.</em>
522
+ #
523
+ # === ARGUMENTS
524
+ #
525
+ # None
526
+ #
527
+ # === RETURNS
528
+ #
529
+ # TenseBlock
530
+ #
531
+ ###
532
+ def active_voice_subjunctive_mood_present_tense
533
+ end
534
+ ##
535
+ #
536
+ # === GRAMMATICAL FUNCTION
537
+ #
538
+ # <em>Refer to "Voice" section in reference, for function consult
539
+ # active-voice counterpart.</em>
540
+ #
541
+ # === ARGUMENTS
542
+ #
543
+ # None
544
+ #
545
+ # === RETURNS
546
+ #
547
+ # TenseBlock
548
+ #
549
+ ###
550
+ def passive_voice_indicative_mood_future_tense
551
+ end
552
+ ##
553
+ #
554
+ # === GRAMMATICAL FUNCTION
555
+ #
556
+ # <em>Refer to "Voice" section in reference, for function consult
557
+ # active-voice counterpart.</em>
558
+ # Wheelock, 117
559
+ #
560
+ # === ARGUMENTS
561
+ #
562
+ # None
563
+ #
564
+ # === RETURNS
565
+ #
566
+ # TenseBlock
567
+ #
568
+ ###
569
+ def passive_voice_indicative_mood_imperfect_tense
570
+ end
571
+ ##
572
+ #
573
+ # === GRAMMATICAL FUNCTION
574
+ #
575
+ # <em>Refer to "Voice" section in reference, for function consult
576
+ # active-voice counterpart.</em>
577
+ # Wheelock, 117
578
+ #
579
+ # === ARGUMENTS
580
+ #
581
+ # None
582
+ #
583
+ #
584
+ # === RETURNS
585
+ #
586
+ # TenseBlock
587
+ #
588
+ ###
589
+ def passive_voice_indicative_mood_present_tense
590
+ end
591
+ ##
592
+ #
593
+ # === GRAMMATICAL FUNCTION
594
+ #
595
+ # <em>Refer to "Moods," above. Tense is constrained by function of
596
+ # the verb in context.</em>
597
+ #
598
+ # === ARGUMENTS
599
+ #
600
+ # None
601
+ #
602
+ # === RETURNS
603
+ #
604
+ # TenseBlock
605
+ #
606
+ ###
607
+ def passive_voice_subjunctive_mood_present_tense
608
+ end
609
+ end
610
+ end
611
+ end
612
+ end
613
+ end
@@ -0,0 +1,82 @@
1
+ # encoding: UTF-8
2
+ # vim: set fdm=marker tw=80 sw=2 wrap:
3
+
4
+ module Linguistics
5
+ module Latin
6
+ module Verb
7
+ module TenseDefinitions
8
+ module Irregular
9
+ def self.included(inclusor)
10
+ begin
11
+ os_sym = self.symbolize_original_string @original_string
12
+ json_string = Linguistics::Latin::Verb.const_get os_sym
13
+
14
+ raise "Found a JSON string with null length!" if json_string.length <= 10
15
+ revivified_data_structure = JSON.parse json_string
16
+ rescue JSON::ParserError => e
17
+ puts "We were unable to parse JSON for #{@original_string} [o:#{o}] [o_sym:#{o_upcase_and_symbolic}]. Please verify your syntax."
18
+ raise e
19
+ rescue NameError => e
20
+ puts "We were unable to find a definition for #{@original_string} [o:#{o}] [o_sym:#{o_upcase_and_symbolic}]. Please provide one."
21
+ raise e
22
+ rescue => error
23
+ warn "#{@original_string} was identified as irregular but did not have a definition provided."
24
+ raise error
25
+ end
26
+
27
+ revivified_data_structure['tense_blocks'].each_pair do |k,v|
28
+ singleton_class.class_eval do
29
+ define_method k.to_sym do
30
+ TenseBlock.new v, { :meaning => MEANINGS[k.to_sym] }
31
+ end
32
+ end
33
+ end
34
+
35
+ @irregular_infinitives = revivified_data_structure['infinitives']
36
+ @irregular_participles = revivified_data_structure['participles']
37
+
38
+ return if @irregular_infinitives.nil?
39
+ return if @irregular_participles.nil?
40
+
41
+ singleton_class.class_eval do
42
+ def present_active_infinitive; return @irregular_infinitives.present_active_infinitive; end
43
+ def present_passive_infinitive; return @irregular_infinitives.present_passive_infinitive; end
44
+ def perfect_active_infinitive; return @irregular_infinitives.perfect_active_infinitive; end
45
+ def perfect_passive_infinitive; return @irregular_infinitives.perfect_passive_infinitive; end
46
+ def future_passive_infinitive; return @irregular_infinitives.future_passive_infinitive; end
47
+ def future_active_infinitive; return @irregular_infinitives.future_active_infinitive; end
48
+ end
49
+ singleton_class.class_eval do
50
+ def present_active_participle; return @irregular_participles.present_active_participle; end
51
+ def future_active_participle; return @irregular_participles.future_active_participle; end
52
+ def perfect_passive_participle; return @irregular_participles.perfect_passive_participle; end
53
+ def future_passive_participle; return @irregular_participles.future_passive_participle; end
54
+ def gerundive; return @irregular_participles.gerundive; end
55
+ def gerund; return @irregular_participles.d; end
56
+ end
57
+ end
58
+
59
+ def self.symbolize_original_string
60
+ # Translation added to account for Ruby not liking constants /^/
61
+ # with a multibyte. Probably a bug.
62
+ #
63
+ # This bug can be discovered by running #constants on
64
+ # Linguistics::Latin::Verb and seeing that Ōxxx is not found. To
65
+ # fix this i had to store it as ODI_. To make /that/ hack work, I
66
+ # had to add this bit beginning two lines below :-/
67
+ o = ActiveSupport::Multibyte::Chars.new( @original_string.gsub(/\s+/,'_') ).upcase
68
+
69
+ if o.match(/^([ĀĒĪŌŪ])(.*)/)
70
+ x=o[0,1].tr 'ĀĒĪŌŪ', 'AEIOU'
71
+ y=o[1,o.length]
72
+ o= x+y
73
+ end
74
+
75
+ o.to_sym
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
82
+