Example usage for org.apache.lucene.analysis WordlistLoader getWordSet

List of usage examples for org.apache.lucene.analysis WordlistLoader getWordSet

Introduction

In this page you can find the example usage for org.apache.lucene.analysis WordlistLoader getWordSet.

Prototype

public static CharArraySet getWordSet(Reader reader, String comment, CharArraySet result) throws IOException 

Source Link

Document

Reads lines from a Reader and adds every non-comment line as an entry to a CharArraySet (omitting leading and trailing whitespace).

Usage

From source file:org.opencms.search.galleries.CmsGallerySearchAnalyzer.java

License:Open Source License

/**
 * Constructor with version parameter.<p>
 * /*from ww w.j a va 2s .c o  m*/
 * @param version the Lucene standard analyzer version to match
  * @throws IOException 
 */
public CmsGallerySearchAnalyzer(Version version) throws IOException {

    // initialize superclass
    super(version,
            WordlistLoader.getWordSet(
                    new BufferedReader(new InputStreamReader(
                            CmsGallerySearchAnalyzer.class.getResourceAsStream("stopwords_multilanguage.txt"))),
                    "#", CmsSearchIndex.LUCENE_VERSION));
}