Package org.apache.lucene.analysis

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


    private TermAttribute termAtt;
   
    public ChineseFilter(TokenStream in) {
        super(in);

        stopTable = new CharArraySet(Arrays.asList(STOP_WORDS), false);
        termAtt = addAttribute(TermAttribute.class);
    }
View Full Code Here


  public void setArticles(Set<?> articles) {
    if (articles instanceof CharArraySet)
      this.articles = (CharArraySet) articles;
    else
      this.articles = new CharArraySet(articles, true);
  }
View Full Code Here

  /**
   * Constructs an elision filter with standard stop words
   */
  protected ElisionFilter(TokenStream input) {
    super(input);
    this.articles = new CharArraySet(Arrays.asList(
        "l", "m", "t", "qu", "n", "s", "j"), true);
    termAtt = addAttribute(TermAttribute.class);
  }
View Full Code Here

  /**
   * Constructs an elision filter with an array of stop words
   */
  public ElisionFilter(TokenStream input, String[] articles) {
    super(input);
    this.articles = new CharArraySet(Arrays.asList(articles), true);
    termAtt = addAttribute(TermAttribute.class);
  }
View Full Code Here

    this.onlyLongestMatch=onlyLongestMatch;
   
    if (dictionary instanceof CharArraySet) {
      this.dictionary = (CharArraySet) dictionary;
    } else {
      this.dictionary = new CharArraySet(dictionary.size(), false);
      addAllLowerCase(this.dictionary, dictionary);
    }
   
    termAtt = addAttribute(TermAttribute.class);
    offsetAtt = addAttribute(OffsetAttribute.class);
View Full Code Here

   * @param dictionary
   * @return {@link Set} of lowercased terms
   */
  public static final Set makeDictionary(final String[] dictionary) {
    // is the below really case insensitive?
    CharArraySet dict = new CharArraySet(dictionary.length, false);
    addAllLowerCase(dict, Arrays.asList(dictionary));
    return dict;
  }
View Full Code Here

        stopWords = getWordSet(loader, stopWordFiles, ignoreCase);
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    } else {
      stopWords = new CharArraySet(luceneMatchVersion, StopAnalyzer.ENGLISH_STOP_WORDS_SET, ignoreCase);
    }
  }
View Full Code Here

        stopWords = getWordSet(loader, stopWordFiles, ignoreCase);
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    } else {
      stopWords = new CharArraySet(luceneMatchVersion, StopAnalyzer.ENGLISH_STOP_WORDS_SET, ignoreCase);
    }
  }
View Full Code Here

  /**
   * Set the keep word list.
   * NOTE: if ignoreCase==true, the words are expected to be lowercase
   */
  public void setWords(Set<String> words) {
    this.words = new CharArraySet(luceneMatchVersion, words, ignoreCase);
  }
View Full Code Here

    this.words = new CharArraySet(luceneMatchVersion, words, ignoreCase);
  }

  public void setIgnoreCase(boolean ignoreCase) {   
    if (words != null && this.ignoreCase != ignoreCase) {
      words = new CharArraySet(luceneMatchVersion, words, ignoreCase);
    }
    this.ignoreCase = ignoreCase;
  }
View Full Code Here

TOP

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

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.