Class: Rhopalic::Phrase
- Inherits:
-
Object
- Object
- Rhopalic::Phrase
- Defined in:
- lib/rhopalic/phrase.rb
Overview
A rhopalic phrase with all the artifacts from the rhopalic analysis.
Instance Attribute Summary collapse
-
#in_dictionary ⇒ Object
readonly
Returns the value of attribute in_dictionary.
-
#indices ⇒ Object
readonly
Returns the value of attribute indices.
-
#is_letter_rhopalic ⇒ Object
(also: #letter_rhopalic?)
readonly
Returns the value of attribute is_letter_rhopalic.
-
#is_syllable_rhopalic ⇒ Object
(also: #syllable_rhopalic?)
readonly
Returns the value of attribute is_syllable_rhopalic.
-
#phrase ⇒ Object
readonly
Returns the value of attribute phrase.
-
#syllable_counts ⇒ Object
readonly
Returns the value of attribute syllable_counts.
-
#words ⇒ Object
readonly
Returns the value of attribute words.
Instance Method Summary collapse
- #each_word ⇒ Object
-
#initialize(phrase, is_letter_rhopalic, is_syllable_rhopalic, words, indices, syllable_counts, in_dictionary) ⇒ Phrase
constructor
A new instance of Phrase.
Constructor Details
#initialize(phrase, is_letter_rhopalic, is_syllable_rhopalic, words, indices, syllable_counts, in_dictionary) ⇒ Phrase
Returns a new instance of Phrase.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rhopalic/phrase.rb', line 13 def initialize(phrase, is_letter_rhopalic, is_syllable_rhopalic, words, indices, syllable_counts, in_dictionary) @phrase = phrase @is_letter_rhopalic = is_letter_rhopalic @is_syllable_rhopalic = is_syllable_rhopalic @words = words @indices = indices @syllable_counts = syllable_counts @in_dictionary = in_dictionary end |
Instance Attribute Details
#in_dictionary ⇒ Object (readonly)
Returns the value of attribute in_dictionary.
8 9 10 |
# File 'lib/rhopalic/phrase.rb', line 8 def in_dictionary @in_dictionary end |
#indices ⇒ Object (readonly)
Returns the value of attribute indices.
8 9 10 |
# File 'lib/rhopalic/phrase.rb', line 8 def indices @indices end |
#is_letter_rhopalic ⇒ Object (readonly) Also known as: letter_rhopalic?
Returns the value of attribute is_letter_rhopalic.
8 9 10 |
# File 'lib/rhopalic/phrase.rb', line 8 def is_letter_rhopalic @is_letter_rhopalic end |
#is_syllable_rhopalic ⇒ Object (readonly) Also known as: syllable_rhopalic?
Returns the value of attribute is_syllable_rhopalic.
8 9 10 |
# File 'lib/rhopalic/phrase.rb', line 8 def is_syllable_rhopalic @is_syllable_rhopalic end |
#phrase ⇒ Object (readonly)
Returns the value of attribute phrase.
8 9 10 |
# File 'lib/rhopalic/phrase.rb', line 8 def phrase @phrase end |
#syllable_counts ⇒ Object (readonly)
Returns the value of attribute syllable_counts.
8 9 10 |
# File 'lib/rhopalic/phrase.rb', line 8 def syllable_counts @syllable_counts end |
#words ⇒ Object (readonly)
Returns the value of attribute words.
8 9 10 |
# File 'lib/rhopalic/phrase.rb', line 8 def words @words end |
Instance Method Details
#each_word ⇒ Object
24 25 26 27 28 |
# File 'lib/rhopalic/phrase.rb', line 24 def each_word words.zip(indices, syllable_counts, in_dictionary) do |args| yield args[0], args[1], args[2], args[3] end end |