當前位置: 首頁>>代碼示例>>Java>>正文


Java TermWeight類代碼示例

本文整理匯總了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");
}
 
開發者ID:semanticvectors,項目名稱:semanticvectors,代碼行數:40,代碼來源:LSA.java

示例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; }
 
開發者ID:semanticvectors,項目名稱:semanticvectors,代碼行數:3,代碼來源:FlagConfig.java

示例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; }
 
開發者ID:tuxdna,項目名稱:semanticvectors-googlecode,代碼行數:3,代碼來源:FlagConfig.java


注:本文中的pitt.search.semanticvectors.LuceneUtils.TermWeight類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。