Class: Daidai::Deinflection
- Inherits:
-
Struct
- Object
- Struct
- Daidai::Deinflection
- Defined in:
- lib/daidai/deinflector.rb
Overview
A single deinflection candidate: a base-form ‘term` reached from the input by applying `inflections` (transform names, ordered from the surface form inward to the dictionary form). `dictionary_form?` is true when the rule chain lands on a recognised dictionary form (a likely real lemma), useful for callers without their own dictionary to look the term up in.
Daidai.deinflect("食べてる") # candidate base forms, each with named inflections;
# one is #<Daidai::Deinflection 食べる [-いる, -て]>
Instance Attribute Summary collapse
-
#dictionary_form ⇒ Object
Returns the value of attribute dictionary_form.
-
#inflections ⇒ Object
Returns the value of attribute inflections.
-
#term ⇒ Object
Returns the value of attribute term.
Instance Method Summary collapse
Instance Attribute Details
#dictionary_form ⇒ Object
Returns the value of attribute dictionary_form
14 15 16 |
# File 'lib/daidai/deinflector.rb', line 14 def dictionary_form @dictionary_form end |
#inflections ⇒ Object
Returns the value of attribute inflections
14 15 16 |
# File 'lib/daidai/deinflector.rb', line 14 def inflections @inflections end |
#term ⇒ Object
Returns the value of attribute term
14 15 16 |
# File 'lib/daidai/deinflector.rb', line 14 def term @term end |
Instance Method Details
#dictionary_form? ⇒ Boolean
15 |
# File 'lib/daidai/deinflector.rb', line 15 def dictionary_form? = dictionary_form |
#inspect ⇒ Object
19 |
# File 'lib/daidai/deinflector.rb', line 19 def inspect = "#<Daidai::Deinflection #{self}>" |
#to_s ⇒ Object
17 |
# File 'lib/daidai/deinflector.rb', line 17 def to_s = inflections.empty? ? term : "#{term} [#{inflections.join(", ")}]" |