当前位置: 首页>>代码示例>>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;未经允许,请勿转载。