Refactor feature computation in StandardReconConfig
@@ -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) {
