Class: TwitterCldr::Segmentation::BrahmicBreakEngine::EngineState

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_cldr/segmentation/brahmic_break_engine.rb

Overview

ICU keeps track of all these variables inline, but since we’ve done a bit of method separating (see below), it’s too ugly to pass all of them around as arguments. Instead we encapsulate them all in this handy state object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ EngineState

Returns a new instance of EngineState.



24
25
26
27
28
29
# File 'lib/twitter_cldr/segmentation/brahmic_break_engine.rb', line 24

def initialize(options = {})
  @current = options.fetch(:current, 0)
  @words = options.fetch(:words)
  @words_found = options.fetch(:words_found, 0)
  @word_length = options.fetch(:word_length, 0)
end

Instance Attribute Details

#currentObject

Returns the value of attribute current.



20
21
22
# File 'lib/twitter_cldr/segmentation/brahmic_break_engine.rb', line 20

def current
  @current
end

#word_lengthObject

Returns the value of attribute word_length.



22
23
24
# File 'lib/twitter_cldr/segmentation/brahmic_break_engine.rb', line 22

def word_length
  @word_length
end

#wordsObject (readonly)

Returns the value of attribute words.



21
22
23
# File 'lib/twitter_cldr/segmentation/brahmic_break_engine.rb', line 21

def words
  @words
end

#words_foundObject

Returns the value of attribute words_found.



22
23
24
# File 'lib/twitter_cldr/segmentation/brahmic_break_engine.rb', line 22

def words_found
  @words_found
end