Compare commits
No commits in common. "3977cc4c63c48efc5bba701777443ad8c639c1ab" and "8e47dc24d7041d0ca1d5ed23c453e2aa633d59c0" have entirely different histories.
3977cc4c63
...
8e47dc24d7
@ -1,7 +1,7 @@
|
||||
module IkaConjugations
|
||||
U_VOWEL_CHANGES = {
|
||||
"る" => { "a" => "ら", "i" => "り", "u" => "る", "e" => "れ", "o" => "ろ" },
|
||||
"う" => { "a" => "わ", "i" => "い", "u" => "う", "e" => "え", "o" => "お" },
|
||||
"う" => { "a" => "あ", "i" => "い", "u" => "う", "e" => "え", "o" => "お" },
|
||||
"つ" => { "a" => "た", "i" => "ち", "u" => "つ", "e" => "て", "o" => "と" },
|
||||
"す" => { "a" => "さ", "i" => "し", "u" => "す", "e" => "せ", "o" => "そ" },
|
||||
"く" => { "a" => "か", "i" => "き", "u" => "く", "e" => "け", "o" => "こ" },
|
||||
|
@ -64,19 +64,6 @@ module IkaConjugations
|
||||
def potential
|
||||
Ichidan.new(potential_starter.kanji, potential_starter.kana, "to be able #{definition}")
|
||||
end
|
||||
|
||||
def excessive
|
||||
Ichidan.new(stem.kanji + "すぎる", stem.kana + "すぎる", "#{definition} too much")
|
||||
end
|
||||
|
||||
def volitional
|
||||
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,14 +80,6 @@ module IkaConjugations
|
||||
def potential_starter
|
||||
stem + "られる"
|
||||
end
|
||||
|
||||
def ba
|
||||
stem + "れば"
|
||||
end
|
||||
|
||||
def passive_starter
|
||||
stem + "られる"
|
||||
end
|
||||
end
|
||||
|
||||
class Godan < Verb
|
||||
@ -152,18 +131,6 @@ module IkaConjugations
|
||||
"んで"
|
||||
end
|
||||
end
|
||||
|
||||
def volitional
|
||||
all_but_last_character + last_character("o") + "う"
|
||||
end
|
||||
|
||||
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
|
||||
@ -186,14 +153,6 @@ module IkaConjugations
|
||||
def potential_starter
|
||||
prefix + "できる"
|
||||
end
|
||||
|
||||
def ba
|
||||
prefix + "すれば"
|
||||
end
|
||||
|
||||
def passive_starter
|
||||
prefix + "される"
|
||||
end
|
||||
end
|
||||
|
||||
class Kuru < Verb
|
||||
@ -216,14 +175,6 @@ module IkaConjugations
|
||||
def potential_starter
|
||||
negative_stem + "られる"
|
||||
end
|
||||
|
||||
def ba
|
||||
prefix + KanaKanji.new("く", "来") + "れば"
|
||||
end
|
||||
|
||||
def passive_starter
|
||||
prefix + KanaKanji.new("こ", "来") + "られる"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -44,7 +44,7 @@ module IkaConjugations
|
||||
|
||||
au = KanaKanji.new("会う", "あう")
|
||||
assert_equal "う", au.last_character
|
||||
assert_equal "わ", au.last_character("a")
|
||||
assert_equal "あ", au.last_character("a")
|
||||
assert_equal "い", au.last_character("i")
|
||||
assert_equal "う", au.last_character("u")
|
||||
assert_equal "え", au.last_character("e")
|
||||
|
@ -4,7 +4,7 @@ require "minitest/autorun"
|
||||
module IkaConjugations
|
||||
class TestVerb < Minitest::Test
|
||||
def setup
|
||||
@miru = Verb::Ichidan.new("見る", "みる", "to see")
|
||||
@miru = Verb::Ichidan.new("見る", "みる", "to look")
|
||||
@nomu = Verb::Godan.new("飲む", "のむ", "to drink")
|
||||
@au = Verb::Godan.new("会う", "あう", "to meet")
|
||||
@matsu = Verb::Godan.new("待つ", "まつ", "to wait")
|
||||
@ -23,7 +23,7 @@ module IkaConjugations
|
||||
@aru = Verb::Godan.new("ある", "ある", "to be")
|
||||
end
|
||||
|
||||
def test_te
|
||||
def test_te_form
|
||||
assert_equal "見て", @miru.te.kanji
|
||||
assert_equal "みて", @miru.te.kana
|
||||
assert_equal "飲んで", @nomu.te.kanji
|
||||
@ -111,8 +111,6 @@ module IkaConjugations
|
||||
assert_equal "連れて来ない", @tsuretekuru.short_form_present_negative.kanji
|
||||
assert_equal "つれてこない", @tsuretekuru.short_form_present_negative.kana
|
||||
assert_equal "ない", @aru.short_form_present_negative.kana
|
||||
assert_equal "会わない", @au.short_form_present_negative.kanji
|
||||
assert_equal "あわない", @au.short_form_present_negative.kana
|
||||
end
|
||||
|
||||
def test_long_form_past_positive
|
||||
@ -177,8 +175,6 @@ module IkaConjugations
|
||||
assert_equal "連れて来なかった", @tsuretekuru.short_form_past_negative.kanji
|
||||
assert_equal "つれてこなかった", @tsuretekuru.short_form_past_negative.kana
|
||||
assert_equal "なかった", @aru.short_form_past_negative.kana
|
||||
assert_equal "会わなかった", @au.short_form_past_negative.kanji
|
||||
assert_equal "あわなかった", @au.short_form_past_negative.kana
|
||||
end
|
||||
|
||||
def test_desire
|
||||
@ -195,13 +191,11 @@ module IkaConjugations
|
||||
assert_equal "連れて来たい", @tsuretekuru.desire.kanji
|
||||
assert_equal "つれてきたい", @tsuretekuru.desire.kana
|
||||
assert_equal "ありたい", @aru.desire.kana
|
||||
assert_equal "あいたい", @au.desire.kana
|
||||
end
|
||||
|
||||
def test_potential
|
||||
assert_equal "見られる", @miru.potential.dictionary.kanji
|
||||
assert_equal "みられる", @miru.potential.dictionary.kana
|
||||
assert_equal "to be able to see", @miru.potential.definition
|
||||
assert_equal "飲める", @nomu.potential.dictionary.kanji
|
||||
assert_equal "のめる", @nomu.potential.dictionary.kana
|
||||
assert_equal "できる", @suru.potential.dictionary.kanji
|
||||
@ -214,53 +208,5 @@ module IkaConjugations
|
||||
assert_equal "つれてこられる", @tsuretekuru.potential.dictionary.kana
|
||||
assert_equal "あれる", @aru.potential.dictionary.kana
|
||||
end
|
||||
|
||||
def test_excessive
|
||||
assert_equal "見すぎる", @miru.excessive.dictionary.kanji
|
||||
assert_equal "飲みすぎる", @nomu.excessive.dictionary.kanji
|
||||
assert_equal "to drink too much", @nomu.excessive.definition
|
||||
assert_equal "べんきょうしすぎました", @benkyousuru.excessive.long_form_past_positive.kana
|
||||
end
|
||||
|
||||
def test_volitional
|
||||
assert_equal "見よう", @miru.volitional.kanji
|
||||
assert_equal "みよう", @miru.volitional.kana
|
||||
assert_equal "飲もう", @nomu.volitional.kanji
|
||||
assert_equal "のもう", @nomu.volitional.kana
|
||||
assert_equal "しよう", @suru.volitional.kanji
|
||||
assert_equal "しよう", @suru.volitional.kana
|
||||
assert_equal "勉強しよう", @benkyousuru.volitional.kanji
|
||||
assert_equal "べんきょうしよう", @benkyousuru.volitional.kana
|
||||
assert_equal "来よう", @kuru.volitional.kanji
|
||||
assert_equal "こよう", @kuru.volitional.kana
|
||||
assert_equal "連れて来よう", @tsuretekuru.volitional.kanji
|
||||
assert_equal "つれてこよう", @tsuretekuru.volitional.kana
|
||||
assert_equal "あろう", @aru.volitional.kana
|
||||
assert_equal "あおう", @au.volitional.kana
|
||||
end
|
||||
|
||||
def test_ba
|
||||
assert_equal "見れば", @miru.ba.kanji
|
||||
assert_equal "飲めば", @nomu.ba.kanji
|
||||
assert_equal "すれば", @suru.ba.kanji
|
||||
assert_equal "勉強すれば", @benkyousuru.ba.kanji
|
||||
assert_equal "来れば", @kuru.ba.kanji
|
||||
assert_equal "連れて来れば", @tsuretekuru.ba.kanji
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user