Class: Textoken::Exclude
- Inherits:
-
Object
- Object
- Textoken::Exclude
- Includes:
- ConditionalOption
- Defined in:
- lib/textoken/options/exclude.rb
Overview
This option object excludes words in text via matching regexp Non-excluded words pushed to findings array
Direct Known Subclasses
Instance Attribute Summary
Attributes included from ConditionalOption
Instance Method Summary collapse
-
#tokenize(base) ⇒ Object
base.text is raw tokens splitted with ‘ ’ values are Regexps array to search base.findings, Findings object for pushing matching tokens.
Methods included from ConditionalOption
#initialize, #priority, #tokenize_if
Instance Method Details
#tokenize(base) ⇒ Object
base.text is raw tokens splitted with ‘ ’ values are Regexps array to search base.findings, Findings object for pushing matching tokens
10 11 12 13 |
# File 'lib/textoken/options/exclude.rb', line 10 def tokenize(base) @base = base tokenize_if { |word, regexp| !word.match(regexp) } end |