Fix PropertyBindings bugs
This commit is contained in:
parent
41bb712dc6
commit
ec4ddf40c4
|
@ -1245,7 +1245,7 @@ public class MediaBindingBean {
|
|||
}
|
||||
|
||||
private AssociativeScriptObject createPropertyBindings(Object object) {
|
||||
return new AssociativeScriptObject(new PropertyBindings(object, null)) {
|
||||
return new AssociativeScriptObject(new PropertyBindings(object)) {
|
||||
|
||||
@Override
|
||||
public Object getProperty(String name) {
|
||||
|
|
|
@ -1,29 +1,24 @@
|
|||
|
||||
package net.filebot.similarity;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import net.filebot.format.PropertyBindings;
|
||||
|
||||
|
||||
public class CrossPropertyMetric implements SimilarityMetric {
|
||||
|
||||
private SimilarityMetric metric;
|
||||
|
||||
|
||||
public CrossPropertyMetric(SimilarityMetric metric) {
|
||||
this.metric = metric;
|
||||
}
|
||||
|
||||
|
||||
public CrossPropertyMetric() {
|
||||
this.metric = new StringEqualsMetric();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public float getSimilarity(Object o1, Object o2) {
|
||||
Map<String, Object> m1 = getProperties(o1);
|
||||
|
@ -53,9 +48,8 @@ public class CrossPropertyMetric implements SimilarityMetric {
|
|||
return feedback / keys.size();
|
||||
}
|
||||
|
||||
|
||||
protected Map<String, Object> getProperties(Object object) {
|
||||
return new PropertyBindings(object, null);
|
||||
return new PropertyBindings(object);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue