fixed the addEvidenceWithoutduplicateTerms - but allowed the same term to be added multiple times

Former-commit-id: c875f6c4a8913777053fd0787009f3b708bbf589
This commit is contained in:
Jeremy Long
2013-06-23 22:26:37 -04:00
parent caae675359
commit acbd7cb789

View File

@@ -199,7 +199,7 @@ public class CPEAnalyzer implements Analyzer {
private String addEvidenceWithoutDuplicateTerms(final String text, final EvidenceCollection ec, Confidence confidenceFilter) {
final String txt = (text == null) ? "" : text;
final StringBuilder sb = new StringBuilder(txt.length() + (20 * ec.size()));
sb.append(txt);
sb.append(' ').append(txt).append(' ');
for (Evidence e : ec.iterator(confidenceFilter)) {
String value = e.getValue();
@@ -215,7 +215,7 @@ public class CPEAnalyzer implements Analyzer {
sb.append(value).append(' ');
}
}
return sb.toString();
return sb.toString().trim();
}
/**