本文整理匯總了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; }