com.evasion.plugin.geoloc.compass.FairSimilarity Maven / Gradle / Ivy
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.evasion.plugin.geoloc.compass;
import org.apache.lucene.search.DefaultSimilarity;
/**
*
* @author sglon
*/
public class FairSimilarity extends DefaultSimilarity {
/**
* *
* serialVersionUID.
*/
private static final long serialVersionUID = 1L;
public float lengthNorm(String fieldName, int numTerms) {
return (float) (1.0 / numTerms);
}
public float tf(float freq) {
return (float) freq;
}
}