Class: Langue::Word
- Inherits:
-
Array
- Object
- Array
- Langue::Word
show all
- Defined in:
- lib/langue/word.rb
Instance Method Summary
collapse
Instance Method Details
#inflection ⇒ Object
21
22
23
24
|
# File 'lib/langue/word.rb', line 21
def inflection
@inflection = value_in_key_morpheme(:inflection) unless instance_variable_defined?(:@inflection)
@inflection
end
|
#inflection_type ⇒ Object
26
27
28
29
|
# File 'lib/langue/word.rb', line 26
def inflection_type
@inflection_type = value_in_key_morpheme(:inflection_type) unless instance_variable_defined?(:@inflection_type)
@inflection_type
end
|
#morphemes ⇒ Object
10
11
12
|
# File 'lib/langue/word.rb', line 10
def morphemes
@morphemes ||= Morphemes.new(self)
end
|
#pronunciation ⇒ Object
41
42
43
44
|
# File 'lib/langue/word.rb', line 41
def pronunciation
@pronunciation = join_values(:pronunciation) unless instance_variable_defined?(:@pronunciation)
@pronunciation
end
|
31
32
33
34
|
# File 'lib/langue/word.rb', line 31
def root_form
@root_form = not_empty? { self[0..-2].map(&:text) + self[-1, 1].map(&:root_form) } unless instance_variable_defined?(:@root_form)
@root_form
end
|
#text ⇒ Object
16
17
18
19
|
# File 'lib/langue/word.rb', line 16
def text
@text = not_empty? { map(&:text) } unless instance_variable_defined?(:@text)
@text
end
|
#valid? ⇒ Boolean
6
7
8
|
# File 'lib/langue/word.rb', line 6
def valid?
all? { |morpheme| Morpheme === morpheme }
end
|
#yomi ⇒ Object
36
37
38
39
|
# File 'lib/langue/word.rb', line 36
def yomi
@yomi = join_values(:yomi) unless instance_variable_defined?(:@yomi)
@yomi
end
|