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" => "" },
}
class KanaKanji
@ -17,8 +25,9 @@ class KanaKanji
self.class.new kana + other, kanji + other
end
def last_character
GUYS[kana[-1]]
def last_character(new_form=nil)
return kana[-1] unless new_form
U_VOWEL_CHANGES[kana[-1]][new_form]
end
def all_but_last_character
@ -36,8 +45,8 @@ class Verb
@definition_english = definition_english
end
def last_character
dict.last_character
def last_character(new_form=nil)
dict.last_character(new_form)
end
def all_but_last_character
@ -57,40 +66,66 @@ class IchidanVerb < Verb
def long_form_present_positive
all_but_last_character + "ます"
end
def te
all_but_last_character + ""
end
end
class GodanVerb < Verb
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
class SuruVerb < Verb
def prefix
dict[..-3]
end
def long_form_present_positive
dict[..-3] + "します"
prefix + "します"
end
def te
prefix + "して"
end
end
= 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")
p .dictionary.kanji
p .dictionary.kana
p .long_form_present_positive.kanji
p .long_form_present_positive.kana
= 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")
p .dictionary.kanji
p .dictionary.kana
p .long_form_present_positive.kanji
p .long_form_present_positive.kana
verbs = [,,,]
verbs.each do |verb|
p verb.dictionary.kanji
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