lib/ting/tones/ipa.rb in ting-0.2.1 vs lib/ting/tones/ipa.rb in ting-0.3.0

- old
+ new

@@ -1,5 +1,7 @@ +# coding: utf-8 + module Ting module Tones class Ipa < Tone class <<self @@ -8,10 +10,12 @@ def add_tone(syll,tone) syll + GLYPHS[normalize(tone) % 5] end def peek_tone(syll) - return t if t = GLYPHS.index(syll.chars[-1]) + if t = GLYPHS.index(syll.uchars[-1]) + return t + end return NEUTRAL_TONE end def pop_tone(syll) [ peek_tone(syll), syll[/\A[^#{GLYPHS.join}]+/] ]