本文整理汇总了Java中com.aliasi.sentences.SentenceModel类的典型用法代码示例。如果您正苦于以下问题:Java SentenceModel类的具体用法?Java SentenceModel怎么用?Java SentenceModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SentenceModel类属于com.aliasi.sentences包,在下文中一共展示了SentenceModel类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initialize
import com.aliasi.sentences.SentenceModel; //导入依赖的package包/类
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
// initialize sentence chunker
TokenizerFactory tokenizerFactory = UimaContextHelper.createObjectFromConfigParameter(context,
"tokenizer-factory", "tokenizer-factory-params", IndoEuropeanTokenizerFactory.class,
TokenizerFactory.class);
SentenceModel sentenceModel = UimaContextHelper.createObjectFromConfigParameter(context,
"sentence-model", "sentence-model-params", IndoEuropeanSentenceModel.class,
SentenceModel.class);
chunker = new SentenceChunker(tokenizerFactory, sentenceModel);
// initialize hits
hits = UimaContextHelper.getConfigParameterIntValue(context, "hits", 200);
// initialize query analyzer, index writer config, and query parser
analyzer = UimaContextHelper.createObjectFromConfigParameter(context, "query-analyzer",
"query-analyzer-params", StandardAnalyzer.class, Analyzer.class);
parser = new QueryParser("text", analyzer);
// initialize query string constructor
queryStringConstructor = UimaContextHelper.createObjectFromConfigParameter(context,
"query-string-constructor", "query-string-constructor-params",
BooleanBagOfPhraseQueryStringConstructor.class, QueryStringConstructor.class);
}
开发者ID:oaqa,项目名称:bioasq,代码行数:23,代码来源:LuceneInMemorySentenceRetrievalExecutor.java
示例2: initialize
import com.aliasi.sentences.SentenceModel; //导入依赖的package包/类
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
TokenizerFactory tokenizerFactory = UimaContextHelper.createObjectFromConfigParameter(context,
"tokenizer-factory", "tokenizer-factory-params", IndoEuropeanTokenizerFactory.class,
TokenizerFactory.class);
SentenceModel sentenceModel = UimaContextHelper.createObjectFromConfigParameter(context,
"sentence-model", "sentence-model-params", IndoEuropeanSentenceModel.class,
SentenceModel.class);
chunker = new SentenceChunker(tokenizerFactory, sentenceModel);
// initialize hits
hits = UimaContextHelper.getConfigParameterIntValue(context, "hits", 200);
// initialize query analyzer, index writer config, and query parser
analyzer = UimaContextHelper.createObjectFromConfigParameter(context, "query-analyzer",
"query-analyzer-params", StandardAnalyzer.class, Analyzer.class);
parser = new QueryParser("text", analyzer);
// initialize query string constructor
queryStringConstructor = UimaContextHelper.createObjectFromConfigParameter(context,
"query-string-constructor", "query-string-constructor-params",
BagOfPhraseQueryStringConstructor.class, QueryStringConstructor.class);
String parserProviderName = UimaContextHelper
.getConfigParameterStringValue(context, "parser-provider");
parserProvider = ProviderCache.getProvider(parserProviderName, ParserProvider.class);
lemma = new StanfordLemmatizer();
}
开发者ID:oaqa,项目名称:bioasq,代码行数:27,代码来源:ImprovedLuceneInMemorySentenceRetrievalExecutor.java
注:本文中的com.aliasi.sentences.SentenceModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论