latinverb 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -1
- data/Gemfile.lock +24 -0
- data/Guardfile +10 -0
- data/README.markdown +1 -1
- data/Rakefile +12 -9
- data/latinverb.gemspec +4 -0
- data/lib/latinverb/chart.rb +5 -5
- data/lib/latinverb/version.rb +1 -1
- data/lib/latinverb.rb +266 -534
- data/lib/linguistics/latin/verb/classification_types.rb +19 -17
- data/lib/linguistics/latin/verb/constants.rb +14 -14
- data/lib/linguistics/latin/verb/deponent_tense_methods.rb +8 -21
- data/lib/linguistics/latin/verb/imperative_block.rb +118 -0
- data/lib/linguistics/latin/verb/infinitive_block.rb +39 -0
- data/lib/linguistics/latin/verb/infinitives.rb +181 -181
- data/lib/linguistics/latin/verb/irregulars.rb +74 -74
- data/lib/linguistics/latin/verb/latinverb/classmethods.rb +36 -117
- data/lib/linguistics/latin/verb/latinverb/data.rb +12 -15
- data/lib/linguistics/latin/verb/latinverb/defective_checker.rb +17 -0
- data/lib/linguistics/latin/verb/latinverb/deponent.rb +159 -0
- data/lib/linguistics/latin/verb/latinverb/display.rb +1 -2
- data/lib/linguistics/latin/verb/latinverb/impersonal.rb +34 -0
- data/lib/linguistics/latin/verb/latinverb/irregular.rb +83 -0
- data/lib/linguistics/latin/verb/latinverb/latin_verb_type_evaluator.rb +32 -0
- data/lib/linguistics/latin/verb/latinverb/latinverb_classifier.rb +100 -0
- data/lib/linguistics/latin/verb/latinverb/latinverb_input_sanitizer.rb +32 -0
- data/lib/linguistics/latin/verb/latinverb/latinverb_pp_extractor.rb +106 -0
- data/lib/linguistics/latin/verb/latinverb/metaprogramming.rb +30 -29
- data/lib/linguistics/latin/verb/latinverb/semideponent.rb +28 -0
- data/lib/linguistics/latin/verb/latinverb/validation.rb +5 -29
- data/lib/linguistics/latin/verb/latinverb/verbvector_description.rb +50 -0
- data/lib/linguistics/latin/verb/participle_block.rb +36 -0
- data/lib/linguistics/latin/verb/participles.rb +25 -25
- data/lib/linguistics/latin/verb/phonographia.rb +51 -51
- data/lib/linguistics/latin/verb/supine.rb +6 -6
- data/lib/linguistics/latin/verb/tense_block.rb +227 -0
- data/lib/linguistics/latin/verb/tense_definitions/first.rb +92 -0
- data/lib/linguistics/latin/verb/tense_definitions/fourth.rb +92 -0
- data/lib/linguistics/latin/verb/tense_definitions/impersonal.rb +25 -0
- data/lib/linguistics/latin/verb/tense_definitions/invariant.rb +613 -0
- data/lib/linguistics/latin/verb/tense_definitions/irregular.rb +82 -0
- data/lib/linguistics/latin/verb/tense_definitions/second.rb +97 -0
- data/lib/linguistics/latin/verb/tense_definitions/third.rb +86 -0
- data/lib/linguistics/latin/verb/tense_definitions/third_io.rb +91 -0
- data/test/testClusterResolution.rb +0 -1
- data/test/testDataStructures.rb +8 -5
- data/test/testDefectSemiImp.rb +9 -10
- data/test/testDeponentFirstConjugation.rb +2 -2
- data/test/testDeponentFourthConjugation.rb +2 -2
- data/test/testDeponentSecondConjugation.rb +2 -2
- data/test/testDeponentThirdConjugation.rb +2 -2
- data/test/testDeponentThirdIOConjugation.rb +2 -2
- data/test/testDeserializeInfinitives.rb +2 -4
- data/test/testFirstConjugation.rb +53 -53
- data/test/testFourthConjugation.rb +11 -11
- data/test/testFreakishVerbs.rb +12 -11
- data/test/testIrregulars.rb +24 -23
- data/test/testLatinVerb.rb +46 -55
- data/test/testSecondConjugation.rb +27 -27
- data/test/testThirdConjugation.rb +14 -14
- data/test/testThirdIOConjugation.rb +13 -13
- metadata +95 -53
- data/lib/linguistics/latin/verb/latinverb/auxiliary_classes.rb +0 -208
- data/lib/linguistics/latin/verb/tense_methods.rb +0 -950
@@ -63,7 +63,7 @@ class TestLatinVerbThirdIOConj < MiniTest::Unit::TestCase # :nodoc:
|
|
63
63
|
assert_equal("cēperitis", @aThirdIO.active_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s)
|
64
64
|
assert_equal("cēperint", @aThirdIO.active_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s)
|
65
65
|
|
66
|
-
# Passive Present
|
66
|
+
# Passive Present
|
67
67
|
|
68
68
|
assert_equal("capior", @aThirdIO.passive_voice_indicative_mood_present_tense_first_person_singular_number.to_s)
|
69
69
|
assert_equal("caperis", @aThirdIO.passive_voice_indicative_mood_present_tense_second_person_singular_number.to_s)
|
@@ -86,20 +86,20 @@ class TestLatinVerbThirdIOConj < MiniTest::Unit::TestCase # :nodoc:
|
|
86
86
|
assert_equal("capiēminī", @aThirdIO.passive_voice_indicative_mood_future_tense_second_person_plural_number.to_s)
|
87
87
|
assert_equal("capientur", @aThirdIO.passive_voice_indicative_mood_future_tense_third_person_plural_number.to_s)
|
88
88
|
|
89
|
-
# Passive perfect
|
89
|
+
# Passive perfect
|
90
90
|
assert_equal("captum sum", @aThirdIO.passive_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s)
|
91
91
|
assert_equal("captum es", @aThirdIO.passive_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s)
|
92
92
|
assert_equal("captum est", @aThirdIO.passive_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s)
|
93
93
|
assert_equal("captum sumus", @aThirdIO.passive_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s)
|
94
94
|
assert_equal("captum estis", @aThirdIO.passive_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s)
|
95
|
-
assert_equal("captum sunt", @aThirdIO.passive_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s)
|
95
|
+
assert_equal("captum sunt", @aThirdIO.passive_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s)
|
96
96
|
|
97
97
|
assert_equal("captum eram", @aThirdIO.passive_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s)
|
98
98
|
assert_equal("captum erās", @aThirdIO.passive_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s)
|
99
99
|
assert_equal("captum erat", @aThirdIO.passive_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s)
|
100
100
|
assert_equal("captum erāmus", @aThirdIO.passive_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s)
|
101
101
|
assert_equal("captum erātis", @aThirdIO.passive_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s)
|
102
|
-
assert_equal("captum erant", @aThirdIO.passive_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s)
|
102
|
+
assert_equal("captum erant", @aThirdIO.passive_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s)
|
103
103
|
|
104
104
|
assert_equal("captum erō", @aThirdIO.passive_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s)
|
105
105
|
assert_equal("captum eris", @aThirdIO.passive_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s)
|
@@ -108,8 +108,8 @@ class TestLatinVerbThirdIOConj < MiniTest::Unit::TestCase # :nodoc:
|
|
108
108
|
assert_equal("captum eritis", @aThirdIO.passive_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s)
|
109
109
|
assert_equal("captum erint", @aThirdIO.passive_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s)
|
110
110
|
|
111
|
-
### Subjunctives
|
112
|
-
# Active
|
111
|
+
### Subjunctives
|
112
|
+
# Active
|
113
113
|
assert_equal("capiam", @aThirdIO.active_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s)
|
114
114
|
assert_equal("capiās", @aThirdIO.active_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s)
|
115
115
|
assert_equal("capiat", @aThirdIO.active_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s)
|
@@ -138,7 +138,7 @@ class TestLatinVerbThirdIOConj < MiniTest::Unit::TestCase # :nodoc:
|
|
138
138
|
assert_equal("cēpissētis", @aThirdIO.active_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s)
|
139
139
|
assert_equal("cēpissent", @aThirdIO.active_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s)
|
140
140
|
|
141
|
-
#passive
|
141
|
+
#passive
|
142
142
|
assert_equal("capiar", @aThirdIO.passive_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s)
|
143
143
|
assert_equal("capiāris", @aThirdIO.passive_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s)
|
144
144
|
assert_equal("capiātur", @aThirdIO.passive_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s)
|
@@ -166,25 +166,25 @@ class TestLatinVerbThirdIOConj < MiniTest::Unit::TestCase # :nodoc:
|
|
166
166
|
assert_equal("[ captī, captae, capta ] essēmus", @aThirdIO.passive_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s)
|
167
167
|
assert_equal("[ captī, captae, capta ] essētis", @aThirdIO.passive_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s)
|
168
168
|
assert_equal("[ captī, captae, capta ] essent", @aThirdIO.passive_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s)
|
169
|
-
|
169
|
+
|
170
170
|
# Imperatives
|
171
171
|
assert_equal"cape", @aThirdIO.imperatives[0]
|
172
172
|
assert_equal"capite", @aThirdIO.imperatives[1]
|
173
173
|
|
174
174
|
# Participles
|
175
|
-
assert_equal"capiēns, capientis", @aThirdIO.present_active_participle
|
175
|
+
assert_equal"capiēns, capientis", @aThirdIO.present_active_participle
|
176
176
|
assert_equal"captūrus, captūra, captūrum", @aThirdIO.future_active_participle
|
177
177
|
assert_equal"captus, capta, captum", @aThirdIO.perfect_passive_participle
|
178
178
|
assert_equal"capiendus, capienda, capiendum", @aThirdIO.future_passive_participle
|
179
179
|
|
180
|
-
# Infinitves
|
180
|
+
# Infinitves
|
181
181
|
assert_equal "capere", @aThirdIO.present_active_infinitive
|
182
182
|
assert_equal "cēpīsse", @aThirdIO.perfect_active_infinitive
|
183
183
|
assert_equal "captūrus esse", @aThirdIO.future_active_infinitive
|
184
184
|
assert_equal "capī", @aThirdIO.present_passive_infinitive
|
185
|
-
assert_equal "captus, capta, captum esse", @aThirdIO.perfect_passive_infinitive
|
185
|
+
assert_equal "captus, capta, captum esse", @aThirdIO.perfect_passive_infinitive
|
186
186
|
assert_equal "captum īrī", @aThirdIO.future_passive_infinitive
|
187
|
-
|
188
|
-
end
|
187
|
+
|
188
|
+
end
|
189
189
|
|
190
190
|
end
|
metadata
CHANGED
@@ -1,30 +1,76 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: latinverb
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.9.3
|
4
5
|
prerelease:
|
5
|
-
version: 0.9.2
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Steven G. Harms
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
date: 2012-11-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: macronconversions
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: verbvector
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rdoc
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: This gem takes the four principal parts of a standard Latin verb and
|
63
|
+
then fully conjugates that verb based on the heristics of the Latin language.
|
64
|
+
email:
|
18
65
|
- steven.harms@gmail.com
|
19
66
|
executables: []
|
20
|
-
|
21
67
|
extensions: []
|
22
|
-
|
23
68
|
extra_rdoc_files: []
|
24
|
-
|
25
|
-
files:
|
69
|
+
files:
|
26
70
|
- .gitignore
|
27
71
|
- Gemfile
|
72
|
+
- Gemfile.lock
|
73
|
+
- Guardfile
|
28
74
|
- README.markdown
|
29
75
|
- Rakefile
|
30
76
|
- etc/irreg_skel.json
|
@@ -35,18 +81,38 @@ files:
|
|
35
81
|
- lib/linguistics/latin/verb/classification_types.rb
|
36
82
|
- lib/linguistics/latin/verb/constants.rb
|
37
83
|
- lib/linguistics/latin/verb/deponent_tense_methods.rb
|
84
|
+
- lib/linguistics/latin/verb/imperative_block.rb
|
85
|
+
- lib/linguistics/latin/verb/infinitive_block.rb
|
38
86
|
- lib/linguistics/latin/verb/infinitives.rb
|
39
87
|
- lib/linguistics/latin/verb/irregulars.rb
|
40
|
-
- lib/linguistics/latin/verb/latinverb/auxiliary_classes.rb
|
41
88
|
- lib/linguistics/latin/verb/latinverb/classmethods.rb
|
42
89
|
- lib/linguistics/latin/verb/latinverb/data.rb
|
90
|
+
- lib/linguistics/latin/verb/latinverb/defective_checker.rb
|
91
|
+
- lib/linguistics/latin/verb/latinverb/deponent.rb
|
43
92
|
- lib/linguistics/latin/verb/latinverb/display.rb
|
93
|
+
- lib/linguistics/latin/verb/latinverb/impersonal.rb
|
94
|
+
- lib/linguistics/latin/verb/latinverb/irregular.rb
|
95
|
+
- lib/linguistics/latin/verb/latinverb/latin_verb_type_evaluator.rb
|
96
|
+
- lib/linguistics/latin/verb/latinverb/latinverb_classifier.rb
|
97
|
+
- lib/linguistics/latin/verb/latinverb/latinverb_input_sanitizer.rb
|
98
|
+
- lib/linguistics/latin/verb/latinverb/latinverb_pp_extractor.rb
|
44
99
|
- lib/linguistics/latin/verb/latinverb/metaprogramming.rb
|
100
|
+
- lib/linguistics/latin/verb/latinverb/semideponent.rb
|
45
101
|
- lib/linguistics/latin/verb/latinverb/validation.rb
|
102
|
+
- lib/linguistics/latin/verb/latinverb/verbvector_description.rb
|
103
|
+
- lib/linguistics/latin/verb/participle_block.rb
|
46
104
|
- lib/linguistics/latin/verb/participles.rb
|
47
105
|
- lib/linguistics/latin/verb/phonographia.rb
|
48
106
|
- lib/linguistics/latin/verb/supine.rb
|
49
|
-
- lib/linguistics/latin/verb/
|
107
|
+
- lib/linguistics/latin/verb/tense_block.rb
|
108
|
+
- lib/linguistics/latin/verb/tense_definitions/first.rb
|
109
|
+
- lib/linguistics/latin/verb/tense_definitions/fourth.rb
|
110
|
+
- lib/linguistics/latin/verb/tense_definitions/impersonal.rb
|
111
|
+
- lib/linguistics/latin/verb/tense_definitions/invariant.rb
|
112
|
+
- lib/linguistics/latin/verb/tense_definitions/irregular.rb
|
113
|
+
- lib/linguistics/latin/verb/tense_definitions/second.rb
|
114
|
+
- lib/linguistics/latin/verb/tense_definitions/third.rb
|
115
|
+
- lib/linguistics/latin/verb/tense_definitions/third_io.rb
|
50
116
|
- test/testAmbiguousLookups.rb
|
51
117
|
- test/testClusterResolution.rb
|
52
118
|
- test/testDataStructures.rb
|
@@ -70,50 +136,26 @@ files:
|
|
70
136
|
- test/testThirdIOConjugation.rb
|
71
137
|
homepage: http://rubygems.org/gems/latinverb
|
72
138
|
licenses: []
|
73
|
-
|
74
139
|
post_install_message:
|
75
140
|
rdoc_options: []
|
76
|
-
|
77
|
-
require_paths:
|
141
|
+
require_paths:
|
78
142
|
- lib
|
79
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
143
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
144
|
none: false
|
81
|
-
requirements:
|
82
|
-
- -
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
version:
|
85
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
|
+
requirements:
|
146
|
+
- - ! '>='
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: '0'
|
149
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
150
|
none: false
|
87
|
-
requirements:
|
88
|
-
- -
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version:
|
151
|
+
requirements:
|
152
|
+
- - ! '>='
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
91
155
|
requirements: []
|
92
|
-
|
93
156
|
rubyforge_project: latinverb
|
94
|
-
rubygems_version: 1.8.
|
157
|
+
rubygems_version: 1.8.23
|
95
158
|
signing_key:
|
96
159
|
specification_version: 3
|
97
160
|
summary: Gem designed to fully conjugate Latin verbs
|
98
|
-
test_files:
|
99
|
-
- test/testAmbiguousLookups.rb
|
100
|
-
- test/testClusterResolution.rb
|
101
|
-
- test/testDataStructures.rb
|
102
|
-
- test/testDefectSemiImp.rb
|
103
|
-
- test/testDeponentFirstConjugation.rb
|
104
|
-
- test/testDeponentFourthConjugation.rb
|
105
|
-
- test/testDeponentSecondConjugation.rb
|
106
|
-
- test/testDeponentThirdConjugation.rb
|
107
|
-
- test/testDeponentThirdIOConjugation.rb
|
108
|
-
- test/testDeserializeInfinitives.rb
|
109
|
-
- test/testFirstConjugation.rb
|
110
|
-
- test/testFourthConjugation.rb
|
111
|
-
- test/testFreakishVerbs.rb
|
112
|
-
- test/testImperativeBlock.rb
|
113
|
-
- test/testIrregularSum.rb
|
114
|
-
- test/testIrregulars.rb
|
115
|
-
- test/testLatinVerb.rb
|
116
|
-
- test/testMacronRules.rb
|
117
|
-
- test/testSecondConjugation.rb
|
118
|
-
- test/testThirdConjugation.rb
|
119
|
-
- test/testThirdIOConjugation.rb
|
161
|
+
test_files: []
|
@@ -1,208 +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
|
-
|
10
|
-
class ParticipleBlock
|
11
|
-
attr_reader :participle_methods
|
12
|
-
|
13
|
-
|
14
|
-
def initialize(s)
|
15
|
-
raise "ParticipleBlock instantiation argument was nil!" if s.nil?
|
16
|
-
|
17
|
-
if s.class == Hash
|
18
|
-
@participle_methods = s.keys
|
19
|
-
end
|
20
|
-
|
21
|
-
@participle_methods.each do |k|
|
22
|
-
v=s[k]
|
23
|
-
singleton_class.class_eval do
|
24
|
-
define_method k.to_sym do
|
25
|
-
return v
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
##
|
32
|
-
#
|
33
|
-
# Required for deserialization
|
34
|
-
#
|
35
|
-
##
|
36
|
-
def self.json_create(o)
|
37
|
-
new(o['data'])
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
|
42
|
-
#-------------------------------------------------------------------------------
|
43
|
-
#-------------------------------------------------------------------------------
|
44
|
-
##
|
45
|
-
#
|
46
|
-
# The InfinitiveBlock holds the infinitives associated with a given
|
47
|
-
# verb. The known infinitives are the following:
|
48
|
-
#
|
49
|
-
# *
|
50
|
-
class InfinitiveBlock
|
51
|
-
attr_reader :infinitive_methods
|
52
|
-
def initialize(s)
|
53
|
-
if s.class == Hash
|
54
|
-
@infinitive_methods = s.keys
|
55
|
-
end
|
56
|
-
|
57
|
-
@infinitive_methods.each do |k|
|
58
|
-
v=s[k]
|
59
|
-
singleton_class.class_eval do
|
60
|
-
define_method k.to_sym do
|
61
|
-
return v
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
##
|
68
|
-
#
|
69
|
-
# Required for deserialization
|
70
|
-
#
|
71
|
-
##
|
72
|
-
def self.json_create(o)
|
73
|
-
new(o['data'])
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
class ImperativeBlock
|
78
|
-
def initialize(stem,ppi)
|
79
|
-
# In case we get an Array, for JSON revivification
|
80
|
-
if stem.class == Array
|
81
|
-
@results = stem
|
82
|
-
end
|
83
|
-
|
84
|
-
r = case
|
85
|
-
when ppi =~ /āre$/
|
86
|
-
[stem, stem+"te"]
|
87
|
-
when ppi =~ /ēre$/
|
88
|
-
[stem, stem+"te"]
|
89
|
-
when ppi =~ /ere$/
|
90
|
-
[stem+"e", stem+"ite"]
|
91
|
-
when ppi =~ /īre$/
|
92
|
-
[stem+"ī", stem+"īte"]
|
93
|
-
end
|
94
|
-
|
95
|
-
r << stem + "tō"
|
96
|
-
r << stem + "tōte"
|
97
|
-
|
98
|
-
r << stem + "tō"
|
99
|
-
r << stem + "ntō"
|
100
|
-
|
101
|
-
@results = r.map{|v| Linguistics::Latin::Phonographia.fix_macrons v}
|
102
|
-
end
|
103
|
-
|
104
|
-
def to_s
|
105
|
-
return @results
|
106
|
-
end
|
107
|
-
|
108
|
-
##
|
109
|
-
#
|
110
|
-
# Required for serialization
|
111
|
-
#
|
112
|
-
##
|
113
|
-
def to_json(*a)
|
114
|
-
{
|
115
|
-
'json_class' => self.class.name,
|
116
|
-
'data' => @results.map{|i| i.to_json}
|
117
|
-
}.to_json(*a)
|
118
|
-
end
|
119
|
-
|
120
|
-
##
|
121
|
-
#
|
122
|
-
# Required for deserialization
|
123
|
-
#
|
124
|
-
##
|
125
|
-
def self.json_create(o)
|
126
|
-
new(o['data'])
|
127
|
-
end
|
128
|
-
|
129
|
-
##
|
130
|
-
#
|
131
|
-
# Provides Array-like interface to the collection of results.
|
132
|
-
#
|
133
|
-
##
|
134
|
-
def [](arg)
|
135
|
-
@results[arg]
|
136
|
-
end
|
137
|
-
|
138
|
-
##
|
139
|
-
#
|
140
|
-
# To Array, useful in serialization
|
141
|
-
#
|
142
|
-
##
|
143
|
-
def to_a
|
144
|
-
return @results
|
145
|
-
end
|
146
|
-
|
147
|
-
##
|
148
|
-
#
|
149
|
-
# Add array compatibility support
|
150
|
-
#
|
151
|
-
##
|
152
|
-
def length; return @results.length; end
|
153
|
-
|
154
|
-
##
|
155
|
-
#
|
156
|
-
# Returns the two, second person imperatives
|
157
|
-
#
|
158
|
-
##
|
159
|
-
def present(qualifier=nil)
|
160
|
-
j=@results[0,2]
|
161
|
-
return j if qualifier.nil?
|
162
|
-
qualifier = qualifier.to_s
|
163
|
-
return j[0] if qualifier =~ /singular/
|
164
|
-
return j[1] if qualifier =~ /plural/
|
165
|
-
end
|
166
|
-
|
167
|
-
##
|
168
|
-
#
|
169
|
-
# Returns the four, second and third person future imperatives
|
170
|
-
#
|
171
|
-
##
|
172
|
-
def future(qualifier=nil)
|
173
|
-
return j=@results[2,4] if qualifier.nil?
|
174
|
-
|
175
|
-
# case
|
176
|
-
# when qualifier =~ /second_person/
|
177
|
-
# if qualifier =~ /singular/
|
178
|
-
# return j[0]
|
179
|
-
# elsif qualifier =~ /plural/
|
180
|
-
# return j[2]
|
181
|
-
# else
|
182
|
-
# return [ j[0], j[2] ]
|
183
|
-
# end
|
184
|
-
# when qualifier =~ /third_person/
|
185
|
-
# if qualifier =~ /singular/
|
186
|
-
# return j[1]
|
187
|
-
# elsif qualifier =~ /plural/
|
188
|
-
# return j[3]
|
189
|
-
# else
|
190
|
-
# return [ j[1], j[3] ]
|
191
|
-
# end
|
192
|
-
# else
|
193
|
-
# raise "[future] could not parse this imperative"
|
194
|
-
# end
|
195
|
-
# end
|
196
|
-
end
|
197
|
-
|
198
|
-
def method_missing(sym,*args)
|
199
|
-
if (sym =~ /^(present|future)_tense_(.*)/)
|
200
|
-
self.send($1.to_sym, $2)
|
201
|
-
else
|
202
|
-
super
|
203
|
-
end
|
204
|
-
end
|
205
|
-
end
|
206
|
-
end
|
207
|
-
end
|
208
|
-
end
|