Class: TwitterCldr::Segmentation::BrahmicBreakEngine::EngineState
- Inherits:
-
Object
- Object
- TwitterCldr::Segmentation::BrahmicBreakEngine::EngineState
- 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
-
#current ⇒ Object
Returns the value of attribute current.
-
#word_length ⇒ Object
Returns the value of attribute word_length.
-
#words ⇒ Object
readonly
Returns the value of attribute words.
-
#words_found ⇒ Object
Returns the value of attribute words_found.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ EngineState
constructor
A new instance of EngineState.
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( = {}) @current = .fetch(:current, 0) @words = .fetch(:words) @words_found = .fetch(:words_found, 0) @word_length = .fetch(:word_length, 0) end |
Instance Attribute Details
#current ⇒ Object
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_length ⇒ Object
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 |
#words ⇒ Object (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_found ⇒ Object
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 |