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
@@ -1,7 +1,7 @@
1
1
  # encoding: UTF-8
2
2
 
3
- module Linguistics
4
- module Latin
3
+ module Linguistics
4
+ module Latin
5
5
  ##
6
6
  #
7
7
  # The Phonographia module handles the phonography of written Latin: how
@@ -17,7 +17,7 @@ module Linguistics
17
17
  # phonology, must be made to bear a short sound in the ultimate vowel.
18
18
  # This state is _phonographically_ notes as "amat." This module
19
19
  # implements the appropriate rules for proper phonetic compliance.
20
- #
20
+ #
21
21
  ##
22
22
  module Phonographia
23
23
  class << self
@@ -49,61 +49,61 @@ module Linguistics
49
49
  # fix_macrons(cāīō) #=> caiō ( Rule 1, Rule 2 )
50
50
  #
51
51
  ##
52
- def fix_macrons(s)
53
- raise if s.nil?
54
- return "" if s.empty?
55
- macron_table = {"\xc4\x81" => 'a',
56
- "\xc4\x93" => 'e',
57
- "\xc4\xab" => 'i',
58
- "\xc5\x8d" => 'o',
59
- "\xc5\xab" => 'u',
60
- "\xc4\x80" => 'A',
61
- "\xc4\x92" => 'E',
62
- "\xc4\xaa" => 'I',
63
- "\xc5\x8c" => 'O',
64
- "\xc5\xaa" => 'U',
65
- "ā" => 'a',
66
- "ē" => 'e',
67
- "ī" => 'i',
68
- "ō" => 'o',
69
- "ū" => 'u',
70
- "Ā" => 'A',
71
- "Ē" => 'E',
72
- "Ī" => 'I',
73
- "Ō" => 'O',
74
- "Ū" => 'U',
75
- }
52
+ def fix_macrons(s)
53
+ raise if s.nil?
54
+ return "" if s.empty?
55
+ macron_table = {"\xc4\x81" => 'a',
56
+ "\xc4\x93" => 'e',
57
+ "\xc4\xab" => 'i',
58
+ "\xc5\x8d" => 'o',
59
+ "\xc5\xab" => 'u',
60
+ "\xc4\x80" => 'A',
61
+ "\xc4\x92" => 'E',
62
+ "\xc4\xaa" => 'I',
63
+ "\xc5\x8c" => 'O',
64
+ "\xc5\xaa" => 'U',
65
+ "ā" => 'a',
66
+ "ē" => 'e',
67
+ "ī" => 'i',
68
+ "ō" => 'o',
69
+ "ū" => 'u',
70
+ "Ā" => 'A',
71
+ "Ē" => 'E',
72
+ "Ī" => 'I',
73
+ "Ō" => 'O',
74
+ "Ū" => 'U',
75
+ }
76
76
 
77
77
 
78
- # m/r/t at end of line shortens preceding vowel
79
- if s =~ /^(.*)([āēīōūĀĒĪŌŪ])([mrt])$/i
80
- s = $1 + macron_table[$2] + $3
81
- end
78
+ # m/r/t at end of line shortens preceding vowel
79
+ if s =~ /^(.*)([āēīōūĀĒĪŌŪ])([mrt])$/i
80
+ s = $1 + macron_table[$2] + $3
81
+ end
82
82
 
83
- # macron before vowel
84
- if s =~ /(.*)([āēīōūĀĒĪŌŪ])([āēīōūĀĒĪŌŪaeiouAEIOU])(.*)/i
85
- s = self.fix_macrons $1 + macron_table[$2] + $3 + $4
86
- end
83
+ # macron before vowel
84
+ if s =~ /(.*)([āēīōūĀĒĪŌŪ])([āēīōūĀĒĪŌŪaeiouAEIOU])(.*)/i
85
+ s = self.fix_macrons $1 + macron_table[$2] + $3 + $4
86
+ end
87
87
 
88
- if s=~ /n[td]/
89
- # n[td]
90
- mutaturum = s.split //
91
- mutatum = []
92
- mutaturum.each_with_index do |e, i|
93
- if ( e == "n" and
94
- mutaturum[i+1] =~ /[td]/ and
95
- not macron_table[mutaturum[i-1]].nil? )
96
- mutatum[i-1]=macron_table[mutaturum[i-1]]
97
- end
98
- mutatum << e
99
- end
88
+ if s=~ /n[td]/
89
+ # n[td]
90
+ mutaturum = s.split(//)
91
+ mutatum = []
92
+ mutaturum.each_with_index do |e, i|
93
+ if ( e == "n" and
94
+ mutaturum[i+1] =~ /[td]/ and
95
+ not macron_table[mutaturum[i-1]].nil? )
96
+ mutatum[i-1]=macron_table[mutaturum[i-1]]
97
+ end
98
+ mutatum << e
99
+ end
100
100
 
101
- return mutatum.join ''
102
- end
101
+ return mutatum.join ''
102
+ end
103
103
 
104
- return s
104
+ return s
105
+ end
105
106
  end
106
107
  end
107
- end
108
108
  end
109
109
  end
@@ -1,8 +1,8 @@
1
1
  # encoding: UTF-8
2
2
  #
3
- module Linguistics
4
- module Latin
5
- module Verb
3
+ module Linguistics
4
+ module Latin
5
+ module Verb
6
6
  class LatinVerb
7
7
  ##
8
8
  #
@@ -12,7 +12,7 @@ module Linguistics
12
12
  #
13
13
  # * 4th declension verbal noun
14
14
  # * Formed on the same stem as the perfect passive participle
15
- # * Only two forms in common use: accusative and ablative singular
15
+ # * Only two forms in common use: accusative and ablative singular
16
16
  #
17
17
  # Ablative is used with the neuter of certain adjectives to indicate
18
18
  # what respect a particular quality is applicable: <em>mirabile
@@ -31,8 +31,8 @@ module Linguistics
31
31
  #
32
32
  ###
33
33
  def supine
34
- acc = @pass_perf_part
35
- abl = acc.sub /^(.*)um$/, "\\1"
34
+ acc = passive_perfect_participle
35
+ abl = acc.sub( /^(.*)um$/, "\\1" )
36
36
  abl += "ū"
37
37
  {:ablative => abl, :accusative => acc}
38
38
  end
@@ -0,0 +1,227 @@
1
+ # encoding: UTF-8
2
+
3
+ require 'linguistics/latin/verb/phonographia'
4
+
5
+ module Linguistics
6
+ module Latin
7
+ module Verb
8
+ ##
9
+ # == NAME
10
+ #
11
+ # TenseBlock
12
+ #
13
+ # == DESCRIPTION
14
+ #
15
+ # As per the LatinVerb documentation, LatinVerbs decorate themselves with
16
+ # the method which loads up a voice/tense/mood black box. That black box
17
+ # is a TenseBlock. The TenseBlock, in turn, responds to getting the final
18
+ # two components of the fully-qualified vector back (person and number).
19
+ # It also has Array-like behaviors (e.g. +[]+) based on the 2 * 3 matrix.
20
+ #
21
+ # == INTERNALS
22
+ #
23
+ # Internally, a Tenseblock is effectively an Array of the arguments passed
24
+ # in during TenseBlock.initialize. These are assumed to be
25
+ # first/singular, second/singular, third/singular and then
26
+ # first/plural, second/plural, third/plural.
27
+ #
28
+ # Syntactic sugar methods are added to access this array. Thus, in a
29
+ # LatinVerb a fully-qualified vectors first 3/5 data resolve to a
30
+ # TenseBlock. The last 2/5 of resolution occurs within the TenseBlock
31
+ # (effectively pulling the contents of the Array). Therefore, when a
32
+ # LatinVerb is accessed with the quinpartite fully-qualified vector it can
33
+ # return the unique value. The mechanics of this hook through (surprise!)
34
+ # method_missing.
35
+ #
36
+ #
37
+ ##
38
+
39
+ class TenseBlock
40
+ include Linguistics::Latin::Phonographia
41
+ @tb_canonical_accessors = []
42
+ @tb_alias_accessors = []
43
+ @tb_accessors = []
44
+
45
+ class << self
46
+ def null_tense_block
47
+ return self.new [ '', '', '', '', '', '']
48
+ end
49
+ end
50
+
51
+ ##
52
+ #--
53
+ # TODO: I dream of this being generated dynamically through the
54
+ # VerbvectorGenerator for more dynamicity. This would require a richer DSL in
55
+ # VerbvectorGenerator, but would be totally awesome if we could describe this
56
+ # language in a DSL.
57
+ #++
58
+ ##
59
+
60
+ ##
61
+ # --
62
+ # This structure is used to define the methods that will be allowed to
63
+ # access the @results array. The key is the "canonical" name:
64
+ # (person)(number). This needs to be flexibly supported. This key
65
+ # map to a hash that contains the keys :aliases (for aliases to that
66
+ # particular "canonical") method as well as a Proc that should return
67
+ # the proper value for the "canonical" method (and therefore, by means
68
+ # of alias, also to the "aliased" methods). "Canonical" methods will
69
+ # be added to an array accessed by "tb_canonical_accessors." Aliases
70
+ # will be accesed by "tb_noncanonical_accessors." The aggregate is
71
+ # accesed by "tb_accessors."
72
+ #++
73
+ ##
74
+
75
+ # Describes the methods that are to be provided to instances as means
76
+ # for accessing the contents of the @results hash.
77
+ ACCESSOR_HASH = {
78
+ :first_person_singular_number => {
79
+ :aliases => [:singular_number_first_person],
80
+ :returns => lambda{ @results[0] }
81
+ },
82
+ :second_person_singular_number => {
83
+ :aliases => [:singular_number_second_person],
84
+ :returns => lambda{ @results[1] }
85
+ },
86
+ :third_person_singular_number => {
87
+ :aliases => [:singular_number_third_person],
88
+ :returns => lambda{ @results[2] }
89
+ },
90
+ :first_person_plural_number => {
91
+ :aliases => [:plural_number_first_person],
92
+ :returns => lambda{ @results[3] }
93
+ },
94
+ :second_person_plural_number => {
95
+ :aliases => [:plural_number_second_person],
96
+ :returns => lambda{ @results[4] }
97
+ },
98
+ :third_person_plural_number => {
99
+ :aliases => [:plural_number_third_person],
100
+ :returns => lambda{ @results[5] }
101
+ }
102
+ }
103
+
104
+ def self.add_acc_canonical(s); @tb_canonical_accessors << s; end # :nodoc:
105
+ def self.add_acc_alias(s); @tb_alias_accessors << s; end # :nodoc:
106
+
107
+ ACCESSOR_HASH.each_pair do |k,h|
108
+ define_method k, h[:returns]
109
+ self.add_acc_canonical k
110
+ h[:aliases].each{|a| alias_method a, k; self.add_acc_alias a}
111
+ end
112
+
113
+ @tb_accessors = @tb_canonical_accessors + @tb_alias_accessors
114
+
115
+
116
+ # Idea from Mike Perham (6/1/2011): Add a way to leave a note that
117
+ # describes, in English, the signification of the given tense. Good
118
+ # idea.
119
+
120
+ attr_reader :meaning
121
+
122
+ # === ARGUMENTS
123
+ #
124
+ # *r:* :: An Array (or something that can respond to to_a) containing 0-6
125
+ # elements that will be mapped into the 2*3 matrix of Latin verb person /
126
+ # number specifications.
127
+ # === RETURNS
128
+ #
129
+ # Nothing
130
+ ##
131
+ def initialize(r, opts={})
132
+ begin
133
+ unless r.class.is_a? Array
134
+ raise if r.nil?
135
+ r = r.to_a
136
+ end
137
+ @results = r.map{|v| Linguistics::Latin::Phonographia.fix_macrons v}
138
+ @meaning = opts[:meaning] if opts[:meaning]
139
+ rescue => e
140
+ raise e, "TenseBlock failed to initialize correctly. passed #{r.nil?}"
141
+ end
142
+ end
143
+
144
+ ##
145
+ #
146
+ # Required for serialization
147
+ #
148
+ ##
149
+ def to_json(*a)
150
+ {
151
+ 'json_class' => self.class.name,
152
+ 'data' => @results.map{|i| i.to_json}
153
+ }.to_json(*a)
154
+ end
155
+
156
+ ##
157
+ #
158
+ # Required for deserialization
159
+ #
160
+ ##
161
+ def TenseBlock.json_create(o)
162
+ new(o['data'])
163
+ end
164
+
165
+ ##
166
+ #
167
+ # Provides Array-like interface to the collection of results.
168
+ #
169
+ ##
170
+ def [](arg)
171
+ @results[arg]
172
+ end
173
+
174
+ ##
175
+ #
176
+ # To Array, useful in serialization
177
+ #
178
+ ##
179
+ def to_a
180
+ return @results
181
+ end
182
+
183
+ ##
184
+ #
185
+ # Add array compatibility support
186
+ #
187
+ ##
188
+ def length; return @results.length; end
189
+
190
+ ##
191
+ # Add array empty? compatibility
192
+ #
193
+ ##
194
+ def empty?; return @results.empty?; end
195
+
196
+ ##
197
+ #
198
+ # Add a sensible string display
199
+ #
200
+ ##
201
+ def to_s; return self.to_a.to_s; end
202
+
203
+ ##
204
+ # Return whether the result arrays is empty of words
205
+ ##
206
+ def wordless?
207
+ !@results.all?{ |r| r =~ /\w/ }
208
+ end
209
+
210
+ ##
211
+ #
212
+ # Provide a method_missing so that ambiguous cases can be resolved
213
+ #
214
+ ##
215
+ def method_missing(symbol, *args)
216
+ returnArray = []
217
+ self.class.class_eval{@tb_canonical_accessors}.grep(/#{symbol.to_s}/) do |s|
218
+ returnArray.push(send s)
219
+ end
220
+ return returnArray unless returnArray.empty?
221
+ raise
222
+ end
223
+ end
224
+ end
225
+ end
226
+ end
227
+
@@ -0,0 +1,92 @@
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 First
9
+ def active_voice_indicative_mood_future_tense
10
+ return TenseBlock.new(
11
+ [Linguistics::Latin::Verb::LatinVerb::AF_ONE_TWO_ENDINGS.collect{|x| stem + x}].flatten,
12
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:active_voice_indicative_mood_future_tense] }
13
+ )
14
+ end
15
+
16
+ def active_voice_indicative_mood_imperfect_tense
17
+ return TenseBlock.new(
18
+ [Linguistics::Latin::Verb::LatinVerb::AI_FIRST_AND_SECOND_CONJUG_PERS_ENDINGS.collect{|x| stem + x}].flatten,
19
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:active_voice_indicative_mood_imperfect_tense] }
20
+ )
21
+ end
22
+
23
+ def active_voice_indicative_mood_present_tense
24
+ return TenseBlock.new(
25
+ [ first_person_singular,
26
+ Linguistics::Latin::Verb::LatinVerb::AP_FIRST_AND_SECOND_CONJUG_PERS_ENDINGS.collect{ |ending| stem + ending}
27
+ ].flatten!,
28
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:active_voice_indicative_mood_present_tense] }
29
+ )
30
+ end
31
+
32
+ def active_voice_subjunctive_mood_present_tense
33
+ key = verb_type.to_s.split(/::/).last.to_sym
34
+ asp_base = Linguistics::Latin::Verb::LatinVerb::ACTIVE_PRESENT_SUBJUNCTIVE_ENDINGS[key].call(stem[0..-2])
35
+ endings_coll = ['m', Linguistics::Latin::Verb::LatinVerb::AP_FIRST_AND_SECOND_CONJUG_PERS_ENDINGS].flatten!
36
+ collection = endings_coll.map{ |ending| asp_base + ending }
37
+ TenseBlock.new( collection ,
38
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:active_voice_subjunctive_mood_present_tense] }
39
+ )
40
+ end
41
+
42
+ def passive_voice_indicative_mood_future_tense
43
+ fp_stem = stem+"bi"
44
+ standards = Linguistics::Latin::Verb::LatinVerb::PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG[2..-1].map{|x| fp_stem + x}
45
+ standards.pop
46
+ fp_stem.sub!(/.$/,'u')
47
+ members =
48
+ [ stem + "b\xc5\x8dr",
49
+ stem + "beris",
50
+ standards,
51
+ fp_stem+Linguistics::Latin::Verb::LatinVerb::PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG.last].flatten!
52
+
53
+ TenseBlock.new(
54
+ members,
55
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:passive_voice_indicative_mood_future_tense] }
56
+ )
57
+ end
58
+
59
+ def passive_voice_indicative_mood_imperfect_tense
60
+ imperfect_stem = stem + "b\xc4\x81"
61
+ members = Linguistics::Latin::Verb::LatinVerb::PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG.map{|x| imperfect_stem+x}
62
+ return TenseBlock.new(
63
+ members,
64
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:passive_voice_indicative_mood_imperfect_tense] }
65
+ )
66
+ end
67
+
68
+ def passive_voice_indicative_mood_present_tense
69
+ local_pe = Linguistics::Latin::Verb::LatinVerb::PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG.clone
70
+ return TenseBlock.new(
71
+ [first_person_singular.to_s + "r",
72
+ local_pe[1..-1].map{|x| @stem + x}].flatten!,
73
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:passive_voice_indicative_mood_present_tense] }
74
+ )
75
+ end
76
+
77
+ def passive_voice_subjunctive_mood_present_tense
78
+ key = verb_type.to_s.split(/::/).last.to_sym
79
+ short_base =
80
+ Linguistics::Latin::Verb::LatinVerb::ACTIVE_PRESENT_SUBJUNCTIVE_ENDINGS[key].call(stem[0..-2])
81
+ members = Linguistics::Latin::Verb::LatinVerb::PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG.map { |ending| short_base + ending }
82
+ TenseBlock.new(
83
+ members,
84
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:passive_voice_subjunctive_mood_present_tense] }
85
+ )
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
92
+
@@ -0,0 +1,92 @@
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 Fourth
9
+ def active_voice_indicative_mood_future_tense
10
+ return TenseBlock.new(
11
+ [Linguistics::Latin::Verb::LatinVerb::AF_OTHER_ENDINGS.collect{|x| stem + "i" + x}].flatten,
12
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:active_voice_indicative_mood_future_tense] }
13
+ )
14
+ end
15
+
16
+ def active_voice_indicative_mood_imperfect_tense
17
+ return TenseBlock.new(
18
+ [Linguistics::Latin::Verb::LatinVerb::AI_THIRD_CONJUG_PERS_ENDINGS.collect do |x|
19
+ stem + "i" + x end ].flatten!,
20
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:active_voice_indicative_mood_imperfect_tense] }
21
+ )
22
+ end
23
+
24
+ def active_voice_indicative_mood_present_tense
25
+ return TenseBlock.new(
26
+ [ first_person_singular,
27
+ Linguistics::Latin::Verb::LatinVerb::AP_THIRDIO_CONJG_PERS_ENDINGS.collect{ |ending| stem + ending }
28
+ ].flatten!,
29
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:active_voice_indicative_mood_present_tense] }
30
+ )
31
+ end
32
+
33
+ def active_voice_subjunctive_mood_present_tense
34
+ key = verb_type.to_s.split(/::/).last.to_sym
35
+ asp_base = Linguistics::Latin::Verb::LatinVerb::ACTIVE_PRESENT_SUBJUNCTIVE_ENDINGS[key].call(stem[0..-1])
36
+ elems = ['m',
37
+ Linguistics::Latin::Verb::LatinVerb::AP_FIRST_AND_SECOND_CONJUG_PERS_ENDINGS].flatten!.map do |ending|
38
+ asp_base + ending
39
+ end
40
+
41
+ TenseBlock.new(
42
+ elems,
43
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:active_voice_subjunctive_mood_present_tense] }
44
+ )
45
+ end
46
+
47
+ def passive_voice_indicative_mood_future_tense
48
+ ie_base = stem+"iē"
49
+ elems = [stem+"ia"+Linguistics::Latin::Verb::LatinVerb::PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG[0],
50
+ Linguistics::Latin::Verb::LatinVerb::PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG[1..-1].map{|x| ie_base + x}].flatten!
51
+ TenseBlock.new(
52
+ elems,
53
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:passive_voice_indicative_mood_future_tense] }
54
+ )
55
+ end
56
+
57
+ def passive_voice_indicative_mood_imperfect_tense
58
+ base = stem+"iēbā"
59
+ elems = [Linguistics::Latin::Verb::LatinVerb::PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG.map{|x| base + x}].flatten!
60
+ return TenseBlock.new(
61
+ elems,
62
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:passive_voice_indicative_mood_imperfect_tense] }
63
+ )
64
+ end
65
+
66
+ def passive_voice_indicative_mood_present_tense
67
+ base = @stem+"ī"
68
+ elems = [first_person_singular+"r",
69
+ Linguistics::Latin::Verb::LatinVerb::PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG[1..-2].map{|x| base + x},
70
+ base+Linguistics::Latin::Verb::LatinVerb::PASSIVE_ENDINGS_OTHER[-1]].flatten!
71
+ return TenseBlock.new(
72
+ elems,
73
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:passive_voice_indicative_mood_present_tense] }
74
+ )
75
+ end
76
+
77
+ def passive_voice_subjunctive_mood_present_tense
78
+ subjunctive_stem = stem + "iā"
79
+ elems = Linguistics::Latin::Verb::LatinVerb::PASSIVE_ENDINGS_FIRST_AND_SECOND_CONJG.map do |ending|
80
+ subjunctive_stem + ending
81
+ end
82
+ TenseBlock.new(
83
+ elems,
84
+ { :meaning => Linguistics::Latin::Verb::LatinVerb::MEANINGS[:passive_voice_subjunctive_mood_present_tense] }
85
+ )
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
92
+
@@ -0,0 +1,25 @@
1
+ module Linguistics
2
+ module Latin
3
+ module Verb
4
+ module TenseDefinitions
5
+ module Impersonal
6
+ def self.included(inclusor)
7
+ impersonal_handler
8
+ end
9
+ def impersonal_handler
10
+ singleton_class.class_eval do
11
+ def active_voice_indicative_mood_present_tense
12
+ TenseBlock.new ["", "", @original_string,
13
+ "", "", ""]
14
+ end
15
+ def active_voice_indicative_mood_present_tense_third_person_singular_number
16
+ return active_voice_indicative_mood_present_tense[2]
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+