latinverb 0.9.5 → 1.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- data/Gemfile.lock +73 -28
- data/Rakefile +1 -7
- data/latinverb.gemspec +23 -4
- data/lib/latinverb/imperative_block/imperative_rule_factory.rb +1 -0
- data/lib/latinverb/imperative_block.rb +1 -2
- data/lib/latinverb/latinverb.rb +62 -0
- data/lib/latinverb/paradigmatic_verbs.rb +1 -0
- data/lib/latinverb/querent_mutators/deponent/infinitive_mutator.rb +24 -0
- data/lib/latinverb/querent_mutators/deponent/participle_mutator.rb +24 -0
- data/lib/latinverb/{tense_method_applicator/mutators/present_only.rb → querent_mutators/impersonal.rb} +5 -2
- data/lib/latinverb/querent_mutators/semideponent.rb +22 -0
- data/lib/latinverb/tense_block.rb +8 -7
- data/lib/latinverb/tense_block_names.rb +32 -0
- data/lib/latinverb/{components/validator.rb → validator.rb} +1 -3
- data/lib/latinverb/version.rb +1 -1
- data/lib/latinverb.rb +21 -77
- data/test/integration/ambiguous_lookups_test.rb +1 -7
- data/test/integration/cluster_resolution_test.rb +1 -7
- data/test/integration/data_structures_test.rb +2 -9
- data/test/integration/defect_semi_imp_test.rb +4 -10
- data/test/integration/deponent_first_conjugation_test.rb +7 -9
- data/test/integration/deponent_fourth_conjugation_test.rb +6 -9
- data/test/integration/deponent_second_conjugation_test.rb +12 -11
- data/test/integration/deponent_third_conjugation_test.rb +1 -9
- data/test/integration/deponent_third_io_conjugation_test.rb +6 -9
- data/test/integration/first_conjugation_test.rb +8 -14
- data/test/integration/fourth_conjugation_test.rb +7 -7
- data/test/integration/freakish_verb_test.rb +86 -0
- data/test/integration/freakish_vs.rb_test.rb +1 -1
- data/test/integration/imperative_block_test.rb +1 -9
- data/test/integration/irregular_sum_test.rb +1 -10
- data/test/integration/irregulars_test.rb +1 -10
- data/test/integration/macron_rules_test.rb +1 -8
- data/test/integration/second_conjugation_test.rb +8 -8
- data/test/integration/third_conjugation_test.rb +8 -6
- data/test/integration/third_io_conjugation_test.rb +6 -6
- metadata +262 -107
- data/lib/latinverb/components/chart_presenter.rb +0 -81
- data/lib/latinverb/components/classifier/strategies/defective_verb_classification_strategy.rb +0 -19
- data/lib/latinverb/components/classifier/strategies/deponent_verb_classification_strategy.rb +0 -19
- data/lib/latinverb/components/classifier/strategies/impersonal_verb_classification_strategy.rb +0 -19
- data/lib/latinverb/components/classifier/strategies/irregular_verb_classification_strategy.rb +0 -19
- data/lib/latinverb/components/classifier/strategies/present_only_verb_classification_strategy.rb +0 -21
- data/lib/latinverb/components/classifier/strategies/regular_verb_classification_strategy.rb +0 -19
- data/lib/latinverb/components/classifier/strategies/semideponent_verb_classification_strategy.rb +0 -19
- data/lib/latinverb/components/classifier/strategies/verb_classification_strategy.rb +0 -31
- data/lib/latinverb/components/classifier/strategies/very_irregular_verb_classification_strategy.rb +0 -20
- data/lib/latinverb/components/classifier.rb +0 -76
- data/lib/latinverb/components/imperatives_handler.rb +0 -40
- data/lib/latinverb/components/infinitivizer.rb +0 -50
- data/lib/latinverb/components/participler.rb +0 -58
- data/lib/latinverb/components/passive_infinitive_factory.rb +0 -42
- data/lib/latinverb/components/present_only_checker.rb +0 -32
- data/lib/latinverb/components/principal_parts_extractor.rb +0 -35
- data/lib/latinverb/components/stem_deriver.rb +0 -81
- data/lib/latinverb/components/type_evaluator.rb +0 -35
- data/lib/latinverb/components.rb +0 -9
- data/lib/latinverb/dynamic_method_resolver.rb +0 -41
- data/lib/latinverb/errors.rb +0 -10
- data/lib/latinverb/serialization/hash.rb +0 -17
- data/lib/latinverb/serialization/json.rb +0 -41
- data/lib/latinverb/serialization/yaml.rb +0 -15
- data/lib/latinverb/serialization.rb +0 -3
- data/lib/latinverb/tense_method_applicator/defective_checker.rb +0 -21
- data/lib/latinverb/tense_method_applicator/deponent_string_deriver.rb +0 -80
- data/lib/latinverb/tense_method_applicator/first_builder.rb +0 -98
- data/lib/latinverb/tense_method_applicator/fourth.rb +0 -100
- data/lib/latinverb/tense_method_applicator/fourth_builder.rb +0 -100
- data/lib/latinverb/tense_method_applicator/irregular_builder.rb +0 -117
- data/lib/latinverb/tense_method_applicator/mutator_for_classification_factory.rb +0 -38
- data/lib/latinverb/tense_method_applicator/mutator_for_verb_type.rb +0 -38
- data/lib/latinverb/tense_method_applicator/mutators/deponent/imperative_mutator.rb +0 -49
- data/lib/latinverb/tense_method_applicator/mutators/deponent/infinitive_mutator.rb +0 -42
- data/lib/latinverb/tense_method_applicator/mutators/deponent/participle_mutator.rb +0 -47
- data/lib/latinverb/tense_method_applicator/mutators/deponent/tense_block_mutator.rb +0 -55
- data/lib/latinverb/tense_method_applicator/mutators/deponent.rb +0 -41
- data/lib/latinverb/tense_method_applicator/mutators/impersonal.rb +0 -27
- data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_imperative_mood_future_tense_strategy.rb +0 -29
- data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_imperative_mood_present_tense_strategy.rb +0 -29
- data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_indicative_mood_future_tense_strategy.rb +0 -35
- data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_indicative_mood_futureperfect_tense_strategy.rb +0 -28
- data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_indicative_mood_imperfect_tense_strategy.rb +0 -24
- data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_indicative_mood_pastperfect_tense_strategy.rb +0 -28
- data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_indicative_mood_perfect_tense_strategy.rb +0 -29
- data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_indicative_mood_present_tense_strategy.rb +0 -24
- data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_subjunctive_mood_imperfect_tense_strategy.rb +0 -29
- data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_subjunctive_mood_pastperfect_tense_strategy.rb +0 -30
- data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_subjunctive_mood_perfect_tense_strategy.rb +0 -30
- data/lib/latinverb/tense_method_applicator/mutators/invariant/active_voice_subjunctive_mood_present_tense_strategy.rb +0 -24
- data/lib/latinverb/tense_method_applicator/mutators/invariant/imperatives.rb +0 -53
- data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_indicative_mood_future_tense_strategy.rb +0 -24
- data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_indicative_mood_futureperfect_tense_strategy.rb +0 -27
- data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_indicative_mood_imperfect_tense_strategy.rb +0 -24
- data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_indicative_mood_pastperfect_tense_strategy.rb +0 -27
- data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_indicative_mood_perfect_tense_strategy.rb +0 -27
- data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_indicative_mood_present_tense_strategy.rb +0 -24
- data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_subjunctive_mood_imperfect_tense_strategy.rb +0 -30
- data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_subjunctive_mood_pastperfect_tense_strategy.rb +0 -33
- data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_subjunctive_mood_perfect_tense_strategy.rb +0 -33
- data/lib/latinverb/tense_method_applicator/mutators/invariant/passive_voice_subjunctive_mood_present_tense_strategy.rb +0 -24
- data/lib/latinverb/tense_method_applicator/mutators/invariant/triplicate_and_pluralize_formatters.rb +0 -26
- data/lib/latinverb/tense_method_applicator/mutators/invariant.rb +0 -65
- data/lib/latinverb/tense_method_applicator/mutators/irregular/infinitives_builder.rb +0 -35
- data/lib/latinverb/tense_method_applicator/mutators/irregular/json_deserializer.rb +0 -52
- data/lib/latinverb/tense_method_applicator/mutators/irregular/json_revivifier.rb +0 -48
- data/lib/latinverb/tense_method_applicator/mutators/irregular/participles_builder.rb +0 -35
- data/lib/latinverb/tense_method_applicator/mutators/irregular/present_only_irregular_mask.rb +0 -37
- data/lib/latinverb/tense_method_applicator/mutators/irregular.rb +0 -25
- data/lib/latinverb/tense_method_applicator/mutators/regular.rb +0 -17
- data/lib/latinverb/tense_method_applicator/mutators/semideponent.rb +0 -88
- data/lib/latinverb/tense_method_applicator/perfect_tense_remover.rb +0 -26
- data/lib/latinverb/tense_method_applicator/second_builder.rb +0 -105
- data/lib/latinverb/tense_method_applicator/tense_methods_vectorizer.rb +0 -73
- data/lib/latinverb/tense_method_applicator/third_builder.rb +0 -93
- data/lib/latinverb/tense_method_applicator/thirdio_builder.rb +0 -100
- data/lib/latinverb/tense_method_applicator.rb +0 -55
- data/test/integration/latin_verb_test.rb +0 -166
- data/test/unit/latinverb_accessible_reader_test.rb +0 -18
- data/test/unit/principal_parts_extractor_test.rb +0 -33
@@ -1,42 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Deponent
|
7
|
-
class InfinitiveMutator
|
8
|
-
def initialize(verb, proxyVerb)
|
9
|
-
@verb = verb
|
10
|
-
@proxyVerb = proxyVerb
|
11
|
-
mutate!
|
12
|
-
end
|
13
|
-
|
14
|
-
def mutate!
|
15
|
-
proxyVerb = @proxyVerb
|
16
|
-
@verb.instance_eval do
|
17
|
-
@proxyVerb = proxyVerb
|
18
|
-
|
19
|
-
def present_active_infinitive
|
20
|
-
return @proxyVerb.send :present_passive_infinitive
|
21
|
-
end
|
22
|
-
|
23
|
-
def perfect_active_infinitive
|
24
|
-
return @proxyVerb.send :perfect_passive_infinitive
|
25
|
-
end
|
26
|
-
|
27
|
-
def future_active_infinitive
|
28
|
-
return @proxyVerb.send :future_active_infinitive
|
29
|
-
end
|
30
|
-
|
31
|
-
def present_passive_infinitive
|
32
|
-
return NullTenseBlock.new
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Deponent
|
7
|
-
class ParticipleMutator
|
8
|
-
def initialize(verb, proxyVerb)
|
9
|
-
@verb = verb
|
10
|
-
@proxyVerb = proxyVerb
|
11
|
-
mutate!
|
12
|
-
end
|
13
|
-
|
14
|
-
def mutate!
|
15
|
-
proxyVerb = @proxyVerb
|
16
|
-
@verb.instance_eval do
|
17
|
-
@proxyVerb = proxyVerb
|
18
|
-
|
19
|
-
def present_active_participle
|
20
|
-
return @proxyVerb.present_active_participle
|
21
|
-
end
|
22
|
-
|
23
|
-
def future_active_participle
|
24
|
-
return @proxyVerb.future_active_participle
|
25
|
-
end
|
26
|
-
|
27
|
-
def perfect_active_participle
|
28
|
-
return @proxyVerb.perfect_passive_participle
|
29
|
-
end
|
30
|
-
|
31
|
-
def future_passive_participle
|
32
|
-
return @proxyVerb.future_passive_participle
|
33
|
-
end
|
34
|
-
|
35
|
-
# Mask the supine
|
36
|
-
def supine
|
37
|
-
return @proxyVerb.supine
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Deponent
|
7
|
-
class TenseBlockMutator
|
8
|
-
def initialize(verb, proxyVerb)
|
9
|
-
@verb = verb
|
10
|
-
@proxyVerb = proxyVerb
|
11
|
-
|
12
|
-
mutate!
|
13
|
-
end
|
14
|
-
|
15
|
-
##
|
16
|
-
#
|
17
|
-
# Swaps this verb's active_ vectors and replaces them with
|
18
|
-
# @proxyVerb's passive_ vectors. This is pretty darned sneaky. See
|
19
|
-
# Also deponent_swap
|
20
|
-
#
|
21
|
-
##
|
22
|
-
def mutate!
|
23
|
-
# First, get the methods that were defined in the proxy as passive
|
24
|
-
|
25
|
-
storage = {}
|
26
|
-
|
27
|
-
@proxyVerb.methods.grep(/\Apassive.+tense\z/).each do |pass|
|
28
|
-
# Find the active correlate
|
29
|
-
active_corr = pass.to_s.sub( /^passive(.*)/, "active\\1" )
|
30
|
-
|
31
|
-
# Keep @proxyVerb in the binding scope
|
32
|
-
pV = @proxyVerb
|
33
|
-
|
34
|
-
# In verb, find the passive and save its resultant object into a
|
35
|
-
# hash for future use.
|
36
|
-
@verb.instance_eval do
|
37
|
-
storage[active_corr.to_sym] = pV.send(pass)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
# Take the stored hashes and define instance methods on verb such
|
42
|
-
# that we intercept the mixed-in methods ( C-c-c-combo breaker! ).
|
43
|
-
storage.each_pair do |k,v|
|
44
|
-
@verb.singleton_class.class_eval do
|
45
|
-
define_method k, Proc.new { return v }
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
require_relative './deponent/tense_block_mutator'
|
2
|
-
require_relative './deponent/imperative_mutator'
|
3
|
-
require_relative './deponent/participle_mutator'
|
4
|
-
require_relative './deponent/infinitive_mutator'
|
5
|
-
|
6
|
-
module Linguistics
|
7
|
-
module Latin
|
8
|
-
module Verb
|
9
|
-
class LatinVerb
|
10
|
-
module Mutators
|
11
|
-
class Deponent
|
12
|
-
# In a bit of cleverness, if the verb is deponent, we have built out
|
13
|
-
# this verb as if it were regular, but we have also created a
|
14
|
-
# @proxyVerb which is the active 'pseudo verb' corresponding to this
|
15
|
-
# verb. We should be able to take this verb's active formulations
|
16
|
-
# and set their results to the @proxyVerb's passive formulations
|
17
|
-
#
|
18
|
-
# Ergo: miror/mirari/miratus =~
|
19
|
-
# miro/mirare/PreventDeponentInfiniteRegress/miratus Therefore make a
|
20
|
-
# LatinVerb.new(miro/mirare/PreventDeponentInfiniteRegress/miratus).
|
21
|
-
# Take its passives and set them to this verb's actives. This is
|
22
|
-
# actually what students do heuristically in Latin classes.
|
23
|
-
|
24
|
-
include Linguistics::Latin::Phonographia
|
25
|
-
|
26
|
-
def initialize(verb, opts={})
|
27
|
-
@verb = verb
|
28
|
-
@proxyVerb = LatinVerb.new(DeponentStringDeriver.new(@verb.original_string).proxy_string)
|
29
|
-
@mutators_classes = opts[:mutator_classes] ||
|
30
|
-
[ TenseBlockMutator, ImperativeMutator, ParticipleMutator, InfinitiveMutator ]
|
31
|
-
end
|
32
|
-
|
33
|
-
def mutate!
|
34
|
-
@mutators_classes.each{ |m| m.new(@verb, @proxyVerb) }
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Impersonal
|
7
|
-
def initialize(verb)
|
8
|
-
@verb = verb
|
9
|
-
end
|
10
|
-
|
11
|
-
def mutate!
|
12
|
-
@verb.instance_eval do
|
13
|
-
def active_voice_indicative_mood_present_tense
|
14
|
-
TenseBlock.new ["", "", @original_string, "", "", ""]
|
15
|
-
end
|
16
|
-
|
17
|
-
def active_voice_indicative_mood_present_tense_third_person_singular_number
|
18
|
-
return active_voice_indicative_mood_present_tense[2]
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Invariant
|
7
|
-
class ActiveVoiceImperativeMoodFutureTenseStrategy
|
8
|
-
def initialize(verb)
|
9
|
-
@verb = verb
|
10
|
-
end
|
11
|
-
|
12
|
-
def apply!
|
13
|
-
@verb.instance_eval do
|
14
|
-
def active_voice_imperative_mood_future_tense
|
15
|
-
f = imperatives.future
|
16
|
-
return TenseBlock.new(
|
17
|
-
[ '', f[0], f[2], '', f[1], f[3] ],
|
18
|
-
{ :meaning => MEANINGS[:active_voice_imperative_mood_future_tense] }
|
19
|
-
)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Invariant
|
7
|
-
# Commands for immediate action. Always second person.
|
8
|
-
class ActiveVoiceImperativeMoodPresentTenseStrategy
|
9
|
-
def initialize(verb)
|
10
|
-
@verb = verb
|
11
|
-
end
|
12
|
-
|
13
|
-
def apply!
|
14
|
-
@verb.instance_eval do
|
15
|
-
def active_voice_imperative_mood_present_tense
|
16
|
-
imp = imperatives
|
17
|
-
elements = [ '', imp.present_tense_singular_number, '', '', imp.present_tense_plural_number, '' ]
|
18
|
-
meaning = { :meaning => MEANINGS[:active_voice_imperative_mood_present_tense] }
|
19
|
-
TenseBlock.new(elements, meaning)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Invariant
|
7
|
-
##
|
8
|
-
#
|
9
|
-
# === GRAMMATICAL FUNCTION
|
10
|
-
#
|
11
|
-
# Action completed in the future.
|
12
|
-
# A&G,160,b,3.
|
13
|
-
#
|
14
|
-
###
|
15
|
-
class ActiveVoiceIndicativeMoodFutureTenseStrategy
|
16
|
-
def initialize(verb)
|
17
|
-
@verb = verb
|
18
|
-
end
|
19
|
-
|
20
|
-
def apply!
|
21
|
-
@verb.instance_eval do
|
22
|
-
def active_voice_indicative_mood_futureperfect_tense
|
23
|
-
substem = first_person_perfect[0..-2]
|
24
|
-
return TenseBlock.new [APERF_FUTURE_ENDINGS.collect{|x| substem + x}].flatten,
|
25
|
-
{ :meaning => MEANINGS[:active_voice_indicative_mood_futureperfect_tense] }
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Invariant
|
7
|
-
class ActiveVoiceIndicativeMoodFutureperfectTenseStrategy
|
8
|
-
def initialize(verb)
|
9
|
-
@verb = verb
|
10
|
-
end
|
11
|
-
|
12
|
-
def apply!
|
13
|
-
@verb.instance_eval do
|
14
|
-
def active_voice_indicative_mood_futureperfect_tense
|
15
|
-
substem = first_person_perfect[0..-2]
|
16
|
-
elements = APERF_FUTURE_ENDINGS.flat_map{|x| substem + x}
|
17
|
-
meaning = { :meaning => MEANINGS[:active_voice_indicative_mood_futureperfect_tense] }
|
18
|
-
TenseBlock.new(elements, meaning)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Invariant
|
7
|
-
class ActiveVoiceIndicativeMoodImperfectTenseStrategy
|
8
|
-
def initialize(verb)
|
9
|
-
@verb = verb
|
10
|
-
end
|
11
|
-
|
12
|
-
def apply!
|
13
|
-
@verb.instance_eval do
|
14
|
-
def active_voice_indicative_mood_imperfect_tense
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Invariant
|
7
|
-
class ActiveVoiceIndicativeMoodPastperfectTenseStrategy
|
8
|
-
def initialize(verb)
|
9
|
-
@verb = verb
|
10
|
-
end
|
11
|
-
|
12
|
-
def apply!
|
13
|
-
@verb.instance_eval do
|
14
|
-
def active_voice_indicative_mood_pastperfect_tense
|
15
|
-
substem = first_person_perfect[0..-2]
|
16
|
-
elements = APERF_PAST_ENDINGS.flat_map{|x| substem + x}
|
17
|
-
meaning = { :meaning => MEANINGS[:active_voice_indicative_mood_pastperfect_tense] }
|
18
|
-
return TenseBlock.new(elements, meaning)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Invariant
|
7
|
-
class ActiveVoiceIndicativeMoodPerfectTenseStrategy
|
8
|
-
def initialize(verb)
|
9
|
-
@verb = verb
|
10
|
-
end
|
11
|
-
|
12
|
-
def apply!
|
13
|
-
@verb.instance_eval do
|
14
|
-
def active_voice_indicative_mood_perfect_tense
|
15
|
-
substem = first_person_perfect[0..-2]
|
16
|
-
elements = APERF_ENDINGS.flat_map{|x| substem + x.to_s}
|
17
|
-
elements.unshift first_person_perfect
|
18
|
-
meaning = { :meaning => MEANINGS[:active_voice_indicative_mood_perfect_tense] }
|
19
|
-
return TenseBlock.new(elements, meaning)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Invariant
|
7
|
-
class ActiveVoiceIndicativeMoodPresentTenseStrategy
|
8
|
-
def initialize(verb)
|
9
|
-
@verb = verb
|
10
|
-
end
|
11
|
-
|
12
|
-
def apply!
|
13
|
-
@verb.instance_eval do
|
14
|
-
def active_voice_indicative_mood_present_tense
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Invariant
|
7
|
-
class ActiveVoiceSubjunctiveMoodImperfectTenseStrategy
|
8
|
-
def initialize(verb)
|
9
|
-
@verb = verb
|
10
|
-
end
|
11
|
-
|
12
|
-
def apply!
|
13
|
-
@verb.instance_eval do
|
14
|
-
def active_voice_subjunctive_mood_imperfect_tense
|
15
|
-
elements = [ 'm', *AP_FIRST_AND_SECOND_CONJUG_PERS_ENDINGS ].flat_map do |ending|
|
16
|
-
present_active_infinitive.sub(/e$/,'ē') + ending
|
17
|
-
end
|
18
|
-
meaning = { :meaning => MEANINGS[:active_voice_subjunctive_mood_imperfect_tense] }
|
19
|
-
TenseBlock.new(elements, meaning)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Invariant
|
7
|
-
class ActiveVoiceSubjunctiveMoodPastperfectTenseStrategy
|
8
|
-
def initialize(verb)
|
9
|
-
@verb = verb
|
10
|
-
end
|
11
|
-
|
12
|
-
def apply!
|
13
|
-
@verb.instance_eval do
|
14
|
-
def active_voice_subjunctive_mood_pastperfect_tense
|
15
|
-
asp_base = first_person_perfect[0..first_person_perfect.length-2] + "issē"
|
16
|
-
elements = ['m', *AP_FIRST_AND_SECOND_CONJUG_PERS_ENDINGS].flat_map do |ending|
|
17
|
-
asp_base + ending
|
18
|
-
end
|
19
|
-
meaning = { :meaning => MEANINGS[:active_voice_subjunctive_mood_pastperfect_tense] }
|
20
|
-
TenseBlock.new(elements, meaning)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Invariant
|
7
|
-
class ActiveVoiceSubjunctiveMoodPerfectTenseStrategy
|
8
|
-
def initialize(verb)
|
9
|
-
@verb = verb
|
10
|
-
end
|
11
|
-
|
12
|
-
def apply!
|
13
|
-
@verb.instance_eval do
|
14
|
-
def active_voice_subjunctive_mood_perfect_tense
|
15
|
-
asp_base = first_person_perfect[0..first_person_perfect.length-2] + "erī"
|
16
|
-
elements = ['m', *AP_FIRST_AND_SECOND_CONJUG_PERS_ENDINGS].flat_map do |ending|
|
17
|
-
asp_base + ending
|
18
|
-
end
|
19
|
-
meaning = { :meaning => MEANINGS[:active_voice_subjunctive_mood_perfect_tense] }
|
20
|
-
TenseBlock.new(elements, meaning)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Invariant
|
7
|
-
class ActiveVoiceSubjunctiveMoodPresentTenseStrategy
|
8
|
-
def initialize(verb)
|
9
|
-
@verb = verb
|
10
|
-
end
|
11
|
-
|
12
|
-
def apply!
|
13
|
-
@verb.instance_eval do
|
14
|
-
def active_voice_subjunctive_mood_present_tense
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Invariant
|
7
|
-
##
|
8
|
-
#
|
9
|
-
# === GRAMMATICAL FUNCTION
|
10
|
-
#
|
11
|
-
# Used to express command. As A&G notes, oftentimes the Subjunctive
|
12
|
-
# is the correct mood for exhortation.
|
13
|
-
#
|
14
|
-
###
|
15
|
-
class ImperativesStrategy
|
16
|
-
IMPERATIVE_EXCEPTIONS = {
|
17
|
-
"ducere" => %w(duc ducite),
|
18
|
-
"dicere" => %w(dic dicite),
|
19
|
-
"facere" => %w(fac facite),
|
20
|
-
"ferre" => %w(fer ferte),
|
21
|
-
"nolere" => %w(nolo nolite)
|
22
|
-
}
|
23
|
-
|
24
|
-
def initialize(verb)
|
25
|
-
@verb = verb
|
26
|
-
end
|
27
|
-
|
28
|
-
def apply!
|
29
|
-
args = exceptional_imperative? ? calculate_exceptional_imperatives : [@verb.stem, @verb.present_active_infinitive]
|
30
|
-
@verb.instance_eval do
|
31
|
-
def imperatives
|
32
|
-
Linguistics::Latin::Verb::ImperativeBlock.new(*args, self)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
|
38
|
-
private
|
39
|
-
|
40
|
-
def exceptional_imperative?
|
41
|
-
IMPERATIVE_EXCEPTIONS.has_key?(present_active_infinitive)
|
42
|
-
end
|
43
|
-
|
44
|
-
def calculate_exceptional_imperatives
|
45
|
-
IMPERATIVE_EXCEPTIONS[present_active_infinitive]
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Invariant
|
7
|
-
class PassiveVoiceIndicativeMoodFutureTenseStrategy
|
8
|
-
def initialize(verb)
|
9
|
-
@verb = verb
|
10
|
-
end
|
11
|
-
|
12
|
-
def apply!
|
13
|
-
@verb.instance_eval do
|
14
|
-
def passive_voice_indicative_mood_future_tense
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module Linguistics
|
2
|
-
module Latin
|
3
|
-
module Verb
|
4
|
-
class LatinVerb
|
5
|
-
module Mutators
|
6
|
-
class Invariant
|
7
|
-
class PassiveVoiceIndicativeMoodFutureperfectTenseStrategy
|
8
|
-
def initialize(verb)
|
9
|
-
@verb = verb
|
10
|
-
end
|
11
|
-
|
12
|
-
def apply!
|
13
|
-
@verb.instance_eval do
|
14
|
-
def passive_voice_indicative_mood_futureperfect_tense
|
15
|
-
elements = PASS_PERF_FUTURE_ENDINGS.flat_map{ |helping_verb| "#{passive_perfect_participle} #{helping_verb}" }
|
16
|
-
meaning = { :meaning => MEANINGS[:passive_voice_indicative_mood_futureperfect_tense] }
|
17
|
-
return TenseBlock.new(elements, meaning)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|