📄 snowballfilter.h
字号:
#ifndef _lucene_analysis_snowball_filter_
#define _lucene_analysis_snowball_filter_
#if defined(_LUCENE_PRAGMA_ONCE)
# pragma once
#endif
#include "CLucene/util/Reader.h"
#include "CLucene/analysis/AnalysisHeader.h"
#include "CLucene/util/Misc.h"
#include "libstemmer.h"
CL_NS_DEF2(analysis,snowball)
/** A filter that stems words using a Snowball-generated stemmer.
*
* Available stemmers are listed in {@link net.sf.snowball.ext}. The name of a
* stemmer is the part of the class name before "Stemmer", e.g., the stemmer in
* {@link EnglishStemmer} is named "English".
*
* Note: todo: This is not thread safe...
*/
class SnowballFilter: public TokenFilter {
struct sb_stemmer * stemmer;
public:
/** Construct the named stemming filter.
*
* @param in the input tokens to stem
* @param name the name of a stemmer
*/
SnowballFilter(TokenStream* in, const TCHAR* language, bool deleteTS);
~SnowballFilter();
/** Returns the next input Token, after being stemmed */
bool next(Token* token);
};
CL_NS_END2
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -