This commit is contained in:
Bill Rossi 2025-08-16 07:21:11 -04:00
parent 25f2d260c7
commit 8552a95bb7

View File

@ -1,5 +1,13 @@
GUYS = { 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" => "" },
} }
class KanaKanji class KanaKanji
@ -17,8 +25,9 @@ class KanaKanji
self.class.new kana + other, kanji + other self.class.new kana + other, kanji + other
end end
def last_character def last_character(new_form=nil)
GUYS[kana[-1]] return kana[-1] unless new_form
U_VOWEL_CHANGES[kana[-1]][new_form]
end end
def all_but_last_character def all_but_last_character
@ -36,8 +45,8 @@ class Verb
@definition_english = definition_english @definition_english = definition_english
end end
def last_character def last_character(new_form=nil)
dict.last_character dict.last_character(new_form)
end end
def all_but_last_character def all_but_last_character
@ -57,40 +66,66 @@ class IchidanVerb < Verb
def long_form_present_positive def long_form_present_positive
all_but_last_character + "ます" all_but_last_character + "ます"
end end
def te
all_but_last_character + ""
end
end end
class GodanVerb < Verb class GodanVerb < Verb
def long_form_present_positive def long_form_present_positive
all_but_last_character + last_character["i"] + "ます" all_but_last_character + last_character("i") + "ます"
end
def te
p last_character
case last_character
when ""
all_but_last_character + "って"
when ""
all_but_last_character + "って"
when ""
all_but_last_character + "って"
when ""
all_but_last_character + "して"
when ""
all_but_last_character + "いて"
when ""
all_but_last_character + "いで"
when ""
all_but_last_character + "んで"
when ""
all_but_last_character + "んで"
when ""
all_but_last_character + "んで"
end
end end
end end
class SuruVerb < Verb class SuruVerb < Verb
def prefix
dict[..-3]
end
def long_form_present_positive def long_form_present_positive
dict[..-3] + "します" prefix + "します"
end
def te
prefix + "して"
end end
end end
= IchidanVerb.new("見る", "みる", "to look") = IchidanVerb.new("見る", "みる", "to look")
p .dictionary.kanji
p .dictionary.kana
p .long_form_present_positive.kanji
p .long_form_present_positive.kana
= GodanVerb.new("飲む", "のむ", "to drink") = GodanVerb.new("飲む", "のむ", "to drink")
p .dictionary.kanji
p .dictionary.kana
p .long_form_present_positive.kanji
p .long_form_present_positive.kana
= SuruVerb.new("する", "する", "to do") = SuruVerb.new("する", "する", "to do")
p .dictionary.kanji
p .dictionary.kana
p .long_form_present_positive.kanji
p .long_form_present_positive.kana
= SuruVerb.new("勉強する", "べんきょうする", "to study") = SuruVerb.new("勉強する", "べんきょうする", "to study")
p .dictionary.kanji verbs = [,,,]
p .dictionary.kana verbs.each do |verb|
p .long_form_present_positive.kanji p verb.dictionary.kanji
p .long_form_present_positive.kana p verb.dictionary.kana
p verb.long_form_present_positive.kanji
p verb.long_form_present_positive.kana
p verb.te.kanji
p verb.te.kana
end