Class: Pslm::LatexOutputter::BreakHintsFormatter

Inherits:
Formatter
  • Object
show all
Defined in:
lib/pslm/latexoutputter.rb

Overview

inserts break hints between syllables

Instance Method Summary collapse

Methods inherited from Formatter

format, #initialize, #part_format, #psalm_format, #strophe_format, #verse_format, #word_format

Constructor Details

This class inherits a constructor from Pslm::LatexOutputter::Formatter

Instance Method Details

#syllable_format(text, syll, word, part, verse, strophe, psalm) ⇒ Object



257
258
259
260
261
262
263
264
# File 'lib/pslm/latexoutputter.rb', line 257

def syllable_format(text, syll, word, part, verse, strophe, psalm)
  unless syll == word.syllables.last or
      (word.syllables.size >= 2 and syll == word.syllables[-2] and word.syllables[-1] =~ /^[\.,!?]+$/)
    return text + '\-'
  else
    return text
  end
end