Class: TwitterCldr::Tokenizers::PatternTokenizer
- Inherits:
-
Object
- Object
- TwitterCldr::Tokenizers::PatternTokenizer
- Defined in:
- lib/twitter_cldr/tokenizers/pattern_tokenizer.rb
Instance Attribute Summary collapse
-
#data_reader ⇒ Object
readonly
Returns the value of attribute data_reader.
-
#tokenizer ⇒ Object
readonly
Returns the value of attribute tokenizer.
Instance Method Summary collapse
-
#initialize(data_reader, tokenizer) ⇒ PatternTokenizer
constructor
A new instance of PatternTokenizer.
- #tokenize(pattern) ⇒ Object
Constructor Details
#initialize(data_reader, tokenizer) ⇒ PatternTokenizer
Returns a new instance of PatternTokenizer.
12 13 14 15 |
# File 'lib/twitter_cldr/tokenizers/pattern_tokenizer.rb', line 12 def initialize(data_reader, tokenizer) @data_reader = data_reader @tokenizer = tokenizer end |
Instance Attribute Details
#data_reader ⇒ Object (readonly)
Returns the value of attribute data_reader.
10 11 12 |
# File 'lib/twitter_cldr/tokenizers/pattern_tokenizer.rb', line 10 def data_reader @data_reader end |
#tokenizer ⇒ Object (readonly)
Returns the value of attribute tokenizer.
10 11 12 |
# File 'lib/twitter_cldr/tokenizers/pattern_tokenizer.rb', line 10 def tokenizer @tokenizer end |
Instance Method Details
#tokenize(pattern) ⇒ Object
17 18 19 |
# File 'lib/twitter_cldr/tokenizers/pattern_tokenizer.rb', line 17 def tokenize(pattern) tokenizer.tokenize((pattern)) end |