Class: SClust::Util::DocumentTermFilter
- Defined in:
- lib/sclust/util/filters.rb
Overview
Filters a document term
Instance Method Summary collapse
-
#filter(term) ⇒ Object
Return nil if the term should be excluded.
-
#initialize ⇒ DocumentTermFilter
constructor
A new instance of DocumentTermFilter.
Methods inherited from Filter
Constructor Details
#initialize ⇒ DocumentTermFilter
Returns a new instance of DocumentTermFilter.
185 186 187 188 189 190 191 |
# File 'lib/sclust/util/filters.rb', line 185 def initialize() super() after(LowercaseFilter.new()) after(StopwordFilter.new()) after(TrimWhitespace.new()) #after(StemFilter.new()) end |
Instance Method Details
#filter(term) ⇒ Object
Return nil if the term should be excluded. Otherwise the version of the term that should be included is returned.
195 196 197 198 199 200 201 |
# File 'lib/sclust/util/filters.rb', line 195 def filter(term) if ( term =~ /^[\d\.]+$/ ) nil else term end end |