class TwitterCldr::Segmentation::DictionaryBreakEngine

Public Instance Methods

each_boundary(cursor, &block) click to toggle source
# File lib/twitter_cldr/segmentation/dictionary_break_engine.rb, line 10
def each_boundary(cursor, &block)
  return to_enum(__method__, cursor) unless block_given?

  stop = cursor.position

  while !cursor.eos? && word_set.include?(cursor.codepoints[stop])
    stop += 1
  end

  divide_up_dictionary_range(cursor, stop, &block)
end
word_set(*args) click to toggle source
# File lib/twitter_cldr/segmentation/dictionary_break_engine.rb, line 22
def word_set(*args)
  raise NotImplementedError, "#{__method__} must be defined in derived classes"
end

Private Instance Methods

divide_up_dictionary_range(*args) click to toggle source
# File lib/twitter_cldr/segmentation/dictionary_break_engine.rb, line 28
def divide_up_dictionary_range(*args)
  raise NotImplementedError, "#{__method__} must be defined in derived classes"
end