Sha256: 5b1ba68c2db2568430ec4b3030303099ed6cbe4865b5077170f3cb6b00496e4c

Contents?: true

Size: 408 Bytes

Versions: 4

Compression:

Stored size: 408 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

4 entries across 4 versions & 1 rubygems

Version Path
ting-0.12.0 lib/ting/tones/numbers.rb
ting-0.11.0 lib/ting/tones/numbers.rb
ting-0.10.0 lib/ting/tones/numbers.rb
ting-0.9.0 lib/ting/tones/numbers.rb