本文整理汇总了Java中pitt.search.semanticvectors.LuceneUtils.TermWeight类的典型用法代码示例。如果您正苦于以下问题:Java TermWeight类的具体用法?Java TermWeight怎么用?Java TermWeight使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TermWeight类属于pitt.search.semanticvectors.LuceneUtils包,在下文中一共展示了TermWeight类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LSA
import pitt.search.semanticvectors.LuceneUtils.TermWeight; //导入依赖的package包/类
/**
* Basic constructor that tries to check up front that resources are available and
* configurations are consistent.
*
* @param luceneIndexDir Relative path to directory containing Lucene index.
* @throws IOException
*/
private LSA(String luceneIndexDir, FlagConfig flagConfig) throws IOException {
this.flagConfig = flagConfig;
this.luceneUtils = new LuceneUtils(flagConfig);
if (flagConfig.contentsfields().length > 1) {
logger.warning(
"LSA implementation only supports a single -contentsfield. Only '"
+ flagConfig.contentsfields()[0] + "' will be indexed.");
}
this.contentsField = flagConfig.contentsfields()[0];
// Find the number of docs, and if greater than dimension, set the dimension
// to be this number.
if (flagConfig.dimension() > this.luceneUtils.getNumDocs()) {
logger.warning("Dimension for SVD cannot be greater than number of documents ... "
+ "Setting dimension to " + this.luceneUtils.getNumDocs());
flagConfig.setDimension(this.luceneUtils.getNumDocs());
}
if (flagConfig.termweight().equals(TermWeight.LOGENTROPY)) {
VerbatimLogger.info("Term weighting: log-entropy.\n");
}
// Log some of the basic properties. This could be altered to be more informative if
// our users ever ask for different properties.
VerbatimLogger.info("Set up LSA indexer.\n" +
"Dimension: " + flagConfig.dimension() + " Lucene index contents field: '" + this.contentsField + "'"
+ " Minimum frequency = " + flagConfig.minfrequency()
+ " Maximum frequency = " + flagConfig.maxfrequency()
+ " Number non-alphabet characters = " + flagConfig.maxnonalphabetchars() + "\n");
}
示例2: termweight
import pitt.search.semanticvectors.LuceneUtils.TermWeight; //导入依赖的package包/类
/** Term weighting used when constructing document vectors, default value {@link TermWeight#IDF} */
public LuceneUtils.TermWeight termweight() { return termweight; }
示例3: termweight
import pitt.search.semanticvectors.LuceneUtils.TermWeight; //导入依赖的package包/类
/** Term weighting used when constructing document vectors, default value {@link TermWeight#NONE} */
public LuceneUtils.TermWeight termweight() { return termweight; }