Class: Kotoshu::Algorithms::Lookup::CompoundForm
- Inherits:
-
Object
- Object
- Kotoshu::Algorithms::Lookup::CompoundForm
- Defined in:
- lib/kotoshu/algorithms/lookup.rb
Overview
CompoundForm is a hypothesis of how some word could be split into several AffixForms (word parts with their own stems and possible affixes).
Typically, only first part is allowed to have prefix, and only last part is allowed to have suffix, but there are languages where middle parts can have affixes too, specified by special flags.
Instance Attribute Summary collapse
-
#parts ⇒ Array<AffixForm>
readonly
Parts of the compound word.
Instance Method Summary collapse
-
#initialize(parts) ⇒ CompoundForm
constructor
A new instance of CompoundForm.
-
#to_s ⇒ String
(also: #inspect)
String representation.
Constructor Details
#initialize(parts) ⇒ CompoundForm
Returns a new instance of CompoundForm.
153 154 155 |
# File 'lib/kotoshu/algorithms/lookup.rb', line 153 def initialize(parts) @parts = parts end |
Instance Attribute Details
#parts ⇒ Array<AffixForm> (readonly)
Returns Parts of the compound word.
151 152 153 |
# File 'lib/kotoshu/algorithms/lookup.rb', line 151 def parts @parts end |
Instance Method Details
#to_s ⇒ String Also known as: inspect
String representation.
160 161 162 |
# File 'lib/kotoshu/algorithms/lookup.rb', line 160 def to_s "CompoundForm(#{@parts.map(&:to_s).join(' + ')})" end |