Class: TwitterCldr::Shared::BreakIterator

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_cldr/shared/break_iterator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(locale = TwitterCldr.locale, options = {}) ⇒ BreakIterator

Returns a new instance of BreakIterator.



12
13
14
15
# File 'lib/twitter_cldr/shared/break_iterator.rb', line 12

def initialize(locale = TwitterCldr.locale, options = {})
  @use_uli_exceptions = !!options.fetch(:use_uli_exceptions, true)
  @locale = locale
end

Instance Attribute Details

#localeObject (readonly)

Returns the value of attribute locale.



10
11
12
# File 'lib/twitter_cldr/shared/break_iterator.rb', line 10

def locale
  @locale
end

#use_uli_exceptionsObject (readonly)

Returns the value of attribute use_uli_exceptions.



10
11
12
# File 'lib/twitter_cldr/shared/break_iterator.rb', line 10

def use_uli_exceptions
  @use_uli_exceptions
end

Instance Method Details

#each_line(str, &block) ⇒ Object

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/twitter_cldr/shared/break_iterator.rb', line 25

def each_line(str, &block)
  raise NotImplementedError.new("Line segmentation is not currently supported.")
end

#each_sentence(str, &block) ⇒ Object



17
18
19
# File 'lib/twitter_cldr/shared/break_iterator.rb', line 17

def each_sentence(str, &block)
  each_boundary(str, "sentence", &block)
end

#each_word(str, &block) ⇒ Object

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/twitter_cldr/shared/break_iterator.rb', line 21

def each_word(str, &block)
  raise NotImplementedError.new("Word segmentation is not currently supported.")
end