1
/*------------------------------------------------------------------------------
2
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
4
* Distributable under the terms of either the Apache License (Version 2.0) or
5
* the GNU Lesser General Public License, as specified in the COPYING file.
6
------------------------------------------------------------------------------*/
7
#ifndef _lucene_analysis_snowball_filter_
8
#define _lucene_analysis_snowball_filter_
10
#include "CLucene/analysis/AnalysisHeader.h"
11
#include "libstemmer.h"
13
CL_NS_DEF2(analysis,snowball)
15
/** A filter that stems words using a Snowball-generated stemmer.
17
* Available stemmers are listed in {@link net.sf.snowball.ext}. The name of a
18
* stemmer is the part of the class name before "Stemmer", e.g., the stemmer in
19
* {@link EnglishStemmer} is named "English".
21
* Note: todo: This is not thread safe...
23
class CLUCENE_CONTRIBS_EXPORT SnowballFilter: public TokenFilter {
24
struct sb_stemmer * stemmer;
27
/** Construct the named stemming filter.
29
* @param in the input tokens to stem
30
* @param name the name of a stemmer
32
SnowballFilter(TokenStream* in, const char* language, bool deleteTS);
36
/** Returns the next input Token, after being stemmed */
37
Token* next(Token* token);