00001 /*========================================================================== 00002 * Copyright (c) 2003-2004 University of Massachusetts. All Rights Reserved. 00003 * 00004 * Use of the Lemur Toolkit for Language Modeling and Information Retrieval 00005 * is subject to the terms of the software license set forth in the LICENSE 00006 * file included with this software, and also available at 00007 * http://www.lemurproject.org/license.html 00008 * 00009 *========================================================================== 00010 */ 00011 00012 00013 // 00014 // StopperTransformation 00015 // 00016 // 13 May 2004 -- tds 00017 // 00018 00019 #ifndef INDRI_STOPPERTRANSFORMATION_HPP 00020 #define INDRI_STOPPERTRANSFORMATION_HPP 00021 00022 #include "indri/Transformation.hpp" 00023 #include <string> 00024 #include <vector> 00025 #include "string-set.h" 00026 #include "indri/Parameters.hpp" 00027 00028 class StopperTransformation : public Transformation { 00029 private: 00030 ObjectHandler<ParsedDocument>* _handler; 00031 String_set* _table; 00032 00033 public: 00034 StopperTransformation(); 00035 StopperTransformation( const std::vector<std::string>& stopwords ); 00036 StopperTransformation( const std::vector<const char*>& stopwords ); 00037 StopperTransformation( const std::vector<char*>& stopwords ); 00038 StopperTransformation( Parameters& stopwords ); 00039 ~StopperTransformation(); 00040 00041 void read( const std::vector<std::string>& stopwords ); 00042 void read( const std::vector<const char*>& stopwords ); 00043 void read( const std::vector<char*>& stopwords ); 00044 void read( const std::string& filename ); 00045 void read( Parameters& stopwords ); 00046 00047 ParsedDocument* transform( ParsedDocument* document ); 00048 00049 void handle( ParsedDocument* document ); 00050 void setHandler( ObjectHandler<ParsedDocument>& handler ); 00051 }; 00052 00053 #endif // INDRI_STOPPERTRANSFORMATION_HPP 00054