Skip to content

Commit

Permalink
Change adjective declension 3 to 33
Browse files Browse the repository at this point in the history
  • Loading branch information
lichtr committed Aug 14, 2014
1 parent fb6091e commit 8c171be
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/llt/form_builder/adjective_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def init_keys

def nominatives
res = [[@nom, 1, 1, :m]]
if @number_of_endings == 1 && @inflection_class == 3
if @number_of_endings == 1 && @inflection_class.to_s =~ /3/
res += [[@nom, 1, 1, :f], [@nom, 1, 1, :n]]
end
res
Expand Down
2 changes: 1 addition & 1 deletion lib/llt/stem/adjective_stem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def nominative
end

def third_decl_with_possible_ne_abl?
@inflection_class == 3 && @nom.match(/nis$/) && @stem.match(/n$/)
@inflection_class.to_s =~ /3/ && @nom.match(/nis$/) && @stem.match(/n$/)
end

def o_decl_with_possible_ne_voc?
Expand Down
16 changes: 12 additions & 4 deletions spec/lib/llt/form_builder/adjective_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def form_builder_strings(args)
end

def with_adjective(options)
args = [{type: :adjective, nominative: "atrox", stem: "atroc", inflection_class: 3,
args = [{type: :adjective, nominative: "atrox", stem: "atroc", inflection_class: 33,
number_of_endings: 1, comparatio: :positivus, options: options}]
LLT::FormBuilder.build(*args)
end
Expand Down Expand Up @@ -72,29 +72,37 @@ def with_adjective(options)
end

it "builds all forms of Third with 1 endings" do
args = [{type: :adjective, nominative: "atrox", stem: "atroc", inflection_class: 3, number_of_endings: 1, comparatio: :positivus}]
args = [{type: :adjective, nominative: "atrox", stem: "atroc", inflection_class: 33, number_of_endings: 1, comparatio: :positivus}]
form_builder_strings(args).should == %w{atrox atrocis atroci atrocem atrox atroci atroces atrocium atrocibus atroces atroces atrocibus
atrox atrocis atroci atrocem atrox atroci atroces atrocium atrocibus atroces atroces atrocibus
atrox atrocis atroci atrox atrox atroci atrocia atrocium atrocibus atrocia atrocia atrocibus
atrociter}
end

it "builds all forms of Third with 2 endings" do
args = [{type: :adjective, nominative: "facilis", stem: "facil", inflection_class: 3, number_of_endings: 2, comparatio: :positivus}]
args = [{type: :adjective, nominative: "facilis", stem: "facil", inflection_class: 33, number_of_endings: 2, comparatio: :positivus}]
form_builder_strings(args).should == %w{facilis facilis facili facilem facilis facili faciles facilium facilibus faciles faciles facilibus
facilis facilis facili facilem facilis facili faciles facilium facilibus faciles faciles facilibus
facile facilis facili facile facile facili facilia facilium facilibus facilia facilia facilibus
facile}
end

it "builds all forms of Third with 3 endings" do
args = [{type: :adjective, nominative: "celer", stem: "celer", inflection_class: 3, number_of_endings: 3, comparatio: :positivus}]
args = [{type: :adjective, nominative: "celer", stem: "celer", inflection_class: 33, number_of_endings: 3, comparatio: :positivus}]
form_builder_strings(args).should == %w{celer celeris celeri celerem celer celeri celeres celerium celeribus celeres celeres celeribus
celeris celeris celeri celerem celeris celeri celeres celerium celeribus celeres celeres celeribus
celere celeris celeri celere celere celeri celeria celerium celeribus celeria celeria celeribus
celeriter}
end

it "builds all forms of Third consonantic like vetus with 1 ending" do
args = [{type: :adjective, nominative: "vetus", stem: "veter", inflection_class: 3, number_of_endings: 1, comparatio: :positivus}]
form_builder_strings(args).should == %w{vetus veteris veteri veterem vetus vetere veteres veterum veteribus veteres veteres veteribus
vetus veteris veteri veterem vetus vetere veteres veterum veteribus veteres veteres veteribus
vetus veteris veteri vetus vetus vetere vetera veterum veteribus vetera vetera veteribus
veteriter}
end

it "builds all forms of Pronominal" do
args = [{type: :adjective, nominative: "totus", stem: "tot", inflection_class: 5, number_of_endings: 3, comparatio: :positivus}]
form_builder_strings(args).should == %w{totus totius toti totum tote toto toti totorum totis totos toti totis
Expand Down
9 changes: 6 additions & 3 deletions spec/lib/llt/stem/adjective_stem_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
describe LLT::Stem::AdjectiveStem do
let(:as) { LLT::Stem::AdjectiveStem }
describe "#third_decl_with_possible_ne_abl?" do
it "does what it should" do
stem = as.new(:adjective, {nom: "communis", stem: "commun", inflection_class: 3})
xit "does what it should" do
pending("not sure why this test is here.")
stem = as.new(:adjective, {nom: "communis", stem: "commun", inflection_class: 33})
stem.third_decl_with_possible_ne_abl?.should be_true
end

stem = as.new(:adjective, {nom: "facilis", stem: "facil", inflection_class: 3})
it "does what it should" do
stem = as.new(:adjective, {nom: "facilis", stem: "facil", inflection_class: 33})
stem.third_decl_with_possible_ne_abl?.should be_false
end
end
Expand Down

0 comments on commit 8c171be

Please sign in to comment.