a simple stemmer which should work for very simple things
it should get extended in the feature to do all the stuff for english languages
This commit is contained in:
parent
8e6c5fa321
commit
9fa082d8d9
|
@ -8,5 +8,4 @@ module Polecat
|
||||||
require 'polecat/index_searcher'
|
require 'polecat/index_searcher'
|
||||||
require 'polecat/query'
|
require 'polecat/query'
|
||||||
require 'polecat/term'
|
require 'polecat/term'
|
||||||
require 'polecat/stemmer'
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,7 @@ module Polecat
|
||||||
# This class can be used for cleaning strings in the most simple way. If it
|
# This class can be used for cleaning strings in the most simple way. If it
|
||||||
# does not do, what you intent it to do, inherit from Polecat::Stemmer and
|
# does not do, what you intent it to do, inherit from Polecat::Stemmer and
|
||||||
# implement your own.
|
# implement your own.
|
||||||
class SimpleStemmer < Polecat::Stemmer
|
class SimpleStemmer
|
||||||
def stem word
|
def stem word
|
||||||
if word.class == Array
|
if word.class == Array
|
||||||
word.each {|w| self.stem w }
|
word.each {|w| self.stem w }
|
||||||
|
|
|
@ -5,8 +5,4 @@ describe Polecat::SimpleStemmer do
|
||||||
it "creates a new SimpleStemmer" do
|
it "creates a new SimpleStemmer" do
|
||||||
subject.class.should be(Polecat::SimpleStemmer)
|
subject.class.should be(Polecat::SimpleStemmer)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "is a stemmer" do
|
|
||||||
subject.kind_of?(Polecat::Stemmer).should be(true)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue