org.basex.util.ft
Class Scoring

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

public final class Scoring
extends java.lang.Object

Default scoring model, assembling all score calculations.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Method Summary
static double and(double o, double n)
          Combines two scoring values.
static double let(double s, int c)
          Returns a score for the let clause.
static double not(double d)
          Inverses the scoring value for FTNot.
static double or(double o, double n)
          Combines two scoring values.
static double step(double sc)
          Returns a score for a single step.
static double textNode(int npv, int is, int tokl, int tl)
          Calculates the score for a text node.
static double word(int tl, double l)
          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 Detail

word

public static double word(int tl,
                          double l)
Calculates a score value, based on the token length and complete text length.

Parameters:
tl - token length
l - complete length
Returns:
result

and

public static double and(double o,
                         double n)
Combines two scoring values.

Parameters:
o - old value
n - new value
Returns:
result

or

public static double or(double o,
                        double n)
Combines two scoring values.

Parameters:
o - old value
n - new value
Returns:
result

not

public static double not(double d)
Inverses the scoring value for FTNot.

Parameters:
d - scoring value
Returns:
inverse scoring value

let

public static double let(double s,
                         int c)
Returns a score for the let clause.

Parameters:
s - summed up scoring values
c - number of values
Returns:
new score value

textNode

public static double textNode(int npv,
                              int is,
                              int tokl,
                              int tl)
Calculates the score for a text node. Used if no index score is available.

Parameters:
npv - number of pos values
is - total number of index entries
tokl - token length
tl - text length
Returns:
score value

step

public static double step(double sc)
Returns a score for a single step.

Parameters:
sc - current score value
Returns:
new score value