* make TheTVDB local search more restrictive

This commit is contained in:
Reinhard Pointner 2012-10-14 12:13:45 +00:00
parent caafbca373
commit bd6d1d4659
2 changed files with 15 additions and 2 deletions

View File

@ -128,6 +128,9 @@ public final class WebServices {
return set(object.getName());
}
};
// make local search more restrictive
localIndex.setResultMinimumSimilarity(0.7f);
}
return localIndex;

View File

@ -27,8 +27,8 @@ import uk.ac.shef.wit.simmetrics.similaritymetrics.QGramsDistance;
public class LocalSearch<T> {
private final AbstractStringMetric metric = new QGramsDistance();
private final float resultMinimumSimilarity = 0.5f;
private final int resultSetSize = 20;
private float resultMinimumSimilarity = 0.5f;
private int resultSetSize = 20;
private final List<T> objects;
private final List<Set<String>> fields;
@ -110,6 +110,16 @@ public class LocalSearch<T> {
}
public void setResultMinimumSimilarity(float resultMinimumSimilarity) {
this.resultMinimumSimilarity = resultMinimumSimilarity;
}
public void setResultSetSize(int resultSetSize) {
this.resultSetSize = resultSetSize;
}
protected Set<String> getFields(T object) {
return set(object.toString());
}