Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Qizx/open 4.1 API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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:

- Weighting formulas for different types of FT selections (basic term, all, any, mild-not...)
- Scoring formulas for different types of FT selections
- Normalization of the final value, so that it is between 0 and 1

Field Summary
`static float` | `CORE_SCORE` Score returned when the corresponding document does not belong to an XML Library.

Method Summary
`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.

### 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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| © 2010 Axyana Software
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD