Class: Katsuyoujin::Verb
- Inherits:
-
Object
- Object
- Katsuyoujin::Verb
- Defined in:
- lib/katsuyoujin/verb.rb
Instance Method Summary collapse
- #category ⇒ Object
- #dictionary_form ⇒ Object
- #dictionary_form_hiragana ⇒ Object
- #ending ⇒ Object
- #hiragana_ending ⇒ Object
- #hiragana_root ⇒ Object
-
#initialize(word) ⇒ Verb
constructor
A new instance of Verb.
- #irregular? ⇒ Boolean
- #root ⇒ Object
Constructor Details
Instance Method Details
#category ⇒ Object
15 16 17 |
# File 'lib/katsuyoujin/verb.rb', line 15 def category @analyzer.verb_category end |
#dictionary_form ⇒ Object
7 8 9 |
# File 'lib/katsuyoujin/verb.rb', line 7 def dictionary_form @analyzer.base_form end |
#dictionary_form_hiragana ⇒ Object
11 12 13 |
# File 'lib/katsuyoujin/verb.rb', line 11 def dictionary_form_hiragana @analyzer.base_form_hiragana end |
#ending ⇒ Object
23 24 25 |
# File 'lib/katsuyoujin/verb.rb', line 23 def ending irregular? ? dictionary_form[-2..-1] : dictionary_form[-1] end |
#hiragana_ending ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/katsuyoujin/verb.rb', line 27 def hiragana_ending case category when 'suru' then 'する' when 'kuru' then 'くる' else ending end end |
#hiragana_root ⇒ Object
39 40 41 |
# File 'lib/katsuyoujin/verb.rb', line 39 def hiragana_root dictionary_form_hiragana.chomp hiragana_ending end |
#irregular? ⇒ Boolean
19 20 21 |
# File 'lib/katsuyoujin/verb.rb', line 19 def irregular? ['kuru', 'suru'].include? category end |
#root ⇒ Object
35 36 37 |
# File 'lib/katsuyoujin/verb.rb', line 35 def root dictionary_form.chomp ending end |