Qizx fe-4.4p2 API

com.qizx.api.fulltext
Interface Scorer

All Known Implementing Classes:
DefaultScorer

public interface Scorer

Customizable part of the full-text scoring algorithm.

This interface defines:


Field Summary
static float CORE_SCORE
          Score returned when the corresponding document does not belong to an XML Library.
 
Method Summary
 float getDocumentWeight(Document scoredDocument)
          Support of document ranking: returns a positive number (default 1) which is used as a weight for the document.
 float normalizeScore(float rawScore)
          Normalizes a score so that its value is between 0 and 1
 float normAll(float[] subWeights)
          Computes the weight norm associated with a conjunction ('ftand' or 'all') of full-text selections.
 float normOr(float[] subWeights)
          Computes the weight norm associated with a disjunction ('ftor' or 'any') of full-text selections.
 float normWord(float inverseDocFrequency)
          Computes the weight associated with a simple word.
 float scoreAll(float[] subScores)
          Computes the score of a conjunction ('ftand' or 'all') of full-text selections.
 float scoreOr(float[] subScores, int scoreCount)
          Computes the score of a disjunction ('ftor' or 'any') of full-text selections.
 float scoreWord(float norm, float termFrequency)
          Computes the score of a single word.
 

Field Detail

CORE_SCORE

static final float CORE_SCORE
Score returned when the corresponding document does not belong to an XML Library.

See Also:
Constant Field Values
Method Detail

normWord

float normWord(float inverseDocFrequency)
Computes the weight associated with a simple word.

Parameters:
inverseDocFrequency - inverse of the fraction of documents that contain this term
Returns:
the computed weighting of simple term. The default implementation is: 1 + log(inverseDocFrequency)

normAll

float normAll(float[] subWeights)
Computes the weight norm associated with a conjunction ('ftand' or 'all') of full-text selections. The default weight norm is the sum of squared sub-weights power -1/2.

Parameters:
subWeights - weight values computed for sub-selections.
Returns:
the computed weighting.

normOr

float normOr(float[] subWeights)
Computes the weight norm associated with a disjunction ('ftor' or 'any') of full-text selections.

Parameters:
subWeights - weight values computed for sub-selections.
Returns:
the normed weighting. The default implementation is a weighted average of the sum of sub-weights and their maximum value.

scoreWord

float scoreWord(float norm,
                float termFrequency)
Computes the score of a single word.

Parameters:
norm - normalized weight of word (as computed by normWord(float)).
termFrequency - relative term frequency in the current document (number of occurrences divided by average number of occurrences in all documents).
Returns:
the computed score. The default implementation is termFrequency multiplied by 'norm'.

scoreAll

float scoreAll(float[] subScores)
Computes the score of a conjunction ('ftand' or 'all') of full-text selections.

Parameters:
subScores - weight values computed for sub-selections.
Returns:
the computed weighting. The default implementation is the sum of scores.

scoreOr

float scoreOr(float[] subScores,
              int scoreCount)
Computes the score of a disjunction ('ftor' or 'any') of full-text selections.

Parameters:
subScores - weight values computed for sub-selections.
scoreCount - number of values in scores
Returns:
the computed score. The default implementation is a weighted average of the sum of sub-scores and their maximum value.

getDocumentWeight

float getDocumentWeight(Document scoredDocument)
Support of document ranking: returns a positive number (default 1) which is used as a weight for the document.

Parameters:
scoredDocument - document to weight. Typically, the weight is a metadata property of the document.
Returns:
a positive number

normalizeScore

float normalizeScore(float rawScore)
Normalizes a score so that its value is between 0 and 1

Parameters:
rawScore - a positive value possibly greater than 1

© 2010 Axyana Software