Sha256: dbeb302622392cf482c9c6969b3af29df3040652494e145760fa8de7ce10db29

Contents?: true

Size: 433 Bytes

Versions: 3

Compression:

Stored size: 433 Bytes

Contents

module Ting
  module Tones
    class Numbers < Tone
      class <<self

      def add_tone(syll, tone)
        syll + normalize(tone).to_s
      end

      def peek_tone(syll)
        if syll =~ /(\d)\Z/
          normalize Integer($1)
        else
          NEUTRAL_TONE
        end
      end      

      def pop_tone(syll)
        [ peek_tone(syll), syll[/\A\D+/] ]
      end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ting-0.3.0 lib/ting/tones/numbers.rb
ting-0.2.1 lib/ting/tones/numbers.rb
ting-0.2.0 lib/ting/tones/numbers.rb