Package org.basex.util.ft
Class Scoring
java.lang.Object
org.basex.util.ft.Scoring
Default scoring model, assembling all score calculations.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Method Summary
Modifier and TypeMethodDescriptionstatic doubleavg(double sum, int count) Returns an average scoring value.static doublenot(double value) Inverses the scoring value for FTNot.static doubletextNode(int number, int size, int token, int length) Calculates the score for a text node.static doubleword(int token, double length) Calculates a score value, based on the token length and complete text length.
-
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 lengthlength- 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 valuecount- 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 valuessize- total number of index entriestoken- token lengthlength- text length- Returns:
- score
-