Sha256: 01ab59e4eb288df68741a1efe9ce58492631666bdb7c17912418b404d759ef41
Contents?: true
Size: 643 Bytes
Versions: 21
Compression:
Stored size: 643 Bytes
Contents
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 module TwitterCldr module Segmentation class Cursor attr_reader :text, :codepoints attr_accessor :position def initialize(text) @text = text @codepoints = text.codepoints reset end def advance(amount = 1) @position += amount end def reset @position = 0 end def eos? position >= text.size end def codepoint(pos = @position) codepoints[pos] end def length text.length end end end end
Version data entries
21 entries across 21 versions & 1 rubygems