Class: Kanjika::Conjugator::Masu
- Defined in:
- lib/kanjika/conjugator/masu.rb
Constant Summary collapse
- GODAN_ENDINGS =
{ "う" => "い", "く" => "き", "ぐ" => "ぎ", "す" => "し", "つ" => "ち", "ぬ" => "に", "ぶ" => "び", "む" => "み", "る" => "り" }
- ICHIDAN_MASU_FORMS =
{ "る" => "ます" }
- IRREGULARS =
{ "来る" => "来ます", "くる" => "きます", "する" => "します" }
- CONJUGATION_RULES =
{ ichidan: ->(stem) { stem + "ます" }, godan: ->(stem, last_char) { stem + GODAN_ENDINGS[last_char] + "ます" }, irregular: ->(verb) { IRREGULARS[verb] } }
Constants inherited from Base
Base::E_ENDINGS, Base::GODAN, Base::ICHIDAN, Base::I_ENDINGS, Base::KURU, Base::NOUN_VERB, Base::SURU, Base::U_ENDINGS
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Kanjika::Conjugator::Base
Instance Method Details
#conjugate ⇒ Object
30 31 32 33 34 |
# File 'lib/kanjika/conjugator/masu.rb', line 30 def conjugate Ve.in(:ja).words(verb).flat_map do |word| word.tokens.map { |token| conjugate_token(word, token) }.join end.join end |