/// <summary> /// This method is no longer an official member of <see cref="Scorer"/> /// but it is needed by SpanWeight to build an explanation. /// </summary> protected internal virtual Explanation Explain(int doc) { Explanation tfExplanation = new Explanation(); int expDoc = Advance(doc); float phraseFreq = (expDoc == doc)?freq:0.0f; tfExplanation.Value = Similarity.Tf(phraseFreq); tfExplanation.Description = "tf(phraseFreq=" + phraseFreq + ")"; return(tfExplanation); }
public override float Score() { float raw = Similarity.Tf(freq) * value_Renamed; // raw score return(norms == null?raw:raw *Similarity.DecodeNorm(norms[doc])); // normalize }