Interface ScoringFunction

  • All Superinterfaces:
    java.util.function.BiFunction<Match,​List<Score>,​Score>

    public interface ScoringFunction
    extends java.util.function.BiFunction<Match,​List<Score>,​Score>
    A functional interface to get a score between 2 Match objects
    • Method Detail

      • getAverageScore

        static ScoringFunction getAverageScore()
        For all the childScores in a Match object it calculates the average. To get a balanced average for 2 Match object which do not have same number of childScores. It gives a score of 0.5 for missing children
        Returns:
        the scoring function for Average
      • getSimpleAverageScore

        static ScoringFunction getSimpleAverageScore()
        For all the childScores in a Match object it calculates the average. Average is calculated with a total of child scored divided by the child count
        Returns:
        the scoring function for Simple Average
      • getWeightedAverageScore

        static ScoringFunction getWeightedAverageScore()
        Follows the same rules as "getAverageScore" and in addition applies weights to children. It can be used for aggregating Elements to Documents, where weights can be provided at Element level
        Returns:
        the scoring function for WeightedAverage
      • getExponentialAverageScore

        static ScoringFunction getExponentialAverageScore()
        Follows the same rules as "getAverageScore", and in addition if more than 1 children match above a score of 0.9, it exponentially increases the overall score by using a 1.5 exponent
        Returns:
        the scoring function for ExponentialAverage
      • getExponentialWeightedAverageScore

        static ScoringFunction getExponentialWeightedAverageScore()
        This is the default scoring used to calculate the Document score by aggregating the child Element scores. This combines the benefits of weights and exponential increase when calculating the average scores.
        Returns:
        the scoring function for ExponentialWeightedAverage
      • getSumOfWeightedResult

        static double getSumOfWeightedResult​(List<Score> childScoreList)
      • getSumOfResult

        static double getSumOfResult​(List<Score> childScoreList)
      • getSumOfWeights

        static double getSumOfWeights​(List<Score> childScoreList)
      • getExponentiallyIncreasedValue

        static double getExponentiallyIncreasedValue​(double value)
      • getNonPerfectMatchedElement

        static List<Score> getNonPerfectMatchedElement​(List<Score> childScoreList)
      • getPerfectMatchedElement

        static List<Score> getPerfectMatchedElement​(List<Score> childScoreList)
      • getChildCount

        static double getChildCount​(Match match)
      • getUnmatchedChildScore

        static double getUnmatchedChildScore​(Match match)