本文整理汇总了Java中org.apache.lucene.index.FieldInvertState.getLength方法的典型用法代码示例。如果您正苦于以下问题:Java FieldInvertState.getLength方法的具体用法?Java FieldInvertState.getLength怎么用?Java FieldInvertState.getLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.lucene.index.FieldInvertState
的用法示例。
在下文中一共展示了FieldInvertState.getLength方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: computeNorm
import org.apache.lucene.index.FieldInvertState; //导入方法依赖的package包/类
/** Encodes the document length in the same way as {@link TFIDFSimilarity}. */
@Override
public long computeNorm(FieldInvertState state) {
final float numTerms;
if (discountOverlaps)
numTerms = state.getLength() - state.getNumOverlap();
else
numTerms = state.getLength();
return encodeNormValue(state.getBoost(), numTerms);
}
示例2: lengthNorm
import org.apache.lucene.index.FieldInvertState; //导入方法依赖的package包/类
/** Implemented as
* <code>state.getBoost()*lengthNorm(numTerms)</code>, where
* <code>numTerms</code> is {@link FieldInvertState#getLength()} if {@link
* #setDiscountOverlaps} is false, else it's {@link
* FieldInvertState#getLength()} - {@link
* FieldInvertState#getNumOverlap()}.
*
* @lucene.experimental */
@Override
public float lengthNorm(FieldInvertState state) {
final int numTerms;
if (discountOverlaps)
numTerms = state.getLength() - state.getNumOverlap();
else
numTerms = state.getLength();
return state.getBoost() * ((float) (1.0 / Math.sqrt(numTerms)));
}
示例3: computeNorm
import org.apache.lucene.index.FieldInvertState; //导入方法依赖的package包/类
@Override
public final long computeNorm(FieldInvertState state) {
final float numTerms = discountOverlaps ? state.getLength() - state.getNumOverlap() : state.getLength();
// Dividing by the square of the boost is to mimic behavior of the old BM25 formula
final float boost = state.getBoost();
return (long) ( numTerms / (boost*boost) );
}
开发者ID:sebastian-hofstaetter,项目名称:ir-generalized-translation-models,代码行数:8,代码来源:BM25SimilarityLossless.java
示例4: lengthNorm
import org.apache.lucene.index.FieldInvertState; //导入方法依赖的package包/类
/** Implemented as
* <code>state.getBoost()*lengthNorm(numTerms)</code>, where
* <code>numTerms</code> is {@link org.apache.lucene.index.FieldInvertState#getLength()} if {@link
* #setDiscountOverlaps} is false, else it's {@link
* org.apache.lucene.index.FieldInvertState#getLength()} - {@link
* org.apache.lucene.index.FieldInvertState#getNumOverlap()}.
*
* @lucene.experimental */
@Override
public float lengthNorm(FieldInvertState state) {
final int numTerms;
if (discountOverlaps)
numTerms = state.getLength() - state.getNumOverlap();
else
numTerms = state.getLength();
return state.getBoost() * ((float) (1.0 / Math.sqrt(numTerms)));
}
示例5: lengthNorm
import org.apache.lucene.index.FieldInvertState; //导入方法依赖的package包/类
/** Implemented as
* <code>state.getBoost()*lengthNorm(numTerms)</code>, where
* <code>numTerms</code> is {@link org.apache.lucene.index.FieldInvertState#getLength()} if {@link
* #setDiscountOverlaps} is false, else it's {@link
* org.apache.lucene.index.FieldInvertState#getLength()} - {@link
* org.apache.lucene.index.FieldInvertState#getNumOverlap()}.
*
* @lucene.experimental */
@Override
public float lengthNorm(FieldInvertState state) {
final int numTerms;
if (discountOverlaps) {
numTerms = state.getLength() - state.getNumOverlap();
} else {
numTerms = state.getLength();
}
return state.getBoost() * ((float) (1.0 / Math.sqrt(numTerms)));
}
示例6: lengthNorm
import org.apache.lucene.index.FieldInvertState; //导入方法依赖的package包/类
/**
* Implemented as <code> state.getBoost() *
* computeLengthNorm(numTokens) </code> where
* numTokens does not count overlap tokens if
* discountOverlaps is true by default or true for this
* specific field.
*/
@Override
public float lengthNorm(FieldInvertState state) {
final int numTokens;
if (discountOverlaps)
numTokens = state.getLength() - state.getNumOverlap();
else
numTokens = state.getLength();
return state.getBoost() * computeLengthNorm(numTokens);
}
示例7: lengthNorm
import org.apache.lucene.index.FieldInvertState; //导入方法依赖的package包/类
/** Implemented as
* <code>state.getBoost()*lengthNorm(numTerms)</code>, where
* <code>numTerms</code> is {@link FieldInvertState#getLength()} if {@link
* #setDiscountOverlaps} is false, else it's {@link
* FieldInvertState#getLength()} - {@link
* FieldInvertState#getNumOverlap()}.
*
* @lucene.experimental */
@Override
public float lengthNorm(FieldInvertState state) {
final int numTerms;
if (discountOverlaps)
numTerms = state.getLength() - state.getNumOverlap();
else
numTerms = state.getLength();
return state.getBoost() * ((float) (1.0 / Math.sqrt(numTerms)));
}
示例8: computeNorm
import org.apache.lucene.index.FieldInvertState; //导入方法依赖的package包/类
/** Encodes the document length in the same way as {@link TFIDFSimilarity}. */
@Override
public long computeNorm(FieldInvertState state) {
final float numTerms;
if (discountOverlaps)
numTerms = state.getLength() - state.getNumOverlap();
else
numTerms = state.getLength() / state.getBoost();
return encodeNormValue(state.getBoost(), numTerms);
}
示例9: lengthNorm
import org.apache.lucene.index.FieldInvertState; //导入方法依赖的package包/类
/** Implemented as
* <code>state.getBoost()*lengthNorm(numTerms)</code>, where
* <code>numTerms</code> is {@link FieldInvertState#getLength()} if {@link
* #setDiscountOverlaps} is false, else it's {@link
* FieldInvertState#getLength()} - {@link
* FieldInvertState#getNumOverlap()}.
*
* @lucene.experimental */
@Override
public float lengthNorm(FieldInvertState state) {
final int numTerms;
if (discountOverlaps)
numTerms = state.getLength() - state.getNumOverlap();
else
numTerms = state.getLength();
return state.getBoost() * ((float) (1.0 / Math.sqrt(numTerms)));
}
示例10: computeNorm
import org.apache.lucene.index.FieldInvertState; //导入方法依赖的package包/类
@Override
final public float computeNorm(String field, FieldInvertState state) {
final int numTerms;
if (discountOverlaps)
numTerms = state.getLength() - state.getNumOverlap();
else
numTerms = state.getLength();
return state.getBoost() * ((float) (1.0 / numTerms));
}
示例11: computeNorm
import org.apache.lucene.index.FieldInvertState; //导入方法依赖的package包/类
@Override
public final long computeNorm(FieldInvertState state) {
final int numTerms = discountOverlaps ? state.getLength() - state.getNumOverlap() : state.getLength();
return encodeNormValue(state.getBoost(), numTerms);
}
示例12: lengthNorm
import org.apache.lucene.index.FieldInvertState; //导入方法依赖的package包/类
@Override
public float lengthNorm(FieldInvertState state) {
return (float) 1.0 / state.getLength();
}
示例13: computeNorm
import org.apache.lucene.index.FieldInvertState; //导入方法依赖的package包/类
@Override
public final long computeNorm(FieldInvertState state)
{
return state.getLength();
}
示例14: computeNorm
import org.apache.lucene.index.FieldInvertState; //导入方法依赖的package包/类
@Override
public final long computeNorm(FieldInvertState state) {
final int numTerms =
discountOverlaps ? state.getLength() - state.getNumOverlap() : state.getLength();
return encodeNormValue(state.getBoost(), numTerms);
}
示例15: lengthNorm
import org.apache.lucene.index.FieldInvertState; //导入方法依赖的package包/类
/**
* Compute an index-time normalization value for this field instance.
* <p>
* This value will be stored in a single byte lossy representation by
* {@link #encodeNormValue(float)}.
*
* @param state
* statistics of the current field (such as length, boost, etc)
* @return an index-time normalization value
*/
public float lengthNorm(final FieldInvertState state) {
final int numTerms;
if (discountOverlaps) {
numTerms = state.getLength() - state.getNumOverlap();
} else {
numTerms = state.getLength();
}
return state.getBoost() * ((float) (1.0 / Math.sqrt(numTerms)));
}