Skip to content

Commit

Permalink
instrumentative case renamed to instrumental case
Browse files Browse the repository at this point in the history
  • Loading branch information
tanraya committed May 13, 2013
1 parent 6cf2678 commit 4444d3f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ person.my_lastname_dative # => Сафронову
Вот список суффиксов, которые вы можете добавить к имени метода, чтобы
получить имя в нужном падеже:

* genitive — родительный;
* dative — дательный;
* accusative — винительный;
* instrumentative — творительный;
* prepositional — предложный.
* genitive — родительный;
* dative — дательный;
* accusative — винительный;
* instrumental — творительный;
* prepositional — предложный.

## Оценка точности

Expand All @@ -164,15 +164,15 @@ Pr(nominative|male) = 100.0000%
Pr(genitive|male) = 99.6763%
Pr(dative|male) = 99.7012%
Pr(accusative|male) = 99.7261%
Pr(instrumentative|male) = 97.9485%
Pr(instrumental|male) = 97.9485%
Pr(prepositional|male) = 99.6888%
```
```
Pr(nominative|female) = 100.0000%
Pr(genitive|female) = 99.8652%
Pr(dative|female) = 99.8952%
Pr(accusative|female) = 99.9251%
Pr(instrumentative|female) = 99.4189%
Pr(instrumental|female) = 99.4189%
Pr(prepositional|female) = 99.8952%
```

Expand Down
16 changes: 8 additions & 8 deletions lib/petrovich.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@
# * +:genitive+ - родительный
# * +:dative+ - дательный
# * +:accusative+ - винительный
# * +:instrumentative+ - творительный
# * +:instrumental+ - творительный
# * +:prepositional+ - предложный
#
class Petrovich
CASES = [:nominative, :genitive, :dative, :accusative, :instrumentative, :prepositional]
CASES = [:nominative, :genitive, :dative, :accusative, :instrumental, :prepositional]

NOMINATIVE = :nominative # именительный
GENITIVE = :genitive # родительный
DATIVE = :dative # дательный
ACCUSATIVE = :accusative # винительный
INSTRUMENTATIVE = :instrumentative # творительный
PREPOSITIONAL = :prepositional # предложный
NOMINATIVE = :nominative # именительный
GENITIVE = :genitive # родительный
DATIVE = :dative # дательный
ACCUSATIVE = :accusative # винительный
INSTRUMENTATIVE = :instrumental # творительный
PREPOSITIONAL = :prepositional # предложный

def initialize(gender = nil)
@gender = gender.to_s
Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/evaluate.rake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CASES = [
:genitive,
:dative,
:accusative,
:instrumentative,
:instrumental,
:prepositional
]

Expand Down Expand Up @@ -70,7 +70,7 @@ task :evaluate => :petrovich do
check! errors, correct, total, lemma, gender, :accusative, word
elsif grammemes.include? 'тв'
# actually, it's called the instrumetal case
check! errors, correct, total, lemma, gender, :instrumentative, word
check! errors, correct, total, lemma, gender, :instrumental, word
elsif grammemes.include? 'пр'
check! errors, correct, total, lemma, gender, :prepositional, word
end
Expand Down
8 changes: 4 additions & 4 deletions spec/petrovich_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@
end

it "respects proper case for firstname" do
expect { Petrovich.new.firstname('Иван', :instrumentative) }.to_not raise_error
expect { Petrovich.new.firstname('Иван', :instrumental) }.to_not raise_error
end

it "respects proper case for middlename" do
expect { Petrovich.new.middlename('Петрович', :instrumentative) }.to_not raise_error
expect { Petrovich.new.middlename('Петрович', :instrumental) }.to_not raise_error
end

it "respects proper case for lastname" do
expect { Petrovich.new.lastname('Ковалёв', :instrumentative) }.to_not raise_error
expect { Petrovich.new.lastname('Ковалёв', :instrumental) }.to_not raise_error
end

it "have alias for middlename" do
Petrovich.new.patronymic('Петрович', :instrumentative).should == 'Петровичем'
Petrovich.new.patronymic('Петрович', :instrumental).should == 'Петровичем'
end
end
end

0 comments on commit 4444d3f

Please sign in to comment.