|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.query.ft.Scoring
public final class Scoring
Simple default scoring model, assembling all scoring calculations.
Field Summary | |
---|---|
static int |
MP
Scoring multiplier to store values as integers. |
Constructor Summary | |
---|---|
Scoring()
|
Method Summary | |
---|---|
double |
and(double o,
double n)
Combines two scoring values. |
double |
let(double s,
int c)
Returns a score for the let clause. |
double |
not(double d)
Inverses the scoring value for FTNot. |
double |
or(double o,
double n)
Combines two scoring values. |
static double |
phrase(double w1,
double w2)
Returns the scoring value for a phrase. |
static double |
step(double sc)
Returns a score for a single step. |
static double |
textNode(double npv,
double is,
double tokl,
double tl)
Returns the score for a text node. |
static int |
tfIDF(double freq,
double mfreq,
double docs,
double tokens)
Returns a tf-idf for the specified values. |
static double |
union(double w1,
double w2)
Returns the union value. |
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 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MP
Constructor Detail |
---|
public Scoring()
Method Detail |
---|
public double word(int tl, double l)
tl
- token lengthl
- complete length
public double and(double o, double n)
o
- old valuen
- new value
public double or(double o, double n)
o
- old valuen
- new value
public double not(double d)
d
- scoring value
public double let(double s, int c)
s
- summed up scoring valuesc
- number of values
public static int tfIDF(double freq, double mfreq, double docs, double tokens)
MP
constant to yield
integer values. The value 2
is used as minimum score,
as the total minimum value will be subtracted by 1 to avoid eventual
0
scores.
freq
- frequency of the token. TF: freq(i, j)mfreq
- maximum occurrence of a token. TF: max(l, freq(l, j))docs
- number of documents in the collection. IDF: Ntokens
- number of documents containing the token. IDF: n(i)
public static double textNode(double npv, double is, double tokl, double tl)
npv
- number of pos valuesis
- index sizetokl
- token lengthtl
- text length
public static double phrase(double w1, double w2)
w1
- score of word1w2
- score of word2
public static double union(double w1, double w2)
w1
- score of word1w2
- score of word2
public static double step(double sc)
sc
- current score value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |