Refactor feature computation in StandardReconConfig
This commit is contained in:
parent
ddd9bf9aa8
commit
4b3e5c02a1
@ -543,7 +543,19 @@ public class StandardReconConfig extends ReconConfig {
|
|||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count > 0) {
|
computeFeatures(recon, text);
|
||||||
|
return recon;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recomputes the features associated with this reconciliation
|
||||||
|
* object (only if we have at least one candidate).
|
||||||
|
*
|
||||||
|
* @param text
|
||||||
|
* the cell value to compare the reconciliation data to
|
||||||
|
*/
|
||||||
|
public void computeFeatures(Recon recon, String text) {
|
||||||
|
if (!recon.candidates.isEmpty()) {
|
||||||
ReconCandidate candidate = recon.candidates.get(0);
|
ReconCandidate candidate = recon.candidates.get(0);
|
||||||
|
|
||||||
recon.setFeature(Recon.Feature_nameMatch, text.equalsIgnoreCase(candidate.name));
|
recon.setFeature(Recon.Feature_nameMatch, text.equalsIgnoreCase(candidate.name));
|
||||||
@ -561,8 +573,7 @@ public class StandardReconConfig extends ReconConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return recon;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static protected double wordDistance(String s1, String s2) {
|
static protected double wordDistance(String s1, String s2) {
|
||||||
Set<String> words1 = breakWords(s1);
|
Set<String> words1 = breakWords(s1);
|
||||||
|
Loading…
Reference in New Issue
Block a user