Passive form

This commit is contained in:
Bill Rossi 2025-08-18 06:30:26 -04:00
parent 37e3ce359f
commit 3977cc4c63
2 changed files with 33 additions and 0 deletions

View File

@ -73,6 +73,10 @@ module IkaConjugations
negative_stem + "よう"
end
def passive
Ichidan.new(passive_starter.kanji, passive_starter.kana, "#{definition} (dissatisfied)")
end
class Ichidan < Verb
def stem
all_but_last_character
@ -93,6 +97,10 @@ module IkaConjugations
def ba
stem + "れば"
end
def passive_starter
stem + "られる"
end
end
class Godan < Verb
@ -152,6 +160,10 @@ module IkaConjugations
def ba
all_but_last_character + last_character("e") + ""
end
def passive_starter
all_but_last_character + last_character("a") + "れる"
end
end
class Suru < Verb
@ -178,6 +190,10 @@ module IkaConjugations
def ba
prefix + "すれば"
end
def passive_starter
prefix + "される"
end
end
class Kuru < Verb
@ -204,6 +220,10 @@ module IkaConjugations
def ba
prefix + KanaKanji.new("", "") + "れば"
end
def passive_starter
prefix + KanaKanji.new("", "") + "られる"
end
end
end
end

View File

@ -249,5 +249,18 @@ module IkaConjugations
assert_equal "あれば", @aru.ba.kanji
assert_equal "会えば", @au.ba.kanji
end
def test_passive
assert_equal "見られる", @miru.passive.dictionary.kanji
assert_equal "飲まれる", @nomu.passive.dictionary.kanji
assert_equal "される", @suru.passive.dictionary.kanji
assert_equal "勉強される", @benkyousuru.passive.dictionary.kanji
assert_equal "来られる", @kuru.passive.dictionary.kanji
assert_equal "こられる", @kuru.passive.dictionary.kana
assert_equal "連れて来られる", @tsuretekuru.passive.dictionary.kanji
assert_equal "つれてこられる", @tsuretekuru.passive.dictionary.kana
assert_equal "あられる", @aru.passive.dictionary.kanji
assert_equal "会われる", @au.passive.dictionary.kanji
end
end
end