Class: Rhopalic::Phrase

Inherits:
Object
  • Object
show all
Defined in:
lib/rhopalic/phrase.rb

Overview

A rhopalic phrase with all the artifacts from the rhopalic analysis.

Instance Attribute Summary collapse

Instance Method Summary collapse

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_dictionaryObject (readonly)

Returns the value of attribute in_dictionary.



8
9
10
# File 'lib/rhopalic/phrase.rb', line 8

def in_dictionary
  @in_dictionary
end

#indicesObject (readonly)

Returns the value of attribute indices.



8
9
10
# File 'lib/rhopalic/phrase.rb', line 8

def indices
  @indices
end

#is_letter_rhopalicObject (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_rhopalicObject (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

#phraseObject (readonly)

Returns the value of attribute phrase.



8
9
10
# File 'lib/rhopalic/phrase.rb', line 8

def phrase
  @phrase
end

#syllable_countsObject (readonly)

Returns the value of attribute syllable_counts.



8
9
10
# File 'lib/rhopalic/phrase.rb', line 8

def syllable_counts
  @syllable_counts
end

#wordsObject (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_wordObject



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