本文整理汇总了Java中org.apache.lucene.analysis.WordlistLoader类的典型用法代码示例。如果您正苦于以下问题:Java WordlistLoader类的具体用法?Java WordlistLoader怎么用?Java WordlistLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WordlistLoader类属于org.apache.lucene.analysis包,在下文中一共展示了WordlistLoader类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: loadStopWordSet
import org.apache.lucene.analysis.WordlistLoader; //导入依赖的package包/类
private void loadStopWordSet() {
try (BufferedReader reader = Files.newBufferedReader(stopWordPath, Charset.forName("UTF-8"))) {
stopWords = WordlistLoader.getWordSet(reader, new CharArraySet(INITIAL_CAPACITY, ignoreCase));
lastModifed = Files.getLastModifiedTime(stopWordPath).toMillis();
} catch (Exception e) {
throw new IllegalArgumentException("Failed to read " + stopWordPath, e);
}
}
开发者ID:codelibs,项目名称:analyzers-ja,代码行数:9,代码来源:ReloadableStopFilter.java
示例2: loadKeywordSet
import org.apache.lucene.analysis.WordlistLoader; //导入依赖的package包/类
private void loadKeywordSet() {
try (BufferedReader reader = Files.newBufferedReader(keywordPath, Charset.forName("UTF-8"))) {
keywordSet = WordlistLoader.getWordSet(reader);
lastModifed = Files.getLastModifiedTime(keywordPath).toMillis();
} catch (Exception e) {
throw new IllegalArgumentException("Failed to read " + keywordPath, e);
}
}
开发者ID:codelibs,项目名称:analyzers-ja,代码行数:9,代码来源:ReloadableKeywordMarkerFilter.java
示例3: GermanAnalyzer
import org.apache.lucene.analysis.WordlistLoader; //导入依赖的package包/类
/**
* Builds an analyzer with the given stop words.
*/
public GermanAnalyzer(File stopwords) throws IOException {
stopSet = WordlistLoader.getWordSet(stopwords);
}
开发者ID:ag-csw,项目名称:ExpertFinder,代码行数:7,代码来源:GermanAnalyzer.java
示例4: setStemExclusionTable
import org.apache.lucene.analysis.WordlistLoader; //导入依赖的package包/类
/**
* Builds an exclusionlist from the words contained in the given file.
*/
public void setStemExclusionTable(File exclusionlist) throws IOException {
exclusionSet = WordlistLoader.getWordSet(exclusionlist);
}
开发者ID:ag-csw,项目名称:ExpertFinder,代码行数:7,代码来源:GermanAnalyzer.java
示例5: getLines
import org.apache.lucene.analysis.WordlistLoader; //导入依赖的package包/类
private List<String> getLines(ResourceLoader loader, String resource) throws IOException {
return WordlistLoader.getLines(loader.openResource(resource), StandardCharsets.UTF_8);
}
开发者ID:jprante,项目名称:elasticsearch-plugin-bundle,代码行数:4,代码来源:AutoPhrasingTokenFilterFactory.java
示例6: loadStopwordSet
import org.apache.lucene.analysis.WordlistLoader; //导入依赖的package包/类
/**
* Creates a CharArraySet from a file.
*
* @param stopwords
* the stopwords file to load
*
* @param matchVersion
* the Lucene version for cross version compatibility
* @return a CharArraySet containing the distinct stopwords from the given
* file
* @throws IOException
* if loading the stopwords throws an {@link IOException}
*/
public static CharArraySet loadStopwordSet(File stopwords,
Version matchVersion) throws IOException {
Reader reader = null;
try {
reader = IOUtils.getDecodingReader(stopwords, IOUtils.CHARSET_UTF_8);
return WordlistLoader.getWordSet(reader, matchVersion);
} finally {
IOUtils.close(reader);
}
}
开发者ID:flash0729,项目名称:ansj-seg-for-lucene3,代码行数:24,代码来源:StopwordsUtil.java
示例7: StandardAnalyzer
import org.apache.lucene.analysis.WordlistLoader; //导入依赖的package包/类
/**
* Builds an analyzer with the stop words from the given file.
*
* @see WordlistLoader#getWordSet(Reader, Version)
* @param matchVersion
* Lucene version to match See {@link <a href="#version">above</a>}
* @param stopwords
* File to read stop words from
* @deprecated Use {@link #StandardAnalyzer(Version, Reader)} instead.
*/
@Deprecated
public StandardAnalyzer(Version matchVersion, File stopwords) throws IOException {
this(matchVersion, WordlistLoader.getWordSet(IOUtils.getDecodingReader(stopwords,
IOUtils.CHARSET_UTF_8), matchVersion));
}
开发者ID:kolbasa,项目名称:OCRaptor,代码行数:16,代码来源:StandardAnalyzer.java
示例8: SpellWritingAnalyzer
import org.apache.lucene.analysis.WordlistLoader; //导入依赖的package包/类
/**
* Builds an analyzer which writes to the given spelling dictionary, using the
* stop words from the given file.
*
* @see WordlistLoader#getWordSet(File)
*/
public SpellWritingAnalyzer(File stopwords, SpellWriter spellWriter)
throws IOException
{
this(WordlistLoader.getWordSet(stopwords), spellWriter);
}
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:12,代码来源:SpellWritingAnalyzer.java
示例9: ClassicAnalyzer
import org.apache.lucene.analysis.WordlistLoader; //导入依赖的package包/类
/** Builds an analyzer with the stop words from the given file.
* @see WordlistLoader#getWordSet(File)
* @param matchVersion Lucene version to match See {@link
* <a href="#version">above</a>}
* @param stopwords File to read stop words from */
public ClassicAnalyzer(final Version matchVersion, final File stopwords) throws IOException {
this(matchVersion, WordlistLoader.getWordSet(stopwords));
}
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:9,代码来源:ClassicAnalyzer.java
示例10: StandardAnalyzer
import org.apache.lucene.analysis.WordlistLoader; //导入依赖的package包/类
/** Builds an analyzer with the stop words from the given file.
* @see WordlistLoader#getWordSet(File)
* @param matchVersion Lucene version to match See {@link
* <a href="#version">above</a>}
* @param stopwords File to read stop words from */
public StandardAnalyzer(final Version matchVersion, final File stopwords) throws IOException {
this(matchVersion, WordlistLoader.getWordSet(stopwords));
}
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:9,代码来源:StandardAnalyzer.java
注:本文中的org.apache.lucene.analysis.WordlistLoader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论