lib/ting/tones/accents.rb in ting-0.2.1 vs lib/ting/tones/accents.rb in ting-0.3.0
- old
+ new
@@ -1,5 +1,7 @@
+# coding: utf-8
+
module Ting
module Tones
class Accents < Tone
class <<self
@@ -20,15 +22,20 @@
def add_tone(syll, tone)
syll.gsub!('ΓΌ','v')
tone %= MAX_TONE
case syll
- when /a/ : syll.sub(/a/, tone_glyph(:a,tone))
- when /e/ : syll.sub(/e/, tone_glyph(:e,tone))
- when /o/ : syll.sub(/o/, tone_glyph(:o,tone))
- when /(i|u|v)/ : syll.sub($1, tone_glyph($1,tone))
- else syll
+ when /a/
+ syll.sub(/a/, tone_glyph(:a,tone))
+ when /e/
+ syll.sub(/e/, tone_glyph(:e,tone))
+ when /o/
+ syll.sub(/o/, tone_glyph(:o,tone))
+ when /(i|u|v)/
+ syll.sub($1, tone_glyph($1,tone))
+ else
+ syll
end
end
def peek_tone(syll)
unpacked = syll.unpack('U*')
@@ -54,9 +61,9 @@
vowel, tones = v, UNICODE_TONE_GLYPHS[v]
yield vowel,tones
end
end
- end
+ end
end
end
end