本文整理汇总了Java中org.apache.lucene.analysis.LowerCaseTokenizer类的典型用法代码示例。如果您正苦于以下问题:Java LowerCaseTokenizer类的具体用法?Java LowerCaseTokenizer怎么用?Java LowerCaseTokenizer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LowerCaseTokenizer类属于org.apache.lucene.analysis包,在下文中一共展示了LowerCaseTokenizer类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: reusableTokenStream
import org.apache.lucene.analysis.LowerCaseTokenizer; //导入依赖的package包/类
/**
*
* @param fieldName
* @param reader
* @return
* @throws IOException
*/
@Override
public TokenStream reusableTokenStream(String fieldName, Reader reader) throws
IOException {
SavedStreams streams = (SavedStreams) getPreviousTokenStream();
if (streams == null) {
streams = new SavedStreams();
streams.source = new LowerCaseTokenizer(reader);
streams.result = new StopFilter(true, streams.source, stopWords, true);
// streams.result = new PorterStemFilter(streams.source);
setPreviousTokenStream(streams);
} else {
streams.source.reset(reader);
}
return streams.result;
}
开发者ID:jcrcano,项目名称:DrakkarKeel,代码行数:24,代码来源:DefaultAnalyzer.java
示例2: tokenStream
import org.apache.lucene.analysis.LowerCaseTokenizer; //导入依赖的package包/类
@Override
public final TokenStream tokenStream(String fieldName, Reader reader) {
// Apply stop words and porter stemmer using a lower-case tokenizer.
TokenStream stream = new StopFilter(new LowerCaseTokenizer(reader),
StandardAnalyzer.STOP_WORDS);
return new PorterStemFilter(stream);
}
开发者ID:igniterealtime,项目名称:Openfire,代码行数:8,代码来源:WordMatchRouter.java
示例3: tokenStream
import org.apache.lucene.analysis.LowerCaseTokenizer; //导入依赖的package包/类
@Override
public final TokenStream tokenStream(String fieldName, Reader reader) {
// Apply stop words and porter stemmer using a lower-case tokenizer.
TokenStream stream = new StopFilter(new LowerCaseTokenizer(reader),
StandardAnalyzer.STOP_WORDS);
return new PorterStemFilter(stream);
}
开发者ID:coodeer,项目名称:g3server,代码行数:8,代码来源:WordMatchRouter.java
示例4: tokenizeGloss
import org.apache.lucene.analysis.LowerCaseTokenizer; //导入依赖的package包/类
/**
* Takes a gloss-like string (text) and returns it tokenized.
* with:
* - stopwords
* - lower case
* - porter stemmer
*/
protected Set<String> tokenizeGloss( String s ) throws IOException {
Set<String> result = new HashSet<String>();
// I am affraid that I am reimplementing the StandardAnalizer...
TokenStream ts = new PorterStemFilter(
new StopFilter( true,
new LowerCaseTokenizer(
new StringReader( s ) ), stopWords, true ));
TermAttribute termAtt = ts.addAttribute(TermAttribute.class);
while ( ts.incrementToken() ) {
result.add( termAtt.term() );
}
return result;
}
开发者ID:dozed,项目名称:align-api-project,代码行数:21,代码来源:JWNLDistances.java
示例5: tokenStream
import org.apache.lucene.analysis.LowerCaseTokenizer; //导入依赖的package包/类
public TokenStream tokenStream(String fieldName, Reader reader) {
return new StopFilter(true,
new LowerCaseTokenizer(reader),
stopWords);
}
开发者ID:xuzhikethinker,项目名称:t4f-data,代码行数:6,代码来源:StopAnalyzer1.java
注:本文中的org.apache.lucene.analysis.LowerCaseTokenizer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论