Class: TwitterCldr::Segmentation::DictionaryBreakEngine
- Inherits:
-
Object
- Object
- TwitterCldr::Segmentation::DictionaryBreakEngine
show all
- Defined in:
- lib/twitter_cldr/segmentation/dictionary_break_engine.rb
Instance Method Summary
collapse
Instance Method Details
#each_boundary(cursor, &block) ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
|
# 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) ⇒ Object
22
23
24
|
# 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
|