class Ting::Tones::Ipa

Constants

GLYPHS

Public Class Methods

add_tone(syll,tone) click to toggle source
# File lib/ting/tones/ipa.rb, line 10
def add_tone(syll,tone)
  syll + GLYPHS[normalize(tone) % 5]
end
peek_tone(syll) click to toggle source
# File lib/ting/tones/ipa.rb, line 14
def peek_tone(syll)
  if t = GLYPHS.index(syll.chars.last)
    return t
  end
  return NEUTRAL_TONE
end
pop_tone(syll) click to toggle source
# File lib/ting/tones/ipa.rb, line 21
def pop_tone(syll)
  [ peek_tone(syll), syll[/\A[^#{GLYPHS.join}]+/] ]
end