From 8e6c5fa321f15247d380967304972ccea7cbf019 Mon Sep 17 00:00:00 2001 From: Gibheer Date: Fri, 10 Jun 2011 15:29:31 +0200 Subject: [PATCH] remove the abstract stemmer class, because we only need an interface --- lib/polecat/stemmer.rb | 25 ------------------------- spec/stemmer/new_spec.rb | 8 -------- spec/stemmer/stem_spec.rb | 13 ------------- 3 files changed, 46 deletions(-) delete mode 100644 lib/polecat/stemmer.rb delete mode 100644 spec/stemmer/new_spec.rb delete mode 100644 spec/stemmer/stem_spec.rb diff --git a/lib/polecat/stemmer.rb b/lib/polecat/stemmer.rb deleted file mode 100644 index e057f75..0000000 --- a/lib/polecat/stemmer.rb +++ /dev/null @@ -1,25 +0,0 @@ -module Polecat - # abstract class for stemmer - # - # This class can be used for inheritence for your own stemmer. - # A stemmer is responsible to convert an document into an array of fragments - # which then merged with the index. As every document can be built of - # different words and fragments, the stemmer is very important to get the - # best result when searching. - # - # Be warned, that you use the same stemmer for the index as for the search - # input! - # - # To build your own stemmer implement the methods #stem and #result. - class Stemmer - # stems the word - # - # This method changes the word into a form, which get's interted into the - # index. - # @param [Object] word word to stem - # @return [Object] the stemmed variant of the word or the same object - def stem word - raise NotImplementedError, 'please implement #stem' - end - end -end diff --git a/spec/stemmer/new_spec.rb b/spec/stemmer/new_spec.rb deleted file mode 100644 index a1c6135..0000000 --- a/spec/stemmer/new_spec.rb +++ /dev/null @@ -1,8 +0,0 @@ -require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') - -describe "Stemmer#new" do - it "creates a new stemmer" do - s = Polecat::Stemmer.new - s.class.should be(Polecat::Stemmer) - end -end diff --git a/spec/stemmer/stem_spec.rb b/spec/stemmer/stem_spec.rb deleted file mode 100644 index e2828e5..0000000 --- a/spec/stemmer/stem_spec.rb +++ /dev/null @@ -1,13 +0,0 @@ -require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') - -describe "Stemmer#stem" do - let (:s) { Polecat::Stemmer.new } - - it "takes one argument" do - s.method(:stem).arity.should == 1 - end - - it "raises an error, because it's an abstract class" do - lambda { s.stem "word" }.should raise_error(NotImplementedError) - end -end