Class: RMMSeg::Ferret::Tokenizer
- Inherits:
-
Ferret::Analysis::TokenStream
- Object
- Ferret::Analysis::TokenStream
- RMMSeg::Ferret::Tokenizer
- Defined in:
- lib/rmmseg/ferret.rb
Overview
The Tokenizer tokenize text with RMMSeg::Algorithm.
Instance Method Summary collapse
-
#initialize(str) ⇒ Tokenizer
constructor
Create a new Tokenizer to tokenize
text
. -
#next ⇒ Object
Get next token.
-
#text ⇒ Object
Get the text being tokenized.
-
#text=(str) ⇒ Object
Set the text to be tokenized.
Constructor Details
#initialize(str) ⇒ Tokenizer
Create a new Tokenizer to tokenize text
36 37 38 |
# File 'lib/rmmseg/ferret.rb', line 36 def initialize(str) self.text = str end |
Instance Method Details
#next ⇒ Object
Get next token
41 42 43 |
# File 'lib/rmmseg/ferret.rb', line 41 def next @algor.next_token end |
#text ⇒ Object
Get the text being tokenized
46 47 48 |
# File 'lib/rmmseg/ferret.rb', line 46 def text @text end |
#text=(str) ⇒ Object
Set the text to be tokenized
51 52 53 54 55 |
# File 'lib/rmmseg/ferret.rb', line 51 def text=(str) @text = str @algor = RMMSeg::Config.algorithm_instance(@text, ::Ferret::Analysis::Token) end |