diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/BB2.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/BB2.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/BB2.java 2011-06-16 18:26:37.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/BB2.java 2012-12-18 15:24:56.000000000 +0100 @@ -95,7 +95,10 @@ * @param termFrequency the term frequency in the collection * @param keyFrequency the term frequency in the query * @return the score returned by the implemented weighting model. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/BM25.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/BM25.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/BM25.java 2011-06-16 18:26:37.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/BM25.java 2012-12-18 15:25:03.000000000 +0100 @@ -78,7 +78,10 @@ * @param F_t the term frequency in the collection * @param keyFrequency the term frequency in the query * @return the score assigned by the weighting model BM25. - */ + * @deprecated Use score(double tf, double docLength) instead. + */ + @Deprecated + @Override public double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/DFI0.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/DFI0.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/DFI0.java 2011-06-16 18:26:37.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/DFI0.java 2012-12-18 15:25:16.000000000 +0100 @@ -50,6 +50,7 @@ return keyFrequency * Idf.log(1+ (tf - eij)/Math.sqrt(eij) ); } + @Deprecated @Override public double score(double tf, double docLength, double n_t, double F_t, double keyFrequency) diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/DFRWeightingModel.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/DFRWeightingModel.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/DFRWeightingModel.java 2011-06-16 18:26:37.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/DFRWeightingModel.java 2012-12-18 15:26:27.000000000 +0100 @@ -250,8 +250,10 @@ * @param termFrequency the term frequency in the collection * @param queryTermWeight the term frequency in the query * @return the score assigned by the weighting model PL2. + * @deprecated Use score(double tf, double docLength) instead. */ - @SuppressWarnings("deprecation") + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/DFR_BM25.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/DFR_BM25.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/DFR_BM25.java 2011-06-16 18:26:37.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/DFR_BM25.java 2012-12-18 15:25:25.000000000 +0100 @@ -83,7 +83,10 @@ * @param termFrequency the term frequency in the collection * @param keyFrequency the term frequency in the query * @return the score returned by the implemented weighting model. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/DFRee.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/DFRee.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/DFRee.java 2011-06-16 18:26:37.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/DFRee.java 2012-12-18 15:26:09.000000000 +0100 @@ -94,7 +94,10 @@ * @param termFrequency the term frequency in the collection (ignored) * @param keyFrequency the term frequency in the query (ignored). * @return the score assigned by the weighting model DFRee. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/DLH.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/DLH.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/DLH.java 2011-06-16 18:26:37.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/DLH.java 2012-12-18 15:26:47.000000000 +0100 @@ -80,7 +80,10 @@ * @param F_t the term frequency in the collection * @param keyFrequency the term frequency in the query * @return the score assigned by the weighting model DLH. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/DLH13.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/DLH13.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/DLH13.java 2011-06-16 18:26:37.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/DLH13.java 2012-12-18 15:27:00.000000000 +0100 @@ -82,7 +82,10 @@ * @param F_t the term frequency in the collection * @param keyFrequency the term frequency in the query * @return the score assigned by the weighting model DLH13. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/DPH.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/DPH.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/DPH.java 2011-06-16 18:26:37.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/DPH.java 2012-12-18 15:27:12.000000000 +0100 @@ -85,7 +85,10 @@ * @param F_t the term frequency in the collection * @param keyFrequency the term frequency in the query * @return the score assigned by the weighting model DPH. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/DirichletLM.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/DirichletLM.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/DirichletLM.java 2011-06-16 18:26:37.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/DirichletLM.java 2012-12-18 15:26:35.000000000 +0100 @@ -58,6 +58,7 @@ return Idf.log(1 + (tf/(c * (super.termFrequency / numberOfTokens))) ) + Idf.log(c/(docLength+c)); } + @Deprecated @Override public double score(double tf, double docLength, double n_t, double F_t, double keyFrequency) diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/Hiemstra_LM.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/Hiemstra_LM.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/Hiemstra_LM.java 2011-06-16 18:26:37.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/Hiemstra_LM.java 2012-12-18 15:27:19.000000000 +0100 @@ -92,7 +92,10 @@ * @param F_t the term frequency in the collection * @param keyFrequency the term frequency in the query * @return the score assigned by the weighting model Hiemstra_LM. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/IFB2.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/IFB2.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/IFB2.java 2011-06-16 18:26:38.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/IFB2.java 2012-12-18 15:27:26.000000000 +0100 @@ -79,7 +79,10 @@ * @param F_t the term frequency in the collection * @param keyFrequency the term frequency in the query * @return the score assigned by the weighting model IFB2. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/InB2.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/InB2.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/InB2.java 2011-06-16 18:26:38.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/InB2.java 2012-12-18 15:28:18.000000000 +0100 @@ -77,7 +77,10 @@ * @param termFrequency the term frequency in the collection * @param keyFrequency the term frequency in the query * @return the score returned by the implemented weighting model. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/InL2.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/InL2.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/InL2.java 2011-06-16 18:26:38.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/InL2.java 2012-12-18 15:28:27.000000000 +0100 @@ -77,7 +77,10 @@ * @param termFrequency the term frequency in the collection * @param keyFrequency the term frequency in the query * @return the score returned by the implemented weighting model. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/In_expB2.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/In_expB2.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/In_expB2.java 2011-06-16 18:26:38.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/In_expB2.java 2012-12-18 15:27:36.000000000 +0100 @@ -79,7 +79,10 @@ * @param termFrequency the term frequency in the collection * @param keyFrequency the term frequency in the query * @return the score returned by the implemented weighting model. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/In_expC2.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/In_expC2.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/In_expC2.java 2011-06-16 18:26:38.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/In_expC2.java 2012-12-18 15:27:52.000000000 +0100 @@ -79,7 +79,10 @@ * @param termFrequency the term frequency in the collection * @param keyFrequency the term frequency in the query * @return the score returned by the implemented weighting model. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/Js_KLs.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/Js_KLs.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/Js_KLs.java 2011-06-16 18:26:38.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/Js_KLs.java 2012-12-18 15:31:47.000000000 +0100 @@ -76,9 +76,21 @@ * @return the score assigned to a document with the given * tf and docLength, and other preset parameters */ - public final double score(double tf, double docLength) { - return score (tf, docLength,documentFrequency , termFrequency , keyFrequency) ; - } + public final double score(double tf, double docLength) { + //Two neighbouring distributions in the document: the true and the smoothed one. + double maximumLikelihoodEstimate = tf/docLength; //the true probability + double smoothedProbability = (tf +1d)/(docLength +1d); //the smoothed probability + + // The true distribution in the collection: + double collectionPrior = termFrequency/numberOfTokens; + + /** The divergence measure in the document between neighbouring distributions. */ + double Js = (docLength /(docLength+1))*(1 - maximumLikelihoodEstimate) * Idf.log ((tf+1d)/tf); + // The information of the sample wrt collection priors + double KLs = + Idf.log ( smoothedProbability/collectionPrior) + tf*Idf.log (1+1d/tf); + return keyFrequency * tf * Js *KLs ; + } /** @@ -89,7 +101,10 @@ * @param termFrequency the term frequency in the collection (ignored) * @param keyFrequency the term frequency in the query (ignored). * @return the score assigned by the weighting model Js_KLs. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/LGD.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/LGD.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/LGD.java 2011-06-16 18:26:38.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/LGD.java 2012-12-18 15:28:48.000000000 +0100 @@ -86,7 +86,10 @@ * @param F_t the term frequency in the collection * @param keyFrequency the term frequency in the query * @return the score assigned by the weighting model LGD. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/LemurTF_IDF.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/LemurTF_IDF.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/LemurTF_IDF.java 2011-06-16 18:26:38.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/LemurTF_IDF.java 2012-12-18 15:28:40.000000000 +0100 @@ -73,7 +73,10 @@ * @param termFrequency the term frequency in the collection * @param keyFrequency the term frequency in the query * @return the score assigned by the weighting model LemurTF_IDF. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/MDL2.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/MDL2.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/MDL2.java 2011-06-16 18:26:38.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/MDL2.java 2012-12-18 15:28:58.000000000 +0100 @@ -154,6 +154,7 @@ return 0; } + @Deprecated @Override public double score(double tf, double docLength, double n_t, double F_t, double keyFrequency) { diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/ML2.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/ML2.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/ML2.java 2011-06-16 18:26:38.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/ML2.java 2012-12-18 15:29:05.000000000 +0100 @@ -146,6 +146,7 @@ return 0; } + @Deprecated @Override public double score(double tf, double docLength, double n_t, double F_t, double keyFrequency) { diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/PL2.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/PL2.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/PL2.java 2011-06-16 18:26:38.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/PL2.java 2012-12-18 15:29:48.000000000 +0100 @@ -85,7 +85,10 @@ * @param F_t the term frequency in the collection * @param keyFrequency the term frequency in the query * @return the score assigned by the weighting model PL2. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/PerFieldNormWeightingModel.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/PerFieldNormWeightingModel.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/PerFieldNormWeightingModel.java 2011-06-16 18:26:38.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/PerFieldNormWeightingModel.java 2012-12-18 15:29:40.000000000 +0100 @@ -176,6 +176,7 @@ return 0; } + @Deprecated @Override public double score(double tf, double docLength, double n_t, double F_t, double keyFrequency) { diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/TF_IDF.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/TF_IDF.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/TF_IDF.java 2011-06-16 18:26:38.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/TF_IDF.java 2012-12-18 15:29:59.000000000 +0100 @@ -87,7 +87,10 @@ * @param termFrequency the term frequency in the collection (ignored) * @param keyFrequency the term frequency in the query (ignored). * @return the score assigned by the weighting model TF_IDF. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/WeightingModel.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/WeightingModel.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/WeightingModel.java 2011-06-16 18:26:38.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/WeightingModel.java 2012-12-18 15:23:41.000000000 +0100 @@ -165,13 +165,16 @@ * @param F_t the term frequency in the collection * @param _keyFrequency the term frequency in the query * @return the score returned by the implemented weighting model. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated public abstract double score( double tf, double docLength, double n_t, double F_t, double _keyFrequency); + /** * Sets the average length of documents in the collection. * @param avgDocLength The documents' average length. diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/XSqrA_M.java Applications/terrier-3.5-score/src/core/org/terrier/matching/models/XSqrA_M.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/models/XSqrA_M.java 2011-06-16 18:26:39.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/models/XSqrA_M.java 2012-12-18 15:31:07.000000000 +0100 @@ -71,8 +71,20 @@ * @return the score assigned to a document with the given * tf and docLength, and other preset parameters */ - public final double score(double tf, double docLength) { - return score (tf, docLength,documentFrequency , termFrequency , keyFrequency) ; + public final double score(double tf, double docLength) { + //Two neighbouring distributions in the document: the true and the smoothed one. + double maximumLikelihoodEstimate = tf/docLength; //the true probability + double smoothedProbability = (tf +1d)/(docLength +1d); //the smoothed probability + + // The true distribution in the collection: + double collectionPrior = termFrequency/numberOfTokens; + + /** The divergence measure (Pearson) of the two neighbouring distributions*/ + double XSqrA = Math.pow(1d-maximumLikelihoodEstimate,2)/(tf+1d) ; + // The information growth in the document from the the true probability to the smoothed one and wrt the collection priors + double InformationDelta = ((tf+1d) * Idf.log (smoothedProbability/collectionPrior) -tf*Idf.log (maximumLikelihoodEstimate /collectionPrior) +0.5*Idf.log(smoothedProbability/maximumLikelihoodEstimate)); + //the inner product + return keyFrequency * tf*XSqrA *InformationDelta; } @@ -84,7 +96,10 @@ * @param termFrequency the term frequency in the collection (ignored) * @param keyFrequency the term frequency in the query (ignored). * @return the score assigned by the weighting model XSqrA_M. + * @deprecated Use score(double tf, double docLength) instead. */ + @Deprecated + @Override public final double score( double tf, double docLength, diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/tsms/RequiredTermModifier.java Applications/terrier-3.5-score/src/core/org/terrier/matching/tsms/RequiredTermModifier.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/tsms/RequiredTermModifier.java 2011-06-16 18:26:41.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/tsms/RequiredTermModifier.java 2012-12-18 16:05:38.000000000 +0100 @@ -120,6 +120,7 @@ return 0; } + @Deprecated @Override public double score(double tf, double docLength, double n_t, double F_t, double keyFrequency) { diff -urN Applications/terrier-3.5-golden/src/core/org/terrier/matching/tsms/TermInFieldModifier.java Applications/terrier-3.5-score/src/core/org/terrier/matching/tsms/TermInFieldModifier.java --- Applications/terrier-3.5-golden/src/core/org/terrier/matching/tsms/TermInFieldModifier.java 2011-06-16 18:26:41.000000000 +0200 +++ Applications/terrier-3.5-score/src/core/org/terrier/matching/tsms/TermInFieldModifier.java 2012-12-18 16:05:49.000000000 +0100 @@ -193,6 +193,7 @@ return 0; } + @Deprecated @Override public double score(double tf, double docLength, double n_t, double F_t, double keyFrequency) {