Class: GetSyllablesService
- Inherits:
-
Object
- Object
- GetSyllablesService
- Defined in:
- lib/services/get_syllables_service.rb
Constant Summary collapse
- VOCALIC_PHONEMS_REGEXP =
/[ɛøαϵiaoɔσyuœπe]/
- GLIDES_REGEXP =
/[µwj]/
Instance Attribute Summary collapse
-
#phonetic_text ⇒ Object
readonly
Returns the value of attribute phonetic_text.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(phonetic_text) ⇒ GetSyllablesService
constructor
A new instance of GetSyllablesService.
Constructor Details
#initialize(phonetic_text) ⇒ GetSyllablesService
Returns a new instance of GetSyllablesService.
8 9 10 |
# File 'lib/services/get_syllables_service.rb', line 8 def initialize(phonetic_text) @phonetic_text = phonetic_text end |
Instance Attribute Details
#phonetic_text ⇒ Object (readonly)
Returns the value of attribute phonetic_text.
6 7 8 |
# File 'lib/services/get_syllables_service.rb', line 6 def phonetic_text @phonetic_text end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 |
# File 'lib/services/get_syllables_service.rb', line 12 def call get_pairs_for(phonetic_text).map do |word_pairs| get_syllables_for(word_pairs) end.flatten.reject(&:blank?) end |