1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-16 22:35:04 -05:00

* 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()); return set(object.getName());
} }
}; };
// make local search more restrictive
localIndex.setResultMinimumSimilarity(0.7f);
} }
return localIndex; return localIndex;

View File

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