Compare commits
	
		
			5 Commits
		
	
	
		
			8e47dc24d7
			...
			3977cc4c63
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 3977cc4c63 | |||
| 37e3ce359f | |||
| 362bcdf690 | |||
| 484d6418b6 | |||
| f2d7616fa0 | 
| @ -1,7 +1,7 @@ | |||||||
| module IkaConjugations | module IkaConjugations | ||||||
|   U_VOWEL_CHANGES = { |   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" => "と" }, | ||||||
|     "す" => { "a" => "さ", "i" => "し", "u" => "す", "e" => "せ", "o" => "そ" }, |     "す" => { "a" => "さ", "i" => "し", "u" => "す", "e" => "せ", "o" => "そ" }, | ||||||
|     "く" => { "a" => "か", "i" => "き", "u" => "く", "e" => "け", "o" => "こ" }, |     "く" => { "a" => "か", "i" => "き", "u" => "く", "e" => "け", "o" => "こ" }, | ||||||
|  | |||||||
| @ -64,6 +64,19 @@ module IkaConjugations | |||||||
|     def potential |     def potential | ||||||
|       Ichidan.new(potential_starter.kanji, potential_starter.kana, "to be able #{definition}") |       Ichidan.new(potential_starter.kanji, potential_starter.kana, "to be able #{definition}") | ||||||
|     end |     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 |     class Ichidan < Verb | ||||||
|       def stem |       def stem | ||||||
|         all_but_last_character |         all_but_last_character | ||||||
| @ -80,6 +93,14 @@ module IkaConjugations | |||||||
|       def potential_starter |       def potential_starter | ||||||
|         stem + "られる" |         stem + "られる" | ||||||
|       end |       end | ||||||
|  | 
 | ||||||
|  |       def ba | ||||||
|  |         stem + "れば" | ||||||
|  |       end | ||||||
|  | 
 | ||||||
|  |       def passive_starter | ||||||
|  |         stem + "られる" | ||||||
|  |       end | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|     class Godan < Verb |     class Godan < Verb | ||||||
| @ -131,6 +152,18 @@ module IkaConjugations | |||||||
|                                    "んで" |                                    "んで" | ||||||
|                                  end |                                  end | ||||||
|       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 |     end | ||||||
| 
 | 
 | ||||||
|     class Suru < Verb |     class Suru < Verb | ||||||
| @ -153,6 +186,14 @@ module IkaConjugations | |||||||
|       def potential_starter |       def potential_starter | ||||||
|         prefix + "できる" |         prefix + "できる" | ||||||
|       end |       end | ||||||
|  | 
 | ||||||
|  |       def ba | ||||||
|  |         prefix + "すれば" | ||||||
|  |       end | ||||||
|  | 
 | ||||||
|  |       def passive_starter | ||||||
|  |         prefix + "される" | ||||||
|  |       end | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|     class Kuru < Verb |     class Kuru < Verb | ||||||
| @ -175,6 +216,14 @@ module IkaConjugations | |||||||
|       def potential_starter |       def potential_starter | ||||||
|         negative_stem + "られる" |         negative_stem + "られる" | ||||||
|       end |       end | ||||||
|  | 
 | ||||||
|  |       def ba | ||||||
|  |         prefix + KanaKanji.new("く", "来") + "れば" | ||||||
|  |       end | ||||||
|  | 
 | ||||||
|  |       def passive_starter | ||||||
|  |         prefix + KanaKanji.new("こ", "来") + "られる" | ||||||
|  |       end | ||||||
|     end |     end | ||||||
|   end |   end | ||||||
| end | end | ||||||
|  | |||||||
| @ -44,7 +44,7 @@ module IkaConjugations | |||||||
| 
 | 
 | ||||||
|       au = KanaKanji.new("会う", "あう") |       au = KanaKanji.new("会う", "あう") | ||||||
|       assert_equal "う", au.last_character |       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("i") | ||||||
|       assert_equal "う", au.last_character("u") |       assert_equal "う", au.last_character("u") | ||||||
|       assert_equal "え", au.last_character("e") |       assert_equal "え", au.last_character("e") | ||||||
|  | |||||||
| @ -4,7 +4,7 @@ require "minitest/autorun" | |||||||
| module IkaConjugations | module IkaConjugations | ||||||
|   class TestVerb < Minitest::Test |   class TestVerb < Minitest::Test | ||||||
|     def setup |     def setup | ||||||
|       @miru = Verb::Ichidan.new("見る", "みる", "to look") |       @miru = Verb::Ichidan.new("見る", "みる", "to see") | ||||||
|       @nomu = Verb::Godan.new("飲む", "のむ", "to drink") |       @nomu = Verb::Godan.new("飲む", "のむ", "to drink") | ||||||
|       @au = Verb::Godan.new("会う", "あう", "to meet") |       @au = Verb::Godan.new("会う", "あう", "to meet") | ||||||
|       @matsu = Verb::Godan.new("待つ", "まつ", "to wait") |       @matsu = Verb::Godan.new("待つ", "まつ", "to wait") | ||||||
| @ -23,7 +23,7 @@ module IkaConjugations | |||||||
|       @aru = Verb::Godan.new("ある", "ある", "to be") |       @aru = Verb::Godan.new("ある", "ある", "to be") | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|     def test_te_form |     def test_te | ||||||
|       assert_equal "見て", @miru.te.kanji |       assert_equal "見て", @miru.te.kanji | ||||||
|       assert_equal "みて", @miru.te.kana |       assert_equal "みて", @miru.te.kana | ||||||
|       assert_equal "飲んで", @nomu.te.kanji |       assert_equal "飲んで", @nomu.te.kanji | ||||||
| @ -111,6 +111,8 @@ module IkaConjugations | |||||||
|       assert_equal "連れて来ない", @tsuretekuru.short_form_present_negative.kanji |       assert_equal "連れて来ない", @tsuretekuru.short_form_present_negative.kanji | ||||||
|       assert_equal "つれてこない", @tsuretekuru.short_form_present_negative.kana |       assert_equal "つれてこない", @tsuretekuru.short_form_present_negative.kana | ||||||
|       assert_equal "ない", @aru.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 |     end | ||||||
| 
 | 
 | ||||||
|     def test_long_form_past_positive |     def test_long_form_past_positive | ||||||
| @ -175,6 +177,8 @@ module IkaConjugations | |||||||
|       assert_equal "連れて来なかった", @tsuretekuru.short_form_past_negative.kanji |       assert_equal "連れて来なかった", @tsuretekuru.short_form_past_negative.kanji | ||||||
|       assert_equal "つれてこなかった", @tsuretekuru.short_form_past_negative.kana |       assert_equal "つれてこなかった", @tsuretekuru.short_form_past_negative.kana | ||||||
|       assert_equal "なかった", @aru.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 |     end | ||||||
| 
 | 
 | ||||||
|     def test_desire |     def test_desire | ||||||
| @ -191,11 +195,13 @@ module IkaConjugations | |||||||
|       assert_equal "連れて来たい", @tsuretekuru.desire.kanji |       assert_equal "連れて来たい", @tsuretekuru.desire.kanji | ||||||
|       assert_equal "つれてきたい", @tsuretekuru.desire.kana |       assert_equal "つれてきたい", @tsuretekuru.desire.kana | ||||||
|       assert_equal "ありたい", @aru.desire.kana |       assert_equal "ありたい", @aru.desire.kana | ||||||
|  |       assert_equal "あいたい", @au.desire.kana | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|     def test_potential |     def test_potential | ||||||
|       assert_equal "見られる", @miru.potential.dictionary.kanji |       assert_equal "見られる", @miru.potential.dictionary.kanji | ||||||
|       assert_equal "みられる", @miru.potential.dictionary.kana |       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.kanji | ||||||
|       assert_equal "のめる", @nomu.potential.dictionary.kana |       assert_equal "のめる", @nomu.potential.dictionary.kana | ||||||
|       assert_equal "できる", @suru.potential.dictionary.kanji |       assert_equal "できる", @suru.potential.dictionary.kanji | ||||||
| @ -208,5 +214,53 @@ module IkaConjugations | |||||||
|       assert_equal "つれてこられる", @tsuretekuru.potential.dictionary.kana |       assert_equal "つれてこられる", @tsuretekuru.potential.dictionary.kana | ||||||
|       assert_equal "あれる", @aru.potential.dictionary.kana |       assert_equal "あれる", @aru.potential.dictionary.kana | ||||||
|     end |     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 | ||||||
| end | end | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user