Class: Kanjika::Conjugator::Te
- Defined in:
- lib/kanjika/conjugator/te.rb
Constant Summary collapse
- GODAN_ENDINGS =
{ "う" => "って", "く" => "いて", "ぐ" => "いで", "す" => "して", "つ" => "って", "ぬ" => "んで", "ぶ" => "んで", "む" => "んで", "る" => "って" }
- ICHIDAN_ENDINGS =
{ "る" => "て" }
- IRREGULARS =
{ "来る" => "来て", "くる" => "きて", "する" => "して" }
- CONJUGATION_RULES =
{ ichidan: ->(stem, last_char) { stem + ICHIDAN_ENDINGS[last_char] }, 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/te.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 |