llt-form_builder 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +3 -0
- data/.travis.yml +4 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +8 -0
- data/lib/llt/form/adjective.rb +19 -0
- data/lib/llt/form/adverb.rb +13 -0
- data/lib/llt/form/cardinal.rb +31 -0
- data/lib/llt/form/conjunction.rb +7 -0
- data/lib/llt/form/declinable.rb +23 -0
- data/lib/llt/form/demonstrative_pronoun.rb +7 -0
- data/lib/llt/form/ethnic.rb +6 -0
- data/lib/llt/form/fp.rb +6 -0
- data/lib/llt/form/gerund.rb +9 -0
- data/lib/llt/form/gerundive.rb +12 -0
- data/lib/llt/form/indefinite_pronoun.rb +7 -0
- data/lib/llt/form/infinitive.rb +13 -0
- data/lib/llt/form/interrogative_pronoun.rb +7 -0
- data/lib/llt/form/noun.rb +17 -0
- data/lib/llt/form/participle.rb +9 -0
- data/lib/llt/form/personal_pronoun.rb +13 -0
- data/lib/llt/form/ppa.rb +6 -0
- data/lib/llt/form/ppp.rb +6 -0
- data/lib/llt/form/preposition.rb +32 -0
- data/lib/llt/form/pronoun.rb +17 -0
- data/lib/llt/form/relative_pronoun.rb +7 -0
- data/lib/llt/form/subjunction.rb +7 -0
- data/lib/llt/form/supinum.rb +6 -0
- data/lib/llt/form/uninflectable.rb +22 -0
- data/lib/llt/form/verb.rb +28 -0
- data/lib/llt/form/verbal_noun.rb +18 -0
- data/lib/llt/form.rb +80 -0
- data/lib/llt/form_builder/adjective_builder.rb +86 -0
- data/lib/llt/form_builder/adverb_builder.rb +25 -0
- data/lib/llt/form_builder/declinable_builder.rb +164 -0
- data/lib/llt/form_builder/ethnic_builder.rb +17 -0
- data/lib/llt/form_builder/fp_builder.rb +13 -0
- data/lib/llt/form_builder/gerund_builder.rb +37 -0
- data/lib/llt/form_builder/gerundive_builder.rb +24 -0
- data/lib/llt/form_builder/helpers/adjective_like_building.rb +29 -0
- data/lib/llt/form_builder/helpers/pronoun_segments.rb +226 -0
- data/lib/llt/form_builder/helpers/stem_hash_parser.rb +263 -0
- data/lib/llt/form_builder/helpers/verb_segments.rb +562 -0
- data/lib/llt/form_builder/infinitivum_builder.rb +19 -0
- data/lib/llt/form_builder/irregular_gerund_builder.rb +7 -0
- data/lib/llt/form_builder/irregular_gerundive_builder.rb +7 -0
- data/lib/llt/form_builder/irregular_ppa_builder.rb +7 -0
- data/lib/llt/form_builder/irregular_praesens_builder.rb +5 -0
- data/lib/llt/form_builder/irregular_praesens_infinitivum_builder.rb +5 -0
- data/lib/llt/form_builder/noun_builder.rb +24 -0
- data/lib/llt/form_builder/perfectum_builder.rb +14 -0
- data/lib/llt/form_builder/perfectum_infinitivum_builder.rb +7 -0
- data/lib/llt/form_builder/personal_pronoun_builder.rb +107 -0
- data/lib/llt/form_builder/ppa_builder.rb +20 -0
- data/lib/llt/form_builder/ppp_builder.rb +10 -0
- data/lib/llt/form_builder/praesens_builder.rb +41 -0
- data/lib/llt/form_builder/praesens_infinitivum_builder.rb +9 -0
- data/lib/llt/form_builder/pronoun_builder.rb +106 -0
- data/lib/llt/form_builder/supinum_builder.rb +23 -0
- data/lib/llt/form_builder/verb_builder.rb +37 -0
- data/lib/llt/form_builder/version.rb +5 -0
- data/lib/llt/form_builder.rb +370 -0
- data/lib/llt/stem/adjective_pack.rb +122 -0
- data/lib/llt/stem/adjective_stem.rb +23 -0
- data/lib/llt/stem/ethnic_stem.rb +9 -0
- data/lib/llt/stem/noun_pack.rb +14 -0
- data/lib/llt/stem/noun_stem.rb +26 -0
- data/lib/llt/stem/pack.rb +46 -0
- data/lib/llt/stem/verb_pack.rb +53 -0
- data/lib/llt/stem/verb_stem.rb +18 -0
- data/lib/llt/stem.rb +145 -0
- data/lib/llt/stem_builder.rb +53 -0
- data/llt-form_builder.gemspec +30 -0
- data/spec/lib/llt/form/adjective_spec.rb +10 -0
- data/spec/lib/llt/form/adverb_spec.rb +17 -0
- data/spec/lib/llt/form/conjunction_spec.rb +23 -0
- data/spec/lib/llt/form/demonstrative_pronoun_spec.rb +14 -0
- data/spec/lib/llt/form/fp_spec.rb +12 -0
- data/spec/lib/llt/form/functions_spec.rb +13 -0
- data/spec/lib/llt/form/gerund_spec.rb +10 -0
- data/spec/lib/llt/form/gerundive_spec.rb +13 -0
- data/spec/lib/llt/form/noun_spec.rb +18 -0
- data/spec/lib/llt/form/ppa_spec.rb +12 -0
- data/spec/lib/llt/form/ppp_spec.rb +12 -0
- data/spec/lib/llt/form/preposition_spec.rb +43 -0
- data/spec/lib/llt/form/supinum_spec.rb +9 -0
- data/spec/lib/llt/form/verb_spec.rb +14 -0
- data/spec/lib/llt/form_builder/adjective_builder_spec.rb +182 -0
- data/spec/lib/llt/form_builder/adverb_builder_spec.rb +27 -0
- data/spec/lib/llt/form_builder/ethnic_builder_spec.rb +17 -0
- data/spec/lib/llt/form_builder/form_builder_spec.rb +16 -0
- data/spec/lib/llt/form_builder/fp_builder_spec.rb +42 -0
- data/spec/lib/llt/form_builder/gerund_builder_spec.rb +80 -0
- data/spec/lib/llt/form_builder/gerundive_builder_spec.rb +102 -0
- data/spec/lib/llt/form_builder/helpers/stem_hash_parser_spec.rb +197 -0
- data/spec/lib/llt/form_builder/irregular_gerund_builder_spec.rb +22 -0
- data/spec/lib/llt/form_builder/irregular_gerundive_builder_spec.rb +21 -0
- data/spec/lib/llt/form_builder/irregular_praesens_builder_spec.rb +14 -0
- data/spec/lib/llt/form_builder/irregular_praesens_infinitivum_builder_spec.rb +32 -0
- data/spec/lib/llt/form_builder/noun_builder_spec.rb +245 -0
- data/spec/lib/llt/form_builder/personal_pronoun_builder_spec.rb +49 -0
- data/spec/lib/llt/form_builder/ppa_builder_spec.rb +137 -0
- data/spec/lib/llt/form_builder/ppp_builder_spec.rb +45 -0
- data/spec/lib/llt/form_builder/pronoun_builder_spec.rb +203 -0
- data/spec/lib/llt/form_builder/supinum_builder_spec.rb +24 -0
- data/spec/lib/llt/form_builder/verb_builder_spec.rb +557 -0
- data/spec/lib/llt/form_spec.rb +27 -0
- data/spec/lib/llt/stem/adjective_pack_spec.rb +78 -0
- data/spec/lib/llt/stem/adjective_stem_spec.rb +15 -0
- data/spec/lib/llt/stem/noun_pack_spec.rb +20 -0
- data/spec/lib/llt/stem/noun_stem_spec.rb +14 -0
- data/spec/lib/llt/stem/verb_pack_spec.rb +56 -0
- data/spec/lib/llt/stem_builder_spec.rb +20 -0
- data/spec/spec_helper.rb +21 -0
- metadata +330 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
module LLT
|
2
|
+
class AdverbBuilder < AdjectiveBuilder
|
3
|
+
endings_defined_through :inflection_class, :stem, :comparatio
|
4
|
+
validate :ending, :comparison_sign
|
5
|
+
|
6
|
+
def initialize(stem)
|
7
|
+
extract_normalized_args!(stem)
|
8
|
+
@options = stem[:options] || {}
|
9
|
+
@validate = @options.any?
|
10
|
+
downcase_all_stems
|
11
|
+
end
|
12
|
+
|
13
|
+
def compute
|
14
|
+
# endings is not an array in this case, just a plain string
|
15
|
+
new_form(ending: endings)
|
16
|
+
end
|
17
|
+
|
18
|
+
def comparativus_extraction(stem, args)
|
19
|
+
stem.match(/(#{marker(:IUS)})$/)
|
20
|
+
new_stem = stem.chomp($1) # do not use chomp! as other forms will get severed
|
21
|
+
raise "No comparison sign for comparative present" if new_stem == stem
|
22
|
+
[new_stem, $1]
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,164 @@
|
|
1
|
+
module LLT
|
2
|
+
class DeclinableBuilder < FormBuilder
|
3
|
+
attr_reader :sexus, :comparatio
|
4
|
+
|
5
|
+
def initialize(stem)
|
6
|
+
super
|
7
|
+
@irregular_forms = extended_special_forms(irregulars_with_nominative(stem))
|
8
|
+
@additional_forms = extended_special_forms(stem[:additional_forms])
|
9
|
+
end
|
10
|
+
|
11
|
+
def compute
|
12
|
+
with_replacements(regular_forms) + additional_forms
|
13
|
+
end
|
14
|
+
|
15
|
+
def indices
|
16
|
+
{ casus: [0, 1, 2, 3, 4, 5],
|
17
|
+
numerus: [0, 6],
|
18
|
+
sexus: [0, 12, 24] }
|
19
|
+
end
|
20
|
+
|
21
|
+
def index_of_ending(casus, numerus, sexus = nil)
|
22
|
+
casus + (numerus == 1 ? -1 : 5)
|
23
|
+
end
|
24
|
+
alias :ioe :index_of_ending
|
25
|
+
|
26
|
+
def casus_numerus_sexus_by_index(index, sexus = @sexus)
|
27
|
+
# superflous method - could be solved through
|
28
|
+
# attributes_by_index, however this is noticably faster and thus stays
|
29
|
+
|
30
|
+
if index < 6
|
31
|
+
[index + 1, 1, sexus]
|
32
|
+
else
|
33
|
+
[index - 5, 2, sexus]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def regular_forms
|
38
|
+
endings.each_with_index.map do |ending, i|
|
39
|
+
next unless @lookup_indices.include?(i)
|
40
|
+
new_form_through_index(ending, i)
|
41
|
+
end.compact # compact because of next steps
|
42
|
+
end
|
43
|
+
|
44
|
+
def new_form_through_index(ending, i)
|
45
|
+
casus, numerus, sexus = casus_numerus_sexus_by_index(i)
|
46
|
+
ending = ending.to_s
|
47
|
+
new_form(ending: ending, casus: casus, numerus: numerus, sexus: sexus, index: i)
|
48
|
+
end
|
49
|
+
|
50
|
+
def extended_special_forms(specials)
|
51
|
+
specials = specials || []
|
52
|
+
specials + specials.each_with_object([]) do |(string, *attr), arr|
|
53
|
+
new_attributes(*attr).each { |new_attr| arr << [string, *new_attr] }
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def irregulars_with_nominative(stem)
|
58
|
+
i = if @nom
|
59
|
+
irreg = nominatives
|
60
|
+
if irregs = stem[:irregular_forms]
|
61
|
+
irregs + irreg
|
62
|
+
else
|
63
|
+
irreg
|
64
|
+
end
|
65
|
+
else
|
66
|
+
stem[:irregular_forms] || []
|
67
|
+
end
|
68
|
+
|
69
|
+
i + proper_vocative
|
70
|
+
end
|
71
|
+
|
72
|
+
def new_attributes(*attrs)
|
73
|
+
casus, numerus, sexus = *attrs
|
74
|
+
sexus = sexus || @sexus
|
75
|
+
new_attrs = []
|
76
|
+
|
77
|
+
if ioe(casus, numerus) == 0
|
78
|
+
new_attrs << [5, 1, sexus] unless regular_o_declension? || pronominal_declension?
|
79
|
+
if sexus == :n
|
80
|
+
new_attrs << [4, 1, sexus]
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
new_attrs
|
85
|
+
end
|
86
|
+
|
87
|
+
def proper_vocative
|
88
|
+
o_declension_on_ius? ? [[@stem, 5, 1]] : []
|
89
|
+
end
|
90
|
+
|
91
|
+
def regular_o_declension?
|
92
|
+
@inflection_class == 2 && @nom.to_s =~ /us$/ # to_s because it might be nil
|
93
|
+
end
|
94
|
+
|
95
|
+
def pronominal_declension?
|
96
|
+
end
|
97
|
+
|
98
|
+
def o_declension_on_ius?
|
99
|
+
@inflection_class == 2 && @stem.end_with?("i") && @sexus == :m # is there a neutrum like that?
|
100
|
+
end
|
101
|
+
|
102
|
+
def additional_forms
|
103
|
+
@additional_forms.map do |string, *attrs|
|
104
|
+
casus, numerus, sexus = *attrs
|
105
|
+
i = ioe(casus, numerus, sexus)
|
106
|
+
if @lookup_indices.include?(i)
|
107
|
+
new_special_form(string: string, casus: casus, numerus: numerus, sexus: sexus, index: i)
|
108
|
+
end
|
109
|
+
end.compact
|
110
|
+
end
|
111
|
+
|
112
|
+
def with_replacements(regular_forms)
|
113
|
+
@irregular_forms.each do |string, *attrs|
|
114
|
+
casus, numerus, sexus = *attrs
|
115
|
+
i = ioe(casus, numerus, sexus)
|
116
|
+
if @lookup_indices.include?(i)
|
117
|
+
next unless ri = regular_forms.find_index { |f| f.index == i }
|
118
|
+
regular_forms[ri] = new_special_form(string: string, casus: casus, numerus: numerus, sexus: sexus, index: i)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
regular_forms
|
122
|
+
end
|
123
|
+
|
124
|
+
def new_special_form(args)
|
125
|
+
args = args.merge(default_args)
|
126
|
+
string = args[:string]
|
127
|
+
i = index_of_ending(args[:casus], args[:numerus], args[:sexus])
|
128
|
+
ending = special_ending(string, i).to_s
|
129
|
+
form_class.new(args.merge(stem: string.chomp(ending), ending: ending))
|
130
|
+
end
|
131
|
+
|
132
|
+
def special_ending(word, index)
|
133
|
+
endings_path.constants.each do |const|
|
134
|
+
ending = endings_path.const_get(const)[index]
|
135
|
+
return ending if word.end_with?(ending.to_s)
|
136
|
+
end
|
137
|
+
nil
|
138
|
+
end
|
139
|
+
|
140
|
+
def er_nominative_possible?
|
141
|
+
# only Noun and Adjective override this, as they can have a nominative on er.
|
142
|
+
# other Declinables like Gerundives don't need this
|
143
|
+
false
|
144
|
+
end
|
145
|
+
|
146
|
+
# this is a slight hack to handle O Declension on er.
|
147
|
+
# the Endings constants for noun has US at its first position,
|
148
|
+
# this guarantees a match even when the ending is empty (which means that the passsed along
|
149
|
+
# nominative value shall be used.
|
150
|
+
# similar conditions will need to be written for A decl on as.
|
151
|
+
def endings_lookup(ending, x)
|
152
|
+
if ending.empty?
|
153
|
+
if er_nominative_possible?
|
154
|
+
# not sure if this needs further safeties - asking explicitly for er?
|
155
|
+
# well it does! 2013-10-08 - fili!
|
156
|
+
return x.to_s =~ /^(us|e)$/
|
157
|
+
elsif o_declension_on_ius?
|
158
|
+
return x.to_s =~ /^e$/
|
159
|
+
end
|
160
|
+
end
|
161
|
+
super
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module LLT
|
2
|
+
class EthnicBuilder < DeclinableBuilder
|
3
|
+
builds_like_an :adjective
|
4
|
+
uses_endings_of :adjective
|
5
|
+
|
6
|
+
endings_defined_through :inflection_class, :number_of_endings
|
7
|
+
|
8
|
+
def initialize(stem)
|
9
|
+
@number_of_endings = (stem[:inflection_class] == 1 ? 3 : 2)
|
10
|
+
super
|
11
|
+
end
|
12
|
+
|
13
|
+
def stays_capitalized
|
14
|
+
true
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module LLT
|
2
|
+
class FpBuilder < DeclinableBuilder
|
3
|
+
builds_like_an :adjective
|
4
|
+
builds_with :tempus, :modus, :genus, :extension
|
5
|
+
|
6
|
+
validate :extension
|
7
|
+
|
8
|
+
has_modus t.participium
|
9
|
+
has_genus t.activum
|
10
|
+
has_tempus t.futurum
|
11
|
+
has_extension "ur"
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module LLT
|
2
|
+
class GerundBuilder < DeclinableBuilder
|
3
|
+
builds_with :modus, :extension, :prefix
|
4
|
+
|
5
|
+
has_extension "nd"
|
6
|
+
has_modus t.gerundium
|
7
|
+
|
8
|
+
look_up :thematic
|
9
|
+
|
10
|
+
validate :extension
|
11
|
+
|
12
|
+
def indices
|
13
|
+
{ casus: [nil, 0, 1, 2, nil, 3],
|
14
|
+
numerus: [0],
|
15
|
+
sexus: [0] }
|
16
|
+
end
|
17
|
+
|
18
|
+
def index_of_ending(casus, numerus, sexus = nil)
|
19
|
+
case casus
|
20
|
+
when 2 then 0
|
21
|
+
when 3 then 1
|
22
|
+
when 4 then 2
|
23
|
+
when 6 then 3
|
24
|
+
end
|
25
|
+
end
|
26
|
+
alias :ioe :index_of_ending
|
27
|
+
|
28
|
+
def casus_numerus_sexus_by_index(index, sexus = nil)
|
29
|
+
case index
|
30
|
+
when 0 then [2, 1, :n]
|
31
|
+
when 1 then [3, 1, :n]
|
32
|
+
when 2 then [4, 1, :n]
|
33
|
+
when 3 then [6, 1, :n]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module LLT
|
2
|
+
class GerundiveBuilder < DeclinableBuilder
|
3
|
+
builds_like_an :adjective
|
4
|
+
builds_with :modus, :extension, :prefix
|
5
|
+
|
6
|
+
has_extension "nd"
|
7
|
+
has_modus t.gerundivum
|
8
|
+
|
9
|
+
look_up :thematic
|
10
|
+
|
11
|
+
validate :extension
|
12
|
+
|
13
|
+
# Allows archaic forms like audiundi
|
14
|
+
def validation_rule(args, validator)
|
15
|
+
if args[:inflection_class] == 4 && validator == :thematic
|
16
|
+
if args[validator] == "e" && @options[validator] =~ /^[eu]$/
|
17
|
+
keep_given_value(args, validator, :archaic)
|
18
|
+
end
|
19
|
+
else
|
20
|
+
super
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module LLT
|
2
|
+
class FormBuilder
|
3
|
+
module AdjectiveLikeBuilding
|
4
|
+
def casus_numerus_sexus_by_index(i, sexus = nil)
|
5
|
+
# superflous method - code be solved through attributes_by_index,
|
6
|
+
# however this is noticably faster and thus stays
|
7
|
+
|
8
|
+
mod, sexus = case i
|
9
|
+
when 0..11 then [ 0, :m]
|
10
|
+
when 12..23 then [12, :f]
|
11
|
+
else [24, :n]
|
12
|
+
end
|
13
|
+
i -= mod
|
14
|
+
|
15
|
+
super(i, sexus)
|
16
|
+
end
|
17
|
+
|
18
|
+
def index_of_ending(casus, numerus, sexus = nil)
|
19
|
+
i = super
|
20
|
+
case sexus
|
21
|
+
when :f then i + 12
|
22
|
+
when :n then i + 24
|
23
|
+
else i
|
24
|
+
end
|
25
|
+
end
|
26
|
+
alias :ioe :index_of_ending
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,226 @@
|
|
1
|
+
require 'llt/helpers'
|
2
|
+
require 'llt/constants/particles'
|
3
|
+
|
4
|
+
module LLT
|
5
|
+
class FormBuilder
|
6
|
+
class PronounSegments
|
7
|
+
extend Helpers::Constantize
|
8
|
+
include Helpers::Initialize
|
9
|
+
|
10
|
+
class << self
|
11
|
+
def get(request, args)
|
12
|
+
cl = constant_by_type(args[:inflection_class], prefix: "pronoun", namespace: self)
|
13
|
+
cl.new(args).send(request)
|
14
|
+
end
|
15
|
+
|
16
|
+
def particle(arg)
|
17
|
+
define_method(:particle) { arg }
|
18
|
+
end
|
19
|
+
|
20
|
+
def stem(arg)
|
21
|
+
define_method(:stem) { arg }
|
22
|
+
end
|
23
|
+
|
24
|
+
def prefixed_particle(arg)
|
25
|
+
define_method(:prefixed_particle) { arg }
|
26
|
+
end
|
27
|
+
|
28
|
+
def n(const)
|
29
|
+
LLT::Constants::Particles.const_get(const)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def initialize(args)
|
34
|
+
extract_args!(args)
|
35
|
+
end
|
36
|
+
|
37
|
+
def init_keys
|
38
|
+
%i{ casus numerus sexus }
|
39
|
+
end
|
40
|
+
|
41
|
+
def n(const)
|
42
|
+
self.class.n(const)
|
43
|
+
end
|
44
|
+
|
45
|
+
def particle
|
46
|
+
""
|
47
|
+
end
|
48
|
+
|
49
|
+
def prefixed_particle
|
50
|
+
""
|
51
|
+
end
|
52
|
+
|
53
|
+
class PronounHic < PronounSegments
|
54
|
+
def particle
|
55
|
+
if (@numerus == 1 && @casus != 2) || (@sexus == :n && @numerus == 2 && (@casus == 1 || @casus == 4))
|
56
|
+
n(:C)
|
57
|
+
else
|
58
|
+
""
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def stem
|
63
|
+
if @numerus == 1 && (@casus == 2 || @casus == 3)
|
64
|
+
"hu"
|
65
|
+
else
|
66
|
+
"h"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
class PronounIlle < PronounSegments
|
72
|
+
stem "ill"
|
73
|
+
end
|
74
|
+
|
75
|
+
class PronounIpse < PronounSegments
|
76
|
+
stem "ips"
|
77
|
+
end
|
78
|
+
|
79
|
+
class PronounIste < PronounSegments
|
80
|
+
stem "ist"
|
81
|
+
end
|
82
|
+
|
83
|
+
class PronounIs < PronounSegments
|
84
|
+
def stem
|
85
|
+
if @numerus == 1 && ((@casus == 1 && (@sexus == :m || @sexus == :n)) || (@casus == 4 && @sexus == :n)) || @numerus == 2 && @casus == 1 && @sexus == :m
|
86
|
+
"i"
|
87
|
+
else
|
88
|
+
"e"
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
class PronounQui < PronounSegments
|
94
|
+
def stem
|
95
|
+
if cuius_and_cui
|
96
|
+
"cu"
|
97
|
+
else
|
98
|
+
"qu"
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
def cuius_and_cui
|
103
|
+
@numerus == 1 && (@casus == 2 || @casus == 3)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
class PronounIs < PronounSegments
|
108
|
+
def stem
|
109
|
+
if @numerus == 1 && ((@casus == 1 && (@sexus == :m || @sexus == :n)) || (@casus == 4 && @sexus == :n)) || @numerus == 2 && @casus == 1 && @sexus == :m
|
110
|
+
"i"
|
111
|
+
else
|
112
|
+
"e"
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
class PronounIdem < PronounIs
|
118
|
+
particle n(:DEM)
|
119
|
+
end
|
120
|
+
|
121
|
+
class PronounQui < PronounSegments
|
122
|
+
def stem
|
123
|
+
if cuius_and_cui
|
124
|
+
"cu"
|
125
|
+
else
|
126
|
+
"qu"
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
def cuius_and_cui
|
131
|
+
@numerus == 1 && (@casus == 2 || @casus == 3)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
PronounQuis = PronounQui
|
136
|
+
|
137
|
+
class PronounQuidam < PronounQui
|
138
|
+
particle n(:DAM)
|
139
|
+
end
|
140
|
+
|
141
|
+
class PronounQuicumque < PronounQui
|
142
|
+
particle n(:CUMQUE)
|
143
|
+
end
|
144
|
+
|
145
|
+
class PronounQuinam < PronounQui
|
146
|
+
particle n(:NAM)
|
147
|
+
end
|
148
|
+
|
149
|
+
class PronounQuispiam < PronounQui
|
150
|
+
particle n(:PIAM)
|
151
|
+
end
|
152
|
+
|
153
|
+
class PronounQuilibet < PronounQui
|
154
|
+
particle n(:LIBET)
|
155
|
+
end
|
156
|
+
|
157
|
+
class PronounQuivis < PronounQui
|
158
|
+
particle n(:VIS)
|
159
|
+
end
|
160
|
+
|
161
|
+
class PronounQuisqueS < PronounQui
|
162
|
+
particle n(:QUE)
|
163
|
+
end
|
164
|
+
PronounQuisque = PronounQuisqueS
|
165
|
+
|
166
|
+
class PronounQuisquam < PronounQui
|
167
|
+
particle n(:QUAM)
|
168
|
+
end
|
169
|
+
|
170
|
+
class PronounUnusquisque < PronounQui
|
171
|
+
particle n(:QUE)
|
172
|
+
|
173
|
+
def prefixed_particle
|
174
|
+
opts = { casus: @casus, numerus: @numerus, sexus: @sexus, validate: true }
|
175
|
+
args = { type: :adjective, stem: "un", inflection_class: 5,
|
176
|
+
noe: 3, comparatio: :positivus, options: opts }
|
177
|
+
FormBuilder.build(args).first.to_s
|
178
|
+
end
|
179
|
+
end
|
180
|
+
class PronounUnusquisqueS < PronounUnusquisque
|
181
|
+
def prefixed_particle
|
182
|
+
# unaquisque does not exist - unusquisque is for m and f
|
183
|
+
if @casus == 1 && @numerus == 1 && @sexus != :n
|
184
|
+
"unus"
|
185
|
+
else
|
186
|
+
super
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
class PronounQuisquis < PronounQui
|
192
|
+
def init_keys
|
193
|
+
super << :ending
|
194
|
+
end
|
195
|
+
|
196
|
+
def particle
|
197
|
+
stem + @ending
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
class PronounAliqui < PronounQui
|
202
|
+
prefixed_particle n(:ALI)
|
203
|
+
end
|
204
|
+
PronounAliquis = PronounAliqui
|
205
|
+
|
206
|
+
class PronounUter < PronounSegments
|
207
|
+
def stem
|
208
|
+
if uter
|
209
|
+
"uter"
|
210
|
+
else
|
211
|
+
"utr"
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
def uter
|
216
|
+
@casus == 1 && @numerus == 1 && @sexus == :m
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
class PronounUterque < PronounUter
|
221
|
+
particle n(:QUE)
|
222
|
+
end
|
223
|
+
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|