public TokenStream create(TokenStream tokenStream) {
final Version version = this.version == Version.LUCENE_4_3 ? Version.LUCENE_4_4 : this.version; // we supported it since 4.3
if (version.onOrAfter(Version.LUCENE_4_3)) {
return new NGramTokenFilter(tokenStream, minGram, maxGram);
} else {
return new Lucene43NGramTokenFilter(tokenStream, minGram, maxGram);
}
}