latinverb 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +1 -0
  3. data/Gemfile.lock +28 -6
  4. data/README.markdown +1 -1
  5. data/Rakefile +1 -0
  6. data/latinverb.gemspec +5 -3
  7. data/lib/latinverb/components/chart_presenter.rb +81 -0
  8. data/lib/latinverb/components/classifier/strategies/defective_verb_classification_strategy.rb +19 -0
  9. data/lib/latinverb/components/classifier/strategies/deponent_verb_classification_strategy.rb +19 -0
  10. data/lib/latinverb/components/classifier/strategies/impersonal_verb_classification_strategy.rb +19 -0
  11. data/lib/latinverb/components/classifier/strategies/irregular_verb_classification_strategy.rb +19 -0
  12. data/lib/latinverb/components/classifier/strategies/present_only_verb_classification_strategy.rb +21 -0
  13. data/lib/latinverb/components/classifier/strategies/regular_verb_classification_strategy.rb +19 -0
  14. data/lib/latinverb/components/classifier/strategies/semideponent_verb_classification_strategy.rb +19 -0
  15. data/lib/latinverb/components/classifier/strategies/verb_classification_strategy.rb +31 -0
  16. data/lib/latinverb/components/classifier/strategies/very_irregular_verb_classification_strategy.rb +20 -0
  17. data/lib/latinverb/components/classifier.rb +76 -0
  18. data/lib/latinverb/components/imperatives_handler.rb +40 -0
  19. data/lib/latinverb/components/infinitivizer.rb +50 -0
  20. data/lib/latinverb/components/participler.rb +58 -0
  21. data/lib/latinverb/components/passive_infinitive_factory.rb +42 -0
  22. data/lib/latinverb/components/present_only_checker.rb +32 -0
  23. data/lib/latinverb/components/principal_parts_extractor.rb +35 -0
  24. data/lib/latinverb/components/stem_deriver.rb +81 -0
  25. data/lib/latinverb/components/type_evaluator.rb +35 -0
  26. data/lib/latinverb/components/validator.rb +33 -0
  27. data/lib/latinverb/components.rb +9 -0
  28. data/lib/latinverb/dynamic_method_resolver.rb +41 -0
  29. data/lib/latinverb/errors.rb +10 -0
  30. data/lib/latinverb/imperative_block/imperative_rule_factory.rb +35 -0
  31. data/lib/latinverb/imperative_block.rb +71 -0
  32. data/lib/latinverb/paradigmatic_verbs.rb +21 -0
  33. data/lib/latinverb/serialization/hash.rb +17 -0
  34. data/lib/latinverb/serialization/json.rb +41 -0
  35. data/lib/latinverb/serialization/yaml.rb +15 -0
  36. data/lib/latinverb/serialization.rb +3 -0
  37. data/lib/latinverb/tense_block/null_tense_block.rb +12 -0
  38. data/lib/latinverb/tense_block/vector_resolution_delegate.rb +89 -0
  39. data/lib/latinverb/tense_block.rb +52 -0
  40. data/lib/latinverb/tense_method_applicator/defective_checker.rb +21 -0
  41. data/lib/{linguistics/latin/verb/latinverb/classmethods.rb → latinverb/tense_method_applicator/deponent_string_deriver.rb} +15 -69
  42. data/lib/latinverb/tense_method_applicator/first_builder.rb +98 -0
  43. data/lib/latinverb/tense_method_applicator/fourth.rb +100 -0
  44. data/lib/latinverb/tense_method_applicator/fourth_builder.rb +100 -0
  45. data/lib/latinverb/tense_method_applicator/irregular_builder.rb +117 -0
  46. data/lib/latinverb/tense_method_applicator/mutator_for_classification_factory.rb +38 -0
  47. data/lib/latinverb/tense_method_applicator/mutator_for_verb_type.rb +38 -0
  48. data/lib/latinverb/tense_method_applicator/mutators/deponent/imperative_mutator.rb +49 -0
  49. data/lib/latinverb/tense_method_applicator/mutators/deponent/infinitive_mutator.rb +42 -0
  50. data/lib/latinverb/tense_method_applicator/mutators/deponent/participle_mutator.rb +47 -0
  51. data/lib/latinverb/tense_method_applicator/mutators/deponent/tense_block_mutator.rb +55 -0
  52. data/lib/latinverb/tense_method_applicator/mutators/deponent.rb +41 -0
  53. data/lib/latinverb/tense_method_applicator/mutators/impersonal.rb +27 -0
  54. data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_imperative_mood_future_tense_strategy.rb +29 -0
  55. data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_imperative_mood_present_tense_strategy.rb +29 -0
  56. data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_indicative_mood_future_tense_strategy.rb +35 -0
  57. data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_indicative_mood_futureperfect_tense_strategy.rb +28 -0
  58. data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_indicative_mood_imperfect_tense_strategy.rb +24 -0
  59. data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_indicative_mood_pastperfect_tense_strategy.rb +28 -0
  60. data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_indicative_mood_perfect_tense_strategy.rb +29 -0
  61. data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_indicative_mood_present_tense_strategy.rb +24 -0
  62. data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_subjunctive_mood_imperfect_tense_strategy.rb +29 -0
  63. data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_subjunctive_mood_pastperfect_tense_strategy.rb +30 -0
  64. data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_subjunctive_mood_perfect_tense_strategy.rb +30 -0
  65. data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_subjunctive_mood_present_tense_strategy.rb +24 -0
  66. data/lib/latinverb/tense_method_applicator/mutators/invariant/imperatives.rb +53 -0
  67. data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_indicative_mood_future_tense_strategy.rb +24 -0
  68. data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_indicative_mood_futureperfect_tense_strategy.rb +27 -0
  69. data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_indicative_mood_imperfect_tense_strategy.rb +24 -0
  70. data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_indicative_mood_pastperfect_tense_strategy.rb +27 -0
  71. data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_indicative_mood_perfect_tense_strategy.rb +27 -0
  72. data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_indicative_mood_present_tense_strategy.rb +24 -0
  73. data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_subjunctive_mood_imperfect_tense_strategy.rb +30 -0
  74. data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_subjunctive_mood_pastperfect_tense_strategy.rb +33 -0
  75. data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_subjunctive_mood_perfect_tense_strategy.rb +33 -0
  76. data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_subjunctive_mood_present_tense_strategy.rb +24 -0
  77. data/lib/latinverb/tense_method_applicator/mutators/invariant/triplicate_and_pluralize_formatters.rb +26 -0
  78. data/lib/latinverb/tense_method_applicator/mutators/invariant.rb +65 -0
  79. data/lib/latinverb/tense_method_applicator/mutators/irregular/infinitives_builder.rb +35 -0
  80. data/lib/latinverb/tense_method_applicator/mutators/irregular/json_deserializer.rb +52 -0
  81. data/lib/latinverb/tense_method_applicator/mutators/irregular/json_revivifier.rb +48 -0
  82. data/lib/latinverb/tense_method_applicator/mutators/irregular/participles_builder.rb +35 -0
  83. data/lib/latinverb/tense_method_applicator/mutators/irregular/present_only_irregular_mask.rb +37 -0
  84. data/lib/latinverb/tense_method_applicator/mutators/irregular.rb +25 -0
  85. data/lib/latinverb/tense_method_applicator/mutators/present_only.rb +18 -0
  86. data/lib/latinverb/tense_method_applicator/mutators/regular.rb +17 -0
  87. data/lib/latinverb/tense_method_applicator/mutators/semideponent.rb +88 -0
  88. data/lib/latinverb/tense_method_applicator/perfect_tense_remover.rb +26 -0
  89. data/lib/latinverb/tense_method_applicator/second_builder.rb +105 -0
  90. data/lib/latinverb/tense_method_applicator/tense_methods_vectorizer.rb +73 -0
  91. data/lib/latinverb/tense_method_applicator/third_builder.rb +93 -0
  92. data/lib/latinverb/tense_method_applicator/thirdio_builder.rb +100 -0
  93. data/lib/latinverb/tense_method_applicator.rb +55 -0
  94. data/lib/latinverb/version.rb +2 -3
  95. data/lib/latinverb.rb +63 -419
  96. data/test/{testDeponentFirstConjugation.rb → integration/deponent_first_conjugation_test.rb} +1 -1
  97. data/test/{testDeponentFourthConjugation.rb → integration/deponent_fourth_conjugation_test.rb} +1 -1
  98. data/test/{testDeponentSecondConjugation.rb → integration/deponent_second_conjugation_test.rb} +1 -1
  99. data/test/{testDeponentThirdConjugation.rb → integration/deponent_third_conjugation_test.rb} +2 -2
  100. data/test/{testDeponentThirdIOConjugation.rb → integration/deponent_third_io_conjugation_test.rb} +1 -1
  101. data/test/{testFirstConjugation.rb → integration/first_conjugation_test.rb} +3 -7
  102. data/test/{testFreakishVerbs.rb → integration/freakish_vs.rb_test.rb} +4 -4
  103. data/test/{testIrregularSum.rb → integration/irregular_sum_test.rb} +1 -1
  104. data/test/{testIrregulars.rb → integration/irregulars_test.rb} +1 -1
  105. data/test/{testLatinVerb.rb → integration/latin_verb_test.rb} +5 -25
  106. data/test/{testThirdConjugation.rb → integration/third_conjugation_test.rb} +19 -21
  107. data/test/unit/latinverb_accessible_reader_test.rb +18 -0
  108. data/test/unit/principal_parts_extractor_test.rb +33 -0
  109. metadata +151 -79
  110. data/lib/latinverb/chart.rb +0 -94
  111. data/lib/linguistics/latin/verb/classification_types.rb +0 -61
  112. data/lib/linguistics/latin/verb/constants.rb +0 -201
  113. data/lib/linguistics/latin/verb/deponent_tense_methods.rb +0 -85
  114. data/lib/linguistics/latin/verb/imperative_block.rb +0 -118
  115. data/lib/linguistics/latin/verb/infinitive_block.rb +0 -39
  116. data/lib/linguistics/latin/verb/infinitives.rb +0 -212
  117. data/lib/linguistics/latin/verb/irregulars.rb +0 -4393
  118. data/lib/linguistics/latin/verb/latinverb/data.rb +0 -87
  119. data/lib/linguistics/latin/verb/latinverb/defective_checker.rb +0 -17
  120. data/lib/linguistics/latin/verb/latinverb/deponent.rb +0 -159
  121. data/lib/linguistics/latin/verb/latinverb/display.rb +0 -22
  122. data/lib/linguistics/latin/verb/latinverb/impersonal.rb +0 -34
  123. data/lib/linguistics/latin/verb/latinverb/irregular.rb +0 -83
  124. data/lib/linguistics/latin/verb/latinverb/latin_verb_type_evaluator.rb +0 -32
  125. data/lib/linguistics/latin/verb/latinverb/latinverb_classifier.rb +0 -100
  126. data/lib/linguistics/latin/verb/latinverb/latinverb_input_sanitizer.rb +0 -32
  127. data/lib/linguistics/latin/verb/latinverb/latinverb_pp_extractor.rb +0 -106
  128. data/lib/linguistics/latin/verb/latinverb/metaprogramming.rb +0 -80
  129. data/lib/linguistics/latin/verb/latinverb/semideponent.rb +0 -28
  130. data/lib/linguistics/latin/verb/latinverb/validation.rb +0 -42
  131. data/lib/linguistics/latin/verb/latinverb/verbvector_description.rb +0 -50
  132. data/lib/linguistics/latin/verb/participle_block.rb +0 -36
  133. data/lib/linguistics/latin/verb/participles.rb +0 -202
  134. data/lib/linguistics/latin/verb/phonographia.rb +0 -109
  135. data/lib/linguistics/latin/verb/supine.rb +0 -42
  136. data/lib/linguistics/latin/verb/tense_block.rb +0 -227
  137. data/lib/linguistics/latin/verb/tense_definitions/first.rb +0 -92
  138. data/lib/linguistics/latin/verb/tense_definitions/fourth.rb +0 -92
  139. data/lib/linguistics/latin/verb/tense_definitions/impersonal.rb +0 -25
  140. data/lib/linguistics/latin/verb/tense_definitions/invariant.rb +0 -613
  141. data/lib/linguistics/latin/verb/tense_definitions/irregular.rb +0 -82
  142. data/lib/linguistics/latin/verb/tense_definitions/second.rb +0 -97
  143. data/lib/linguistics/latin/verb/tense_definitions/third.rb +0 -86
  144. data/lib/linguistics/latin/verb/tense_definitions/third_io.rb +0 -91
  145. data/test/testDeserializeInfinitives.rb +0 -36
  146. /data/test/{testAmbiguousLookups.rb → integration/ambiguous_lookups_test.rb} +0 -0
  147. /data/test/{testClusterResolution.rb → integration/cluster_resolution_test.rb} +0 -0
  148. /data/test/{testDataStructures.rb → integration/data_structures_test.rb} +0 -0
  149. /data/test/{testDefectSemiImp.rb → integration/defect_semi_imp_test.rb} +0 -0
  150. /data/test/{testFourthConjugation.rb → integration/fourth_conjugation_test.rb} +0 -0
  151. /data/test/{testImperativeBlock.rb → integration/imperative_block_test.rb} +0 -0
  152. /data/test/{testMacronRules.rb → integration/macron_rules_test.rb} +0 -0
  153. /data/test/{testSecondConjugation.rb → integration/second_conjugation_test.rb} +0 -0
  154. /data/test/{testThirdIOConjugation.rb → integration/third_io_conjugation_test.rb} +0 -0
@@ -1,201 +0,0 @@
1
- # encoding: UTF-8
2
- module Linguistics
3
- module Latin
4
- module Verb
5
- class LatinVerb
6
- # :stopdoc:
7
- # active_present_endings: ("ap_"-prefixed)
8
- AP_FIRST_AND_SECOND_CONJUG_PERS_ENDINGS = %w(s t mus tis nt)
9
- AP_THIRD_CONJUG_PERS_ENDINGS = %w(ō is it imus itis unt)
10
- AP_THIRDIO_CONJG_PERS_ENDINGS = %w(is it imus itis iunt)
11
-
12
- # active_imperfect_endings: ("ai_"-prefixed)
13
- AI_FIRST_AND_SECOND_CONJUG_PERS_ENDINGS = %w(bam bās bat bāmus bātis bant)
14
- AI_THIRD_CONJUG_PERS_ENDINGS = %w(ēbam ēbās ēbat ēbāmus ēbātis ēbant)
15
-
16
- # active_future_endings: ("af_"-prefixed)
17
- AF_ONE_TWO_ENDINGS = %w(bō bis bit bimus bitis bunt)
18
- AF_OTHER_ENDINGS = %w(am ēs et ēmus ētis ent)
19
-
20
- # active_perfect_present: ("aperf"-prefixed)
21
- APERF_ENDINGS = %w(istī it imus istis ērunt)
22
- APERF_PAST_ENDINGS = PLUPERF_ENDINGS =
23
- %w(eram erās erat erāmus erātis erant)
24
- APERF_FUTURE_ENDINGS = %w(erō eris erit erimus eritis erint)
25
-
26
- # passive endings
27
- PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG =
28
- %w(r ris tur mur minī ntur)
29
- PASSIVE_ENDINGS_OTHER =
30
- %w(r eris itur imur iminī untur)
31
-
32
- PASS_PERF_PRESENT_ENDINGS = %w(sum es est sumus estis sunt)
33
- PASS_PERF_PAST_ENDINGS = %w(eram erās erat erāmus erātis erant)
34
- PASS_PERF_FUTURE_ENDINGS = %w(erō eris erit erimus eritis erint)
35
-
36
- PASS_PERF_SUBJUNCTIVE_ENDINGS = %w(sim sis sit simus sitis sint)
37
- PASS_PLUPERF_PAST_ENDINGS = %w(essem essēs esset essēmus essētis essent)
38
-
39
- # subjunctive tools
40
- # hash for getting a verb's subjunctive stem
41
- # based off the W[e] F[ea]r [A] L[ia]r mnemonic
42
- ACTIVE_PRESENT_SUBJUNCTIVE_ENDINGS = {
43
- :First => lambda { |x| return x + "ē" },
44
- :Second => lambda { |x| return x + "eā" },
45
- :Third => lambda { |x| return x + "ā" },
46
- :Fourth => lambda { |x| return x + "iā" },
47
- :ThirdIO => lambda { |x| return x + "iā" }
48
- }
49
-
50
- # Listing of all defective verbs
51
- # See A&G Sec. 205
52
- DEFECTIVE_VERBS = %w{
53
- addormisco
54
- adolesco
55
- aio
56
- albesco
57
- arboresco
58
- aresco
59
- assenesco
60
- auresco
61
- candesco
62
- canesco
63
- celebresco
64
- cornesco
65
- crudesco
66
- dulcesco
67
- effor
68
- erubesco
69
- extollo
70
- grandesco
71
- inquam
72
- languesco
73
- latesco
74
- longisco
75
- lucesco
76
- marcesco
77
- matresco
78
- mollesco
79
- remollesco
80
- siccesco
81
- sterto
82
- tenebresco
83
- tremesco
84
- tumesco
85
- veteresco
86
- }
87
-
88
- # Listing of all impersonal verbs
89
- # See A&G #207
90
- IMPERSONAL_VERBS = %w{
91
- accidit
92
- addecet
93
- advesperascit
94
- certum est
95
- condecet
96
- constat
97
- contingit
98
- cōnstat
99
- decet
100
- dedecet
101
- dēlecat
102
- evenit
103
- fit
104
- fulgerat
105
- grandinat
106
- ifvat
107
- interest
108
- licet
109
- lūcīscit hōc
110
- miseret
111
- necesse est
112
- ningit
113
- obtingit
114
- obvenit
115
- oportet
116
- paenitet
117
- piget
118
- placet
119
- pluit
120
- pluo
121
- praestat
122
- pudet
123
- restat
124
- rēfert
125
- rōrat
126
- superest
127
- taedet
128
- tonat
129
- vacat
130
- vesperāscit
131
- vidētur
132
- ēvenit
133
- }
134
-
135
- # Present system only. See A&G206
136
- # There are probably more of these, but A&G only lists these two.
137
- PRESENT_ONLY = %w{
138
- maēre
139
- ferīre
140
- aiō
141
- inquam
142
- for
143
- quaesō
144
- ovāre
145
- }
146
-
147
- # See A&G # 192
148
- SEMI_DEPONENTS = {
149
- 'audeō' => %w(audēre ausus),
150
- 'fidō' => %w(fidere fīsus),
151
- 'gaudeō' => %w(gaudēre gāvīsus),
152
- 'soleō' => %w(solēre solitus),
153
- }
154
-
155
- # Irregular Verbs. See A&G 197
156
- IRREGULAR_VERBS = {
157
- 'sum' => 'SUM_ESSE_FUĪ_FUTŪRUS',
158
- 'possum' => 'POSSUM_POSSE_POTUĪ',
159
- 'ferō' => 'FERŌ_FERRE_TULĪ_LĀTUM',
160
- 'eō' => 'EŌ_ĪRE_IVĪ_ITUM',
161
- 'nōlō' => 'NŌLŌ_NŌLLE_NŌLUĪ',
162
- 'volō' => 'VOLŌ_VELLE_VOLUĪ',
163
- 'mālō' => 'MĀLŌ_MĀLLE_MĀLUĪ',
164
- 'dō' => 'DŌ_DĀRE_DEDĪ_DATUM',
165
- 'edō' => 'EDŌ_ĒSSE_ĒDĪ_ĒSUM',
166
- 'queō' => 'QUEŌ_QUĪRE_QUĪVĪ',
167
- 'fiō' => 'FIŌ_FIĒRĪ_FACTUS',
168
- 'prōsum' => 'PRŌSUM_PRŌDESSE_PRŌFUĪ_PRŌFUTŪRUS',
169
- 'meminī' => 'MEMINĪ_MEMINISSE',
170
- 'ōdī' => 'ODĪ_ŌDISSE',
171
- 'coepī' => 'COEPĪ_COEPISSE_COEPTUM'
172
- }
173
-
174
- MEANINGS = {
175
- :active_voice_imperative_mood_future_tense => "Command that something be done in the future",
176
- :active_voice_indicative_mood_future_tense=> "Action to take place in the future: 'I will eat a hamburger.'" ,
177
- :active_voice_indicative_mood_futureperfect_tense => "Action to be completed in the future: 'I will have eaten a hamburger.'" ,
178
- :active_voice_indicative_mood_imperfect_tense => "Sustained, habitual action in the past: 'I was eating hamburgers daily when I was a freshman.'" ,
179
- :active_voice_indicative_mood_pastperfect_tense => "Action completed prior to a point in the past under discussion: 'I had eaten all the hamburgers (before my mother found out).'" ,
180
- :active_voice_indicative_mood_perfect_tense => "Action completed in the past: 'I ate a hamburger.'" ,
181
- :active_voice_indicative_mood_present_tense => "Present, possibly ongoing action relative to the speaker: 'I am eating a hamburger. I eat a hamburger.'" ,
182
- :active_voice_subjunctive_mood_imperfect_tense => "Subjunctive uses apply: commands, contrary to fact wishes, etc." ,
183
- :active_voice_subjunctive_mood_pastperfect_tense => "Subjunctive uses apply: commands, contrary to fact wishes, etc." ,
184
- :active_voice_subjunctive_mood_perfect_tense => "Subjunctive uses apply: commands, contrary to fact wishes, etc." ,
185
- :active_voice_subjunctive_mood_present_tense => "Subjunctive uses apply: commands, contrary to fact wishes, etc." ,
186
- :passive_voice_indicative_mood_future_tense => "Action to be performed on conjugant in future: 'The hamburger will be eaten.'" ,
187
- :passive_voice_indicative_mood_futureperfect_tense => "Action is to be performed to completion on conjugant in future: 'The hamburger will have been eaten.'" ,
188
- :passive_voice_indicative_mood_imperfect_tense => "Habitual action performed on the conjugant in the past: 'The hamburger was being eaten slowly by the BurgerHoarder.'" ,
189
- :passive_voice_indicative_mood_pastperfect_tense => "Action was fully completed upon the conjugant at a time prior to a time in the past: 'The hamburger had been eaten before my mom came home.'" ,
190
- :passive_voice_indicative_mood_perfect_tense => "Action was completed upon the conjugant in the past: 'The hamburger was eaten.'" ,
191
- :passive_voice_indicative_mood_present_tense => "Conjugant is presently undergoing action in the present time: 'The hamburger is being eaten.'" ,
192
- :passive_voice_subjunctive_mood_imperfect_tense => "Subjunctive uses apply: commands, contrary to fact wishes, etc." ,
193
- :passive_voice_subjunctive_mood_pastperfect_tense => "Subjunctive uses apply: commands, contrary to fact wishes, etc." ,
194
- :passive_voice_subjunctive_mood_perfect_tense => "Subjunctive uses apply: commands, contrary to fact wishes, etc." ,
195
- :passive_voice_subjunctive_mood_present_tense => "Subjunctive uses apply: commands, contrary to fact wishes, etc."
196
- }
197
- # :startdoc:
198
- end
199
- end
200
- end
201
- end
@@ -1,85 +0,0 @@
1
- module Linguistics
2
- module Latin
3
- module Verb
4
- ##
5
- #
6
- # Applies mutations to the method calls for semi-deponents.
7
- # Reference A&G 192:
8
- #
9
- # "A few verbs having no perfect stem are regular in the present, but
10
- # appear in the tenses of completed action as deponents. These are
11
- # called Semi-deponents."
12
- ##
13
- module DeponentTenseMethods
14
- # There's really no good reason that these should be re-defined here,
15
- # the methods that result from the verbector operation should be
16
- # sufficient. The only snare is that if you look at the method call
17
- # in =tense_methods.rb=, your @classification is set to
18
- # =Semideponent=. This means that the conditional lookup fails. So
19
- # the choices are to blanket overwrite here, or add another
20
- # conditional to each TenseBlock returning method, OR break the model
21
- # of TenseBlock construction. I think the last is the best option,
22
- # but this current implementation is the second best.
23
-
24
- def active_voice_indicative_mood_present_tense
25
- return @proxyVerb.send :active_voice_indicative_mood_present_tense
26
- end
27
-
28
- def active_voice_indicative_mood_imperfect_tense
29
- return @proxyVerb.send :active_voice_indicative_mood_imperfect_tense
30
- end
31
-
32
- def active_voice_indicative_mood_future_tense
33
- return @proxyVerb.send :active_voice_indicative_mood_future_tense
34
- end
35
-
36
- # These methods handle the strangeness of semi-deponents, it masks
37
- # passive perfects to active perfects
38
-
39
- def active_voice_indicative_mood_perfect_tense
40
- return @proxyVerb.send :passive_voice_indicative_mood_perfect_tense
41
- end
42
- def active_voice_indicative_mood_pastperfect_tense
43
- return @proxyVerb.send :passive_voice_indicative_mood_pastperfect_tense
44
- end
45
- def active_voice_indicative_mood_futureperfect_tense
46
- return @proxyVerb.send :passive_voice_indicative_mood_futureperfect_tense
47
- end
48
-
49
- def passive_voice_indicative_mood_perfect_tense
50
- return TenseBlock.null_tense_block
51
- end
52
-
53
- def passive_voice_indicative_mood_pastperfect_tense
54
- return TenseBlock.null_tense_block
55
- end
56
- def passive_voice_indicative_mood_futureperfect_tense
57
- return TenseBlock.null_tense_block
58
- end
59
-
60
- # Subjunctives: 2 active, 2 passive
61
- def active_voice_subjunctive_mood_present_tense
62
- return @proxyVerb.send :active_voice_subjunctive_mood_present_tense
63
- end
64
-
65
- def active_voice_subjunctive_mood_imperfect_tense
66
- return @proxyVerb.send :active_voice_subjunctive_mood_imperfect_tense
67
- end
68
-
69
- def active_voice_subjunctive_mood_perfect_tense
70
- return @proxyVerb.send :passive_voice_subjunctive_mood_perfect_tense
71
- end
72
- def active_voice_subjunctive_mood_pastperfect_tense
73
- return @proxyVerb.send :passive_voice_subjunctive_mood_pastperfect_tense
74
- end
75
- def passive_voice_subjunctive_mood_perfect_tense
76
- return TenseBlock.null_tense_block
77
- end
78
- def passive_voice_subjunctive_mood_pastperfect_tense
79
- return TenseBlock.null_tense_block
80
- end
81
- end
82
- end
83
- end
84
- end
85
-
@@ -1,118 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- require 'linguistics/latin/verb/phonographia'
4
- require 'yaml'
5
-
6
- module Linguistics
7
- module Latin
8
- module Verb
9
- class ImperativeBlock
10
- def initialize(stem,ppi)
11
- # In case we get an Array, for JSON revivification
12
- if stem.class == Array
13
- @results = stem
14
- end
15
-
16
- r = case
17
- when ppi =~ /āre$/
18
- [stem, stem+"te"]
19
- when ppi =~ /ēre$/
20
- [stem, stem+"te"]
21
- when ppi =~ /ere$/
22
- [stem+"e", stem+"ite"]
23
- when ppi =~ /īre$/
24
- [stem+"ī", stem+"īte"]
25
- end
26
-
27
- r << stem + "tō"
28
- r << stem + "tōte"
29
-
30
- r << stem + "tō"
31
- r << stem + "ntō"
32
-
33
- @results = r.map{|v| Linguistics::Latin::Phonographia.fix_macrons v}
34
- end
35
-
36
- def to_s
37
- return @results
38
- end
39
-
40
- ##
41
- #
42
- # Required for serialization
43
- #
44
- ##
45
- def to_json(*a)
46
- {
47
- 'json_class' => self.class.name,
48
- 'data' => @results.map{|i| i.to_json}
49
- }.to_json(*a)
50
- end
51
-
52
- ##
53
- #
54
- # Required for deserialization
55
- #
56
- ##
57
- def self.json_create(o)
58
- new(o['data'])
59
- end
60
-
61
- ##
62
- #
63
- # Provides Array-like interface to the collection of results.
64
- #
65
- ##
66
- def [](arg)
67
- @results[arg]
68
- end
69
-
70
- ##
71
- #
72
- # To Array, useful in serialization
73
- #
74
- ##
75
- def to_a
76
- return @results
77
- end
78
-
79
- ##
80
- #
81
- # Add array compatibility support
82
- #
83
- ##
84
- def length; return @results.length; end
85
-
86
- ##
87
- #
88
- # Returns the two, second person imperatives
89
- #
90
- ##
91
- def present(qualifier=nil)
92
- j=@results[0,2]
93
- return j if qualifier.nil?
94
- qualifier = qualifier.to_s
95
- return j[0] if qualifier =~ /singular/
96
- return j[1] if qualifier =~ /plural/
97
- end
98
-
99
- ##
100
- #
101
- # Returns the four, second and third person future imperatives
102
- #
103
- ##
104
- def future(qualifier=nil)
105
- return @results[2,4] if qualifier.nil?
106
- end
107
-
108
- def method_missing(sym,*args)
109
- if (sym =~ /^(present|future)_tense_(.*)/)
110
- self.send($1.to_sym, $2)
111
- else
112
- super
113
- end
114
- end
115
- end
116
- end
117
- end
118
- end
@@ -1,39 +0,0 @@
1
- module Linguistics
2
- module Latin
3
- module Verb
4
- ##
5
- #
6
- # The InfinitiveBlock holds the infinitives associated with a given
7
- # verb. The known infinitives are the following:
8
- #
9
- ##
10
- class InfinitiveBlock
11
- attr_reader :infinitive_methods
12
- def initialize(s)
13
- if s.is_a? Hash
14
- @infinitive_methods = s.keys
15
- end
16
-
17
- @infinitive_methods.each do |k|
18
- v=s[k]
19
- singleton_class.class_eval do
20
- define_method k.to_sym do
21
- return v
22
- end
23
- end
24
- end
25
- end
26
-
27
- ##
28
- #
29
- # Required for deserialization
30
- #
31
- ##
32
- def self.json_create(o)
33
- new(o['data'])
34
- end
35
- end
36
- end
37
- end
38
- end
39
-
@@ -1,212 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- require 'latinverb'
4
- require 'linguistics/latin/verb/phonographia'
5
-
6
- module Linguistics
7
- module Latin
8
- module Verb
9
- ##
10
- # == NAME
11
- #
12
- # Infinitives
13
- #
14
- # == DESCRIPTION
15
- #
16
- # This module contains the methods that, when mixed into a LatinVerb,
17
- # will provide it the ability to resolve its infinitives (verbal nouns).
18
- #
19
- # == REFERENCE
20
- #
21
- # Allen and Greenough Se. 155:
22
- #
23
- # <em>From the footnotes</em>
24
- #
25
- # 1. The Infinitive is strictly the locative case of an abstract
26
- # noun, expressing the action of the verb (cf. sec. 451)
27
- #
28
- #
29
- ##
30
- module Infinitives
31
-
32
- ##########################################
33
- # Infinitives
34
- ##########################################
35
- # Some very handy getter and setters, for serialization
36
- ##
37
-
38
- def infinitives
39
- return {
40
- :present_active_infinitive => present_active_infinitive,
41
- :perfect_active_infinitive => perfect_active_infinitive,
42
- :future_active_infinitive => future_active_infinitive,
43
- :present_passive_infinitive => present_passive_infinitive,
44
- :perfect_passive_infinitive => perfect_passive_infinitive,
45
- :future_passive_infinitive => future_passive_infinitive
46
- }
47
- end
48
-
49
- ##
50
- #
51
- # === GRAMMATICAL FUNCTION
52
- #
53
- # A&G, 157,d:
54
- #
55
- # The Infinitive is used chiefly as an indeclinable noun, as the subject
56
- # or complement of another ver ( 452, 456.n)
57
- #
58
- # "To X"
59
- #
60
- # === ARGUMENTS
61
- #
62
- # None
63
- #
64
- # === RETURNS
65
- #
66
- # Array of participles
67
- #
68
- ###
69
- def present_active_infinitive
70
- return @present_active_infinitive
71
- end
72
-
73
- ##
74
- #
75
- # === GRAMMATICAL FUNCTION
76
- #
77
- # A&G, 157,d:
78
- #
79
- # The Infinitive is used chiefly as an indeclinable noun, as the subject
80
- # or complement of another ver ( 452, 456.n)
81
- #
82
- # "To have X-d"
83
- #
84
- # === ARGUMENTS
85
- #
86
- # None
87
- #
88
- # === RETURNS
89
- #
90
- # Array of participles
91
- #
92
- ###
93
- def perfect_active_infinitive
94
- return @first_person_perfect+"sse"
95
- end
96
-
97
- ##
98
- #
99
- # === GRAMMATICAL FUNCTION
100
- #
101
- # A&G, 157,d:
102
- #
103
- # The Infinitive is used chiefly as an indeclinable noun, as the subject
104
- # or complement of another ver ( 452, 456.n)
105
- #
106
- # "To be about to X"
107
- #
108
- # === ARGUMENTS
109
- #
110
- # None
111
- #
112
- # === RETURNS
113
- #
114
- # Array of participles
115
- #
116
- ###
117
- def future_active_infinitive
118
- return future_active_participle.sub(/,.*/,'') + " esse"
119
- end
120
-
121
- ##
122
- #
123
- # === GRAMMATICAL FUNCTION
124
- #
125
- # A&G, 157,d:
126
- #
127
- # The Infinitive is used chiefly as an indeclinable noun, as the subject
128
- # or complement of another ver ( 452, 456.n)
129
- #
130
- # "To be X-d"
131
- #
132
- # === ARGUMENTS
133
- #
134
- # None
135
- #
136
- # === RETURNS
137
- #
138
- # Array of participles
139
- #
140
- ###
141
- def present_passive_infinitive
142
- if verb_type == Linguistics::Latin::Verb::VerbTypes::First
143
- return @present_active_infinitive.gsub(/(.*)e$/,"\\1ī")
144
- end
145
- if verb_type == Linguistics::Latin::Verb::VerbTypes::Second
146
- return @present_active_infinitive.gsub(/(.*)e$/,"\\1ī")
147
- end
148
- if verb_type == Linguistics::Latin::Verb::VerbTypes::ThirdIO
149
- return @present_active_infinitive.gsub(/(.*)ere$/,"\\1ī")
150
- end
151
- if verb_type == Linguistics::Latin::Verb::VerbTypes::Third
152
- return @present_active_infinitive.gsub(/(.*)ere$/,"\\1ī")
153
- end
154
- if verb_type == Linguistics::Latin::Verb::VerbTypes::Fourth
155
- return @present_active_infinitive.gsub(/(.*)e$/,"\\1ī")
156
- end
157
- end
158
-
159
- ##
160
- #
161
- # === GRAMMATICAL FUNCTION
162
- #
163
- # A&G, 157,d:
164
- #
165
- # The Infinitive is used chiefly as an indeclinable noun, as the subject
166
- # or complement of another ver ( 452, 456.n)
167
- #
168
- # "To have been X-d"
169
- #
170
- # === ARGUMENTS
171
- #
172
- # None
173
- #
174
- # === RETURNS
175
- #
176
- # Array of participles
177
- #
178
- ###
179
- def perfect_passive_infinitive
180
- return perfect_passive_participle + " esse"
181
- end
182
-
183
- ##
184
- #
185
- # === GRAMMATICAL FUNCTION
186
- #
187
- # A&G, 157,d:
188
- #
189
- # The Infinitive is used chiefly as an indeclinable noun, as the subject
190
- # or complement of another ver ( 452, 456.n)
191
- #
192
- # "To be about to be X-d"
193
- #
194
- # <b>Note:</b> This form is exceedingly rare. Wheelock notes that
195
- # Romans preferred to use the 4th principal part + <b>fore</b>.
196
- #
197
- # === ARGUMENTS
198
- #
199
- # None
200
- #
201
- # === RETURNS
202
- #
203
- # Array of participles
204
- #
205
- ###
206
- def future_passive_infinitive
207
- return supine[:accusative] + " īrī"
208
- end
209
- end
210
- end
211
- end
212
- end