class Ting::Tones::Numbers

Public Class Methods

add_tone(syll, tone) click to toggle source
# File lib/ting/tones/numbers.rb, line 6
def add_tone(syll, tone)
  syll + normalize(tone).to_s
end
peek_tone(syll) click to toggle source
# File lib/ting/tones/numbers.rb, line 10
def peek_tone(syll)
  if syll =~ /(\d)\Z/
    normalize Integer($1)
  else
    NEUTRAL_TONE
  end
end
pop_tone(syll) click to toggle source
# File lib/ting/tones/numbers.rb, line 18
def pop_tone(syll)
  [ peek_tone(syll), syll[/\A\D+/] ]
end