lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Furkan KAMACI <furkankam...@gmail.com>
Subject Analyzer Does Not Works As Accepted
Date Wed, 26 Feb 2014 18:05:52 GMT
Hi;

I have impelented that custom Analyzer:

public class DisambiguatorAnalyzer extends Analyzer {

   Version version = Version.LUCENE_46;
   List<String> stopWordList;

   public DisambiguatorAnalyzer(List<String> stopWordList) throws
IOException {
      super();
      this.stopWordList = stopWordList;
   }

   @Override
   protected TokenStreamComponents createComponents(String fieldName,
Reader reader) {
      Tokenizer source = new WhitespaceTokenizer(version, reader);
      int flags = GENERATE_WORD_PARTS | CATENATE_WORDS;
      TokenStream filter = new WordDelimiterFilter(source,
WordDelimiterIterator.DEFAULT_WORD_DELIM_TABLE, flags, null);
      filter = new StopFilter(version, filter,
StopFilter.makeStopSet(version, stopWordList));
      filter = new TurkishLowerCaseFilter(filter);
      return new TokenStreamComponents(source, filter);
   }
}

However it preserve originals and does not remove Stopwords. What maybe the
wrong?

Thanks;
Furkan KAMACI

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message