#ifndef _lucene_analysis_snowball_analyser_
#define _lucene_analysis_snowball_analyser_

#if defined(_LUCENE_PRAGMA_ONCE)
# pragma once
#endif

#include "CLucene/util/Reader.h"
#include "CLucene/analysis/AnalysisHeader.h"
#include "CLucene/analysis/Analyzers.h"
#include "CLucene/analysis/standard/StandardFilter.h"
#include "CLucene/analysis/standard/StandardTokenizer.h"
#include "CLucene/util/Misc.h"

CL_NS_DEF2(analysis,snowball)

/** Filters {@link StandardTokenizer} with {@link StandardFilter}, {@link
 * LowerCaseFilter}, {@link StopFilter} and {@link SnowballFilter}.
 *
 * 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".
 */
class SnowballAnalyzer: public Analyzer {
  const TCHAR* language;
  CL_NS(util)::CLSetList<TCHAR*>* stopSet;

public:
  /** Builds the named analyzer with no stop words. */
  SnowballAnalyzer(const TCHAR* language=_T("english"));

  /** Builds the named analyzer with the given stop words.
  */
  SnowballAnalyzer(const TCHAR* language, TCHAR** stopWords);

  ~SnowballAnalyzer();

  /** Constructs a {@link StandardTokenizer} filtered by a {@link
      StandardFilter}, a {@link LowerCaseFilter} and a {@link StopFilter}. */
  TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader);
};

CL_NS_END2
#endif

