Class: Kanjika::Conjugator::Te

Inherits:
Base
  • Object
show all
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

#verb

Instance Method Summary collapse

Methods inherited from Base

conjugate, #initialize

Constructor Details

This class inherits a constructor from Kanjika::Conjugator::Base

Instance Method Details

#conjugateObject



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