Package org.apache.lucene.analysis

Examples of org.apache.lucene.analysis.CharArraySet$CharArraySetIterator


      this.enablePositionIncrements = enablePositionIncrements;
    }
    @Override
    public TokenStream tokenStream(String fieldName, Reader reader) {
      TokenStream ts = a.tokenStream(fieldName,reader);
      return new StopFilter(enablePositionIncrements, ts, new CharArraySet(Collections.singleton("stop"), true));
    }
View Full Code Here


    assertAnalyzesTo(a, "był", new String[] {});
  }
 
  /** test use of exclusion set */
  public void testExclude() throws IOException {
    CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("studenta"), false);;
    Analyzer a = new PolishAnalyzer(TEST_VERSION_CURRENT,
        PolishAnalyzer.getDefaultStopSet(), exclusionSet);
    checkOneTermReuse(a, "studenta", "studenta");
    checkOneTermReuse(a, "studenci", "student");
  }
View Full Code Here

    }
    @Override
    public TokenStream tokenStream(String fieldName, Reader reader) {
      TokenStream ts = a.tokenStream(fieldName,reader);
      return new StopFilter(enablePositionIncrements?TEST_VERSION_CURRENT:Version.LUCENE_24, ts,
          new CharArraySet(TEST_VERSION_CURRENT, Collections.singleton("stop"), true));
    }
View Full Code Here

    this.onlyLongestMatch=onlyLongestMatch;
   
    if (dictionary==null || dictionary instanceof CharArraySet) {
      this.dictionary = (CharArraySet) dictionary;
    } else {
      this.dictionary = new CharArraySet(matchVersion, dictionary, true);
    }
  }
View Full Code Here

  @Deprecated
  public static CharArraySet makeDictionary(final Version matchVersion, final String[] dictionary) {
    if (dictionary == null) {
      return null;
    }
    return new CharArraySet(matchVersion, Arrays.asList(dictionary), true);
  }
View Full Code Here

    }
    @Override
    public TokenStream tokenStream(String fieldName, Reader reader) {
      TokenStream ts = a.tokenStream(fieldName,reader);
      return new StopFilter(enablePositionIncrements?TEST_VERSION_CURRENT:Version.LUCENE_24, ts,
          new CharArraySet(TEST_VERSION_CURRENT, Collections.singleton("stop"), true));
    }
View Full Code Here

    this.onlyLongestMatch=onlyLongestMatch;
   
    if (dictionary==null || dictionary instanceof CharArraySet) {
      this.dictionary = (CharArraySet) dictionary;
    } else {
      this.dictionary = new CharArraySet(matchVersion, dictionary, true);
    }
  }
View Full Code Here

  @Deprecated
  public static CharArraySet makeDictionary(final Version matchVersion, final String[] dictionary) {
    if (dictionary == null) {
      return null;
    }
    return new CharArraySet(matchVersion, Arrays.asList(dictionary), true);
  }
View Full Code Here

   * @param word Word to find the stems for
   * @return List of stems for the word
   */
  public List<Stem> uniqueStems(char word[], int length) {
    List<Stem> stems = new ArrayList<Stem>();
    CharArraySet terms = new CharArraySet(dictionary.getVersion(), 8, dictionary.isIgnoreCase());
    if (dictionary.lookupWord(word, 0, length) != null) {
      stems.add(new Stem(word, length));
      terms.add(word);
    }
    List<Stem> otherStems = stem(word, length, null, 0);
    for (Stem s : otherStems) {
      if (!terms.contains(s.stem)) {
        stems.add(s);
        terms.add(s.stem);
      }
    }
    return stems;
  }
View Full Code Here

      final Class<? extends ReusableAnalyzerBase> aClass, final String resource,
      final String comment) throws IOException {
    Reader reader = null;
    try {
      reader = IOUtils.getDecodingReader(aClass.getResourceAsStream(resource), IOUtils.CHARSET_UTF_8);
      return WordlistLoader.getWordSet(reader, comment, new CharArraySet(Version.LUCENE_31, 16, ignoreCase));
    } finally {
      IOUtils.close(reader);
    }
   
  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.analysis.CharArraySet$CharArraySetIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.