Class Scoring

java.lang.Object
org.basex.util.ft.Scoring

public final class Scoring extends Object
Default scoring model, assembling all score calculations.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    avg(double sum, int count)
    Returns an average scoring value.
    static double
    not(double value)
    Inverses the scoring value for FTNot.
    static double
    textNode(int number, int size, int token, int length)
    Calculates the score for a text node.
    static double
    word(int token, double length)
    Calculates a score value, based on the token length and complete text length.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • word

      public static double word(int token, double length)
      Calculates a score value, based on the token length and complete text length.
      Parameters:
      token - token length
      length - complete length
      Returns:
      result
    • not

      public static double not(double value)
      Inverses the scoring value for FTNot.
      Parameters:
      value - scoring value
      Returns:
      score
    • avg

      public static double avg(double sum, int count)
      Returns an average scoring value.
      Parameters:
      sum - summarized scoring value
      count - number of values
      Returns:
      score
    • textNode

      public static double textNode(int number, int size, int token, int length)
      Calculates the score for a text node. Used if no index score is available.
      Parameters:
      number - number of pos values
      size - total number of index entries
      token - token length
      length - text length
      Returns:
      score