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.util.fulltext
Class DefaultScorer

    java.lang.Object
      com.qizx.api.util.fulltext.DefaultScorer

All Implemented Interfaces:
  Scorer

    public class DefaultScorer

extends Object
implements Scorer

Default scorer implementation

Field Summary
`static String` | `FT_WEIGHT` Name of the metadata property which can contain a weight for a Document.

Fields inherited from interface com.qizx.api.fulltext.Scorer
`CORE_SCORE`

Constructor Summary
`DefaultScorer()`

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[] scores)` Computes the score of a conjunction ('ftand' or 'all') of full-text selections.
`float` | `scoreOr(float[] scores, 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.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### FT_WEIGHT

    public static final String FT_WEIGHT

  Name of the metadata property which can contain a weight for a Document. Support of document ranking.

  See Also:
    Constant Field Values

Constructor Detail

### DefaultScorer

    public DefaultScorer()

Method Detail

### normalizeScore

    public float normalizeScore(float rawScore)

  Description copied from interface: `Scorer`
  Normalizes a score so that its value is between 0 and 1

  Specified by:
    `normalizeScore` in interface `Scorer`
  Parameters:
    `rawScore` - a positive value possibly greater than 1

### normWord

    public float normWord(float inverseDocFrequency)

  Description copied from interface: `Scorer`
  Computes the weight associated with a simple word.

  Specified by:
    `normWord` in interface `Scorer`
  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)

### scoreWord

    public float scoreWord(float norm,
                           float termFrequency)

  Description copied from interface: `Scorer`
  Computes the score of a single word.

  Specified by:
    `scoreWord` in interface `Scorer`
  Parameters:
    `norm` - normalized weight of word (as computed by `Scorer.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'.

### normAll

    public float normAll(float[] subWeights)

  Description copied from interface: `Scorer`
  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.

  Specified by:
    `normAll` in interface `Scorer`
  Parameters:
    `subWeights` - weight values computed for sub-selections.
  Returns:
    the computed weighting.

### scoreAll

    public float scoreAll(float[] scores)

  Description copied from interface: `Scorer`
  Computes the score of a conjunction ('ftand' or 'all') of full-text selections.

  Specified by:
    `scoreAll` in interface `Scorer`
  Parameters:
    `scores` - weight values computed for sub-selections.
  Returns:
    the computed weighting. The default implementation is the sum of scores.

### normOr

    public float normOr(float[] subWeights)

  Description copied from interface: `Scorer`
  Computes the weight norm associated with a disjunction ('ftor' or 'any') of full-text selections.

  Specified by:
    `normOr` in interface `Scorer`
  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.

### scoreOr

    public float scoreOr(float[] scores,
                         int scoreCount)

  Description copied from interface: `Scorer`
  Computes the score of a disjunction ('ftor' or 'any') of full-text selections.

  Specified by:
    `scoreOr` in interface `Scorer`
  Parameters:
    `scores` - 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.

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