Skip to content

Commit

Permalink
Fix sexus error with adjectives
Browse files Browse the repository at this point in the history
  • Loading branch information
LFDM committed Aug 13, 2014
1 parent 56bd769 commit fb6091e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 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 @@ -12,7 +12,7 @@ def init_keys
end

def nominatives
res = [[@nom, 1, 1]]
res = [[@nom, 1, 1, :m]]
if @number_of_endings == 1 && @inflection_class == 3
res += [[@nom, 1, 1, :f], [@nom, 1, 1, :n]]
end
Expand Down
15 changes: 14 additions & 1 deletion spec/lib/llt/form_builder/adjective_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def with_adjective(options)
amicus.casus.should == 1
amicus.numerus.should == 1
amicus.sexus.should == :m
amicus.inflection_class.should == 1

amico.casus.should == 6
amico.numerus.should == 1
Expand All @@ -52,12 +53,24 @@ def with_adjective(options)

it "builds all forms of A/O like pulcher" do
args = [{type: :adjective, nominative: "pulcher", stem: "pulchr", inflection_class: 1, number_of_endings: 3, comparatio: :positivus}]
form_builder_strings(args).should ==%w{pulcher pulchri pulchro pulchrum pulcher pulchro pulchri pulchrorum pulchris pulchros pulchri pulchris
forms = LLT::FormBuilder.build(*args)
forms.map(&:to_s).should == %w{pulcher pulchri pulchro pulchrum pulcher pulchro pulchri pulchrorum pulchris pulchros pulchri pulchris
pulchra pulchrae pulchrae pulchram pulchra pulchra pulchrae pulchrarum pulchris pulchras pulchrae pulchris
pulchrum pulchri pulchro pulchrum pulchrum pulchro pulchra pulchrorum pulchris pulchra pulchra pulchris
pulchre}
end

it "builds all forms of A/O like altus" do
args = [{type: :adjective, nominative: "altus", stem: "alt", inflection_class: 1, number_of_endings: 3, comparatio: :positivus}]
forms = LLT::FormBuilder.build(*args)
altus = forms[0]

altus.casus.should == 1
altus.numerus.should == 1
altus.sexus.should == :m
altus.inflection_class.should == 1
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}]
form_builder_strings(args).should == %w{atrox atrocis atroci atrocem atrox atroci atroces atrocium atrocibus atroces atroces atrocibus
Expand Down

0 comments on commit fb6091e

Please sign in to comment.