Refactor feature computation in StandardReconConfig

This commit is contained in:
Antonin Delpeuch 2018-12-31 16:19:28 +01:00
parent ddd9bf9aa8
commit 4b3e5c02a1

View File

@ -543,7 +543,19 @@ public class StandardReconConfig extends ReconConfig {
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);
recon.setFeature(Recon.Feature_nameMatch, text.equalsIgnoreCase(candidate.name));
@ -561,7 +573,6 @@ public class StandardReconConfig extends ReconConfig {
}
}
}
return recon;
}
static protected double wordDistance(String s1, String s2) {