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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92a53d723690c9b6f3883faf0005543f116da51c
|
4
|
+
data.tar.gz: d4b9e560243d9c47f273f706904eaac3dd5ffc4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97ecd91fd0c3a6050264ac1f14a1685d79f909a6c36789e00fd5bc417fbe4315366e98d7e981fff7211f1492cc8bf61166cdd0a1dc51ed75d2fc95a463b53fb8
|
7
|
+
data.tar.gz: 54262e1f68513ea204b306736ac5cd2cf6966ad85adf0e4d0ecb6dad2ac2336446dd60cb4414c6858e2ff8e7d46a663df57496058d0f771e36f9b88da74ffd17
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,46 +1,91 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
latinverb (0.9.
|
5
|
-
|
6
|
-
|
4
|
+
latinverb (0.9.5)
|
5
|
+
latinverb_classifier (= 1.0.0.pre.1)
|
6
|
+
latinverb_deponent_string_deriver
|
7
|
+
latinverb_imperative_block
|
8
|
+
latinverb_imperatives
|
9
|
+
latinverb_infinitives
|
10
|
+
latinverb_irregular_imperatives_retriever
|
11
|
+
latinverb_irregular_infinitives_retriever
|
12
|
+
latinverb_irregular_participles_retriever
|
13
|
+
latinverb_irregular_verb_definition_consumer
|
14
|
+
latinverb_participles
|
15
|
+
latinverb_principal_parts_extractor
|
16
|
+
latinverb_querent_for_classification_builder
|
17
|
+
latinverb_stem_deriver
|
18
|
+
latinverb_type_evaluator
|
19
|
+
linguistics_latin (~> 0.0.2)
|
20
|
+
linguistics_latin_tense_block
|
7
21
|
macronconversions
|
22
|
+
multi_json (~> 1.8)
|
8
23
|
rake
|
9
|
-
rdoc
|
10
24
|
|
11
25
|
GEM
|
12
26
|
remote: http://rubygems.org/
|
13
27
|
specs:
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
byebug (2.2.2)
|
23
|
-
columnize (~> 0.3.6)
|
24
|
-
debugger-linecache (~> 1.2.0)
|
25
|
-
columnize (0.3.6)
|
28
|
+
binding_of_caller (0.7.2)
|
29
|
+
debug_inspector (>= 0.0.1)
|
30
|
+
byebug (3.1.2)
|
31
|
+
columnize (~> 0.8)
|
32
|
+
debugger-linecache (~> 1.2)
|
33
|
+
coderay (1.1.0)
|
34
|
+
columnize (0.8.9)
|
35
|
+
debug_inspector (0.0.2)
|
26
36
|
debugger-linecache (1.2.0)
|
27
|
-
|
28
|
-
|
29
|
-
|
37
|
+
interception (0.5)
|
38
|
+
latinverb_classifier (1.0.0.pre.1)
|
39
|
+
linguistics_latin (~> 0.0.2)
|
40
|
+
latinverb_deponent_string_deriver (1.0.0.pre.1)
|
41
|
+
latinverb_imperative_block (0.0.1)
|
42
|
+
linguistics_latin (~> 0.0.2)
|
43
|
+
latinverb_imperatives (0.0.1)
|
44
|
+
latinverb_irregular_infinitives_retriever
|
45
|
+
latinverb_infinitives (0.0.1)
|
46
|
+
latinverb_irregular_imperatives_retriever (0.0.1)
|
47
|
+
latinverb_irregular_infinitives_retriever (0.0.1)
|
48
|
+
latinverb_irregular_verb_definition_consumer
|
49
|
+
linguistics_latin
|
50
|
+
latinverb_irregular_participles_retriever (0.0.1)
|
51
|
+
latinverb_irregular_verb_definition_consumer (0.0.1)
|
52
|
+
linguistics_latin
|
53
|
+
latinverb_participles (0.0.1)
|
54
|
+
latinverb_principal_parts_extractor (0.0.1)
|
55
|
+
latinverb_querent_for_classification_builder (0.0.1)
|
56
|
+
latinverb_irregular_infinitives_retriever
|
57
|
+
linguistics_latin (~> 0.0.2)
|
58
|
+
linguistics_latin_tense_block
|
59
|
+
latinverb_stem_deriver (0.0.1)
|
60
|
+
latinverb_deponent_string_deriver
|
61
|
+
latinverb_type_evaluator (0.0.1)
|
62
|
+
latinverb_deponent_string_deriver
|
63
|
+
linguistics_latin (~> 0.0.2)
|
64
|
+
linguistics_latin (0.0.2)
|
65
|
+
linguistics_latin_tense_block (0.0.1)
|
66
|
+
linguistics_latin
|
30
67
|
macronconversions (0.0.1)
|
31
|
-
|
32
|
-
multi_json (1.
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
68
|
+
method_source (0.8.2)
|
69
|
+
multi_json (1.10.1)
|
70
|
+
pry (0.10.0)
|
71
|
+
coderay (~> 1.1.0)
|
72
|
+
method_source (~> 0.8.1)
|
73
|
+
slop (~> 3.4)
|
74
|
+
pry-rescue (1.4.1)
|
75
|
+
interception (>= 0.5)
|
76
|
+
pry
|
77
|
+
pry-stack_explorer (0.4.9.1)
|
78
|
+
binding_of_caller (>= 0.7)
|
79
|
+
pry (>= 0.9.11)
|
80
|
+
rake (10.3.2)
|
81
|
+
slop (3.5.0)
|
39
82
|
|
40
83
|
PLATFORMS
|
41
84
|
ruby
|
42
85
|
|
43
86
|
DEPENDENCIES
|
44
|
-
autotest-standalone
|
45
87
|
byebug
|
46
88
|
latinverb!
|
89
|
+
pry
|
90
|
+
pry-rescue
|
91
|
+
pry-stack_explorer
|
data/Rakefile
CHANGED
@@ -1,18 +1,12 @@
|
|
1
1
|
require 'bundler'
|
2
|
-
require 'rdoc/task'
|
3
2
|
require 'rake/testtask'
|
4
3
|
|
5
4
|
Bundler::GemHelper.install_tasks
|
6
5
|
|
7
6
|
task :default => :test
|
8
7
|
|
9
|
-
RDoc::Task.new do | rd |
|
10
|
-
rd.rdoc_dir = "rdoc"
|
11
|
-
rd.rdoc_files.include("lib/**/*.rb")
|
12
|
-
end
|
13
|
-
|
14
8
|
Rake::TestTask.new do |t|
|
15
|
-
t.ruby_opts = [ '-rminitest/pride' ]
|
9
|
+
t.ruby_opts = [ '-rminitest/autorun', '-rminitest/pride', '-rbyebug', '-rlatinverb', '-rjson']
|
16
10
|
t.test_files = FileList['test/**/*test*.rb']
|
17
11
|
t.verbose = true
|
18
12
|
end
|
data/latinverb.gemspec
CHANGED
@@ -10,7 +10,8 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.email = ["steven.harms@gmail.com"]
|
11
11
|
s.homepage = "http://rubygems.org/gems/latinverb"
|
12
12
|
s.summary = %q{Gem designed to fully conjugate Latin verbs}
|
13
|
-
s.description = %q{This gem takes the four principal parts of a standard Latin verb and then fully conjugates that verb based on the
|
13
|
+
s.description = %q{This gem takes the four principal parts of a standard Latin verb and then fully conjugates that verb based on the heuristics of the Latin language.}
|
14
|
+
s.licenses = ["MIT"]
|
14
15
|
|
15
16
|
|
16
17
|
s.rubyforge_project = "latinverb"
|
@@ -20,9 +21,27 @@ Gem::Specification.new do |s|
|
|
20
21
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
21
22
|
s.require_paths = ["lib"]
|
22
23
|
|
24
|
+
# Latinverb requirements
|
23
25
|
s.add_runtime_dependency("macronconversions")
|
24
|
-
s.add_runtime_dependency("linguistics_latin")
|
25
|
-
s.add_runtime_dependency("
|
26
|
+
s.add_runtime_dependency("linguistics_latin", "~>0.0.2")
|
27
|
+
s.add_runtime_dependency("linguistics_latin_tense_block")
|
28
|
+
s.add_runtime_dependency("latinverb_imperative_block")
|
29
|
+
s.add_runtime_dependency("latinverb_classifier", "1.0.0.pre.1")
|
30
|
+
s.add_runtime_dependency("latinverb_principal_parts_extractor")
|
31
|
+
s.add_runtime_dependency("latinverb_deponent_string_deriver")
|
32
|
+
s.add_runtime_dependency("latinverb_stem_deriver")
|
33
|
+
s.add_runtime_dependency("latinverb_type_evaluator")
|
34
|
+
s.add_runtime_dependency("latinverb_querent_for_classification_builder")
|
35
|
+
s.add_runtime_dependency("latinverb_irregular_verb_definition_consumer")
|
36
|
+
s.add_runtime_dependency("latinverb_irregular_imperatives_retriever")
|
37
|
+
s.add_runtime_dependency("latinverb_irregular_infinitives_retriever")
|
38
|
+
s.add_runtime_dependency("latinverb_irregular_participles_retriever")
|
39
|
+
s.add_runtime_dependency("latinverb_imperatives")
|
40
|
+
s.add_runtime_dependency("latinverb_infinitives")
|
41
|
+
s.add_runtime_dependency("latinverb_participles")
|
42
|
+
s.add_runtime_dependency("latinverb_serialization")
|
43
|
+
|
44
|
+
# Environmental requirements
|
26
45
|
s.add_runtime_dependency("rake")
|
27
|
-
s.add_runtime_dependency("
|
46
|
+
s.add_runtime_dependency("multi_json", "~>1.8")
|
28
47
|
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
module Linguistics
|
2
|
+
module Latin
|
3
|
+
module Verb
|
4
|
+
class LatinVerb
|
5
|
+
extend Forwardable
|
6
|
+
|
7
|
+
attr_reader :original_string, :querent, :options
|
8
|
+
|
9
|
+
def initialize(data, options = {})
|
10
|
+
@options = options
|
11
|
+
@original_string = (data['original_string'] || data)
|
12
|
+
@prin_parts_extractor = PrincipalPartsExtractor.new(@original_string)
|
13
|
+
@classifier = Classifier.new(self)
|
14
|
+
@stem_deriver = StemDeriver.new(self)
|
15
|
+
@type_evaluator = TypeEvaluator.new(self)
|
16
|
+
@validator = Validator.new(self)
|
17
|
+
@querent = QuerentForClassificationBuilder.new(self).querent
|
18
|
+
@infinitivizer = InfinitivesFactory.new(self).infinitives
|
19
|
+
@imperative_handler = ImperativesFactory.new(self).imperatives
|
20
|
+
@participler = ParticiplesFactory.new(self).participles
|
21
|
+
|
22
|
+
delegate_verb_method_calls_to_delegate!
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def delegate_verb_method_calls_to_delegate!
|
28
|
+
self.extend Forwardable
|
29
|
+
@querent.defined_tense_methods.each do |sym|
|
30
|
+
self.def_delegator "@querent", sym
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
public
|
35
|
+
|
36
|
+
def_delegators :@validator, :valid?
|
37
|
+
def_delegators :@classifier, :classification, :irregular?,
|
38
|
+
:present_only?, :regular?, :set_as_defective, :short_class,
|
39
|
+
:deponent?, :semideponent?, :proxy_verb?
|
40
|
+
def_delegators :@prin_parts_extractor, :first_person_perfect,
|
41
|
+
:first_person_perfect, :first_person_singular,
|
42
|
+
:passive_perfect_participle, :present_active_infinitive,
|
43
|
+
:present_active_infinitive, :principal_parts
|
44
|
+
def_delegators :@participler, :supine, :future_active_participle,
|
45
|
+
:future_passive_participle, :gerund, :gerundive,
|
46
|
+
:perfect_passive_participle, :present_active_participle,
|
47
|
+
:perfect_active_participle, :participle_methods
|
48
|
+
def_delegators :@infinitivizer, :future_active_infinitive,
|
49
|
+
:future_passive_infinitive, :infinitives,
|
50
|
+
:perfect_active_infinitive, :perfect_passive_infinitive,
|
51
|
+
:present_passive_infinitive, :infinitive_methods
|
52
|
+
def_delegators :@stem_deriver, :stem, :participial_stem
|
53
|
+
def_delegators :@type_evaluator, :short_type
|
54
|
+
def_delegator :@imperative_handler, :imperatives
|
55
|
+
|
56
|
+
def_delegator :@classifier, :to_s, :conjugation
|
57
|
+
def_delegator :@classifier, :dup, :classified_as
|
58
|
+
def_delegator :@type_evaluator, :type, :verb_type
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Linguistics
|
2
|
+
module Latin
|
3
|
+
module Verb
|
4
|
+
class LatinVerb
|
5
|
+
module QuerentMutators
|
6
|
+
class Deponent
|
7
|
+
class InfinitiveMutator
|
8
|
+
def initialize(verb, querent, proxyVerb)
|
9
|
+
@verb = verb
|
10
|
+
@proxyVerb = proxyVerb
|
11
|
+
@querent = querent
|
12
|
+
|
13
|
+
mutate!
|
14
|
+
end
|
15
|
+
|
16
|
+
def mutate!
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Linguistics
|
2
|
+
module Latin
|
3
|
+
module Verb
|
4
|
+
class LatinVerb
|
5
|
+
module QuerentMutators
|
6
|
+
class Deponent
|
7
|
+
class ParticipleMutator
|
8
|
+
def initialize(verb, querent, proxyVerb)
|
9
|
+
@verb = verb
|
10
|
+
@proxyVerb = proxyVerb
|
11
|
+
@querent = querent
|
12
|
+
|
13
|
+
mutate!
|
14
|
+
end
|
15
|
+
|
16
|
+
def mutate!
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -2,8 +2,11 @@ module Linguistics
|
|
2
2
|
module Latin
|
3
3
|
module Verb
|
4
4
|
class LatinVerb
|
5
|
-
module
|
6
|
-
class
|
5
|
+
module QuerentMutators
|
6
|
+
class Impersonal
|
7
|
+
extend Forwardable
|
8
|
+
def_delegators :@verb, :original_string, :querent
|
9
|
+
|
7
10
|
def initialize(verb)
|
8
11
|
@verb = verb
|
9
12
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Linguistics
|
2
|
+
module Latin
|
3
|
+
module Verb
|
4
|
+
class LatinVerb
|
5
|
+
module QuerentMutators
|
6
|
+
class Semideponent
|
7
|
+
extend Forwardable
|
8
|
+
def_delegators :@verb, :original_string
|
9
|
+
|
10
|
+
def initialize(verb, querent, opts={})
|
11
|
+
@verb = verb
|
12
|
+
@querent = querent
|
13
|
+
@proxyVerb = LatinVerb.new(DeponentStringDeriver.new(original_string).proxy_string, :proxy_verb => true)
|
14
|
+
end
|
15
|
+
def mutate!;end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -1,6 +1,3 @@
|
|
1
|
-
require_relative './tense_block/vector_resolution_delegate'
|
2
|
-
require_relative './tense_block/null_tense_block'
|
3
|
-
|
4
1
|
module Linguistics
|
5
2
|
module Latin
|
6
3
|
module Verb
|
@@ -8,15 +5,19 @@ module Linguistics
|
|
8
5
|
include Linguistics::Latin::Phonographia
|
9
6
|
|
10
7
|
extend Forwardable
|
11
|
-
|
12
|
-
def_delegators :@
|
13
|
-
|
14
|
-
:
|
8
|
+
|
9
|
+
def_delegators :@results, :[], :empty?, :length, :to_a, :each
|
10
|
+
def_delegators :@resolver,
|
11
|
+
:first_person_singular_number, :singular_number_first_person,
|
12
|
+
:second_person_singular_number, :singular_number_second_person,
|
15
13
|
:third_person_singular_number, :singular_number_third_person,
|
14
|
+
|
16
15
|
:first_person_plural_number, :plural_number_first_person,
|
17
16
|
:second_person_plural_number, :plural_number_second_person,
|
18
17
|
:third_person_plural_number, :plural_number_third_person,
|
18
|
+
|
19
19
|
:first_person, :second_person, :third_person,
|
20
|
+
|
20
21
|
:singular_number, :plural_number
|
21
22
|
|
22
23
|
attr_reader :meaning, :results
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Linguistics
|
2
|
+
module Latin
|
3
|
+
module Verb
|
4
|
+
class LatinVerb
|
5
|
+
TENSE_BLOCK_NAMES = [
|
6
|
+
:active_voice_imperative_mood_future_tense,
|
7
|
+
:active_voice_imperative_mood_present_tense,
|
8
|
+
:active_voice_indicative_mood_future_tense,
|
9
|
+
:active_voice_indicative_mood_futureperfect_tense,
|
10
|
+
:active_voice_indicative_mood_imperfect_tense,
|
11
|
+
:active_voice_indicative_mood_pastperfect_tense,
|
12
|
+
:active_voice_indicative_mood_perfect_tense,
|
13
|
+
:active_voice_indicative_mood_present_tense,
|
14
|
+
:active_voice_subjunctive_mood_imperfect_tense,
|
15
|
+
:active_voice_subjunctive_mood_pastperfect_tense,
|
16
|
+
:active_voice_subjunctive_mood_perfect_tense,
|
17
|
+
:active_voice_subjunctive_mood_present_tense,
|
18
|
+
:passive_voice_indicative_mood_future_tense,
|
19
|
+
:passive_voice_indicative_mood_futureperfect_tense,
|
20
|
+
:passive_voice_indicative_mood_imperfect_tense,
|
21
|
+
:passive_voice_indicative_mood_pastperfect_tense,
|
22
|
+
:passive_voice_indicative_mood_perfect_tense,
|
23
|
+
:passive_voice_indicative_mood_present_tense,
|
24
|
+
:passive_voice_subjunctive_mood_imperfect_tense,
|
25
|
+
:passive_voice_subjunctive_mood_pastperfect_tense,
|
26
|
+
:passive_voice_subjunctive_mood_perfect_tense,
|
27
|
+
:passive_voice_subjunctive_mood_present_tense
|
28
|
+
]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/latinverb/version.rb
CHANGED
data/lib/latinverb.rb
CHANGED
@@ -1,85 +1,29 @@
|
|
1
|
-
require 'active_support'
|
2
1
|
require 'forwardable'
|
3
2
|
|
3
|
+
# Linguistic basics
|
4
4
|
require 'linguistics_latin'
|
5
|
+
require 'linguistics_latin_tense_block'
|
6
|
+
|
7
|
+
# LatinVerb-assisting gems
|
8
|
+
require 'latinverb_classifier'
|
9
|
+
require 'latinverb_principal_parts_extractor'
|
10
|
+
require 'latinverb_stem_deriver'
|
11
|
+
require 'latinverb_imperative_block'
|
12
|
+
require 'latinverb_type_evaluator'
|
13
|
+
require 'latinverb_querent_for_classification_builder'
|
14
|
+
require 'latinverb_irregular_infinitives_retriever'
|
15
|
+
require 'latinverb_irregular_imperatives_retriever'
|
16
|
+
require 'latinverb_irregular_participles_retriever'
|
17
|
+
require 'latinverb_imperatives'
|
18
|
+
require 'latinverb_infinitives'
|
19
|
+
require 'latinverb_participles'
|
20
|
+
require 'latinverb_serialization'
|
5
21
|
|
6
|
-
require 'latinverb/errors'
|
7
|
-
require 'latinverb/components'
|
8
|
-
require 'latinverb/tense_block'
|
9
|
-
require 'latinverb/imperative_block'
|
10
|
-
require 'latinverb/serialization'
|
11
22
|
require 'latinverb/version'
|
12
|
-
require 'latinverb/
|
13
|
-
require 'latinverb/
|
23
|
+
require 'latinverb/validator'
|
24
|
+
require 'latinverb/tense_block_names'
|
14
25
|
|
15
|
-
|
16
|
-
module Latin
|
17
|
-
module Verb
|
18
|
-
class LatinVerb
|
19
|
-
extend Forwardable
|
20
|
-
|
21
|
-
def_delegators :@validator, :valid?
|
22
|
-
def_delegators :@classifier, :classification, :irregular?, :present_only?, :regular?, :set_as_defective, :short_class
|
23
|
-
def_delegators :@prin_parts_extractor, :first_person_perfect, :first_person_perfect, :first_person_singular, :passive_perfect_participle, :present_active_infinitive, :present_active_infinitive, :principal_parts
|
24
|
-
def_delegators :@participler, :supine, :future_active_participle, :future_passive_participle, :gerund, :gerundive, :perfect_passive_participle, :present_active_participle
|
25
|
-
def_delegators :@infinitivizer, :future_active_infinitive, :future_passive_infinitive, :infinitives, :perfect_active_infinitive, :perfect_passive_infinitive, :present_passive_infinitive
|
26
|
-
def_delegators :@stem_deriver, :stem, :participial_stem
|
27
|
-
def_delegators :@chart_presenter, :chart, :c
|
28
|
-
def_delegator :@imperative_handler, :imperatives
|
29
|
-
|
30
|
-
def_delegator :@classifier, :to_s, :conjugation
|
31
|
-
def_delegator :@classifier, :dup, :classified_as
|
32
|
-
def_delegator :@classifier, :dup, :classified_as
|
33
|
-
def_delegator :@type_evaluator, :type, :verb_type
|
34
|
-
|
35
|
-
attr_reader :original_string, :verb_methods, :classifier
|
36
|
-
|
37
|
-
def initialize(data)
|
38
|
-
classify(data)
|
39
|
-
build_validator
|
40
|
-
apply_parts_of_speech!
|
41
|
-
apply_tenses!
|
42
|
-
apply_chart_capabilities!
|
43
|
-
end
|
44
|
-
|
45
|
-
def to_s
|
46
|
-
sprintf("%s [%s]", short_class, original_string)
|
47
|
-
end
|
48
|
-
|
49
|
-
def display
|
50
|
-
pretty_generate
|
51
|
-
end
|
52
|
-
|
53
|
-
private
|
54
|
-
|
55
|
-
def classify(data)
|
56
|
-
@original_string = (data['original_string'] || data)
|
57
|
-
@classifier = LatinVerbClassifier.new(@original_string)
|
58
|
-
@prin_parts_extractor = LatinVerbPrincipalPartsExtractor.new(@original_string, @classifier)
|
59
|
-
end
|
60
|
-
|
61
|
-
def build_validator
|
62
|
-
@validator = Validator.new(self)
|
63
|
-
end
|
64
|
-
|
65
|
-
def apply_parts_of_speech!
|
66
|
-
@stem_deriver = LatinverbStemDeriver.new(self)
|
67
|
-
@type_evaluator = LatinVerbTypeEvaluator.new(self)
|
68
|
-
@participler = Participler.new(self)
|
69
|
-
@infinitivizer = Infinitivizer.new(self)
|
70
|
-
@imperative_handler = ImperativesHandler.new(self)
|
71
|
-
end
|
72
|
-
|
73
|
-
def apply_chart_capabilities!
|
74
|
-
@chart_presenter = ChartPresenter.new(self)
|
75
|
-
end
|
76
|
-
|
77
|
-
def apply_tenses!
|
78
|
-
TenseMethodApplicator.new(self)
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
26
|
+
require 'latinverb/latinverb'
|
84
27
|
|
28
|
+
# Some handy constants for paradigmatic verbs
|
85
29
|
require 'latinverb/paradigmatic_verbs'
|
@@ -1,12 +1,6 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
6
|
-
require 'latinverb'
|
7
|
-
|
8
|
-
|
9
|
-
class TestAmbiguousLookups < MiniTest::Unit::TestCase # :nodoc:
|
3
|
+
class AmbiguousLookupsTest < Minitest::Test # :nodoc:
|
10
4
|
def setup
|
11
5
|
@aFourth = Linguistics::Latin::Verb::LatinVerb.new 'audiō audīre audīvī auditum'
|
12
6
|
end
|
@@ -1,12 +1,6 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
6
|
-
require 'latinverb'
|
7
|
-
|
8
|
-
|
9
|
-
class TestLatinVerbSecondConj < MiniTest::Unit::TestCase # :nodoc:
|
3
|
+
class LatinVerbSecondConjTest < Minitest::Test # :nodoc:
|
10
4
|
def setup
|
11
5
|
@aSecond = Linguistics::Latin::Verb::LatinVerb.new 'moneō monēre monuī monitum'
|
12
6
|
end
|
@@ -1,13 +1,6 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
6
|
-
require 'latinverb'
|
7
|
-
|
8
|
-
# Internal dependencies
|
9
|
-
|
10
|
-
class TestDataStructures < MiniTest::Unit::TestCase # :nodoc:
|
3
|
+
class DataStructuresTest < Minitest::Test # :nodoc:
|
11
4
|
def setup
|
12
5
|
@aFirstDS = Linguistics::Latin::Verb::LatinVerb.new 'amō amāre amāvī amatum'
|
13
6
|
end
|
@@ -27,6 +20,6 @@ class TestDataStructures < MiniTest::Unit::TestCase # :nodoc:
|
|
27
20
|
end
|
28
21
|
|
29
22
|
def test_json
|
30
|
-
|
23
|
+
assert_respond_to(@aFirstDS, :to_json)
|
31
24
|
end
|
32
25
|
end
|
@@ -1,19 +1,13 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
6
|
-
require 'latinverb'
|
7
|
-
|
8
|
-
|
9
|
-
class TestDefectSemiImp < MiniTest::Unit::TestCase # :nodoc:
|
3
|
+
class DefectSemiImpTest < Minitest::Test # :nodoc:
|
10
4
|
def test_semideponents
|
11
5
|
|
12
6
|
assert_equal Linguistics::Latin::Verb::Classification::Semideponent,
|
13
7
|
Linguistics::Latin::Verb::LatinVerb.new("audeō audēre ausus sum").classification
|
14
8
|
|
15
9
|
assert_equal Linguistics::Latin::Verb::Classification::Semideponent,
|
16
|
-
Linguistics::Latin::Verb::LatinVerb.new("gaudeō gaudēre gavisus sum
|
10
|
+
Linguistics::Latin::Verb::LatinVerb.new("gaudeō gaudēre gavisus sum").classification
|
17
11
|
|
18
12
|
assert_equal Linguistics::Latin::Verb::Classification::Semideponent,
|
19
13
|
Linguistics::Latin::Verb::LatinVerb.new("soleō solēre solitus sum").classification
|
@@ -26,8 +20,8 @@ class TestDefectSemiImp < MiniTest::Unit::TestCase # :nodoc:
|
|
26
20
|
Linguistics::Latin::Verb::LatinVerb.new("confidō confidere confīsus sum").classification
|
27
21
|
end
|
28
22
|
|
29
|
-
def test_semideponent_exhaustively
|
30
|
-
f = Linguistics::Latin::Verb::LatinVerb.new
|
23
|
+
def test_semideponent_exhaustively
|
24
|
+
f = Linguistics::Latin::Verb::LatinVerb.new("gaudeō gaudēre gāvīsus")
|
31
25
|
assert_equal Linguistics::Latin::Verb::Classification::Semideponent, f.classification
|
32
26
|
|
33
27
|
assert_equal "gaudeō", f.active_voice_indicative_mood_present_tense_first_person_singular_number
|