public override TokenStream ReusableTokenStream(string fieldName, TextReader reader)
{
SavedStreams streams = (SavedStreams)PreviousTokenStream;
if (streams == null)
{
streams = new SavedStreams();
streams.Source = new ArabicLetterTokenizer(reader);
streams.Result = new LowerCaseFilter(streams.Source);
// the order here is important: the stopword list is not normalized!
streams.Result = new StopFilter(StopFilter.GetEnablePositionIncrementsVersionDefault(matchVersion),
streams.Result, stoptable);
streams.Result = new ArabicNormalizationFilter(streams.Result);
streams.Result = new ArabicStemFilter(streams.Result);
PreviousTokenStream = streams;
}
else
{
streams.Source.Reset(reader);
}
return streams.Result;
}
}