info.ephyra.answerselection.filters
Class DuplicateFilter
java.lang.Object
info.ephyra.answerselection.filters.Filter
info.ephyra.answerselection.filters.DuplicateFilter
public class DuplicateFilter
- extends Filter
The DuplicateFilter drops duplicate results. Results are
considered equal if StringUtils.equalsCommonNorm() is true for
the answer strings. In this case the result with the higher score is kept
and its score is incremented by the score of the other result.
This class extends the class Filter.
- Version:
- 2006-06-28
- Author:
- Nico Schlaefer
|
Field Summary |
private java.lang.String[] |
forbidden
Results with an answer string equal to one of these forbidden strings are
dropped. |
|
Method Summary |
void |
addForbiddenAnswers(java.lang.String[] forbidden)
Adds forbidden answer strings. |
Result[] |
apply(Result[] results)
Filters duplicate results and increments the scores of the remaining
results by the scores of the dropped results. |
| Methods inherited from class info.ephyra.answerselection.filters.Filter |
apply |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
forbidden
private java.lang.String[] forbidden
- Results with an answer string equal to one of these forbidden strings are
dropped.
DuplicateFilter
public DuplicateFilter()
addForbiddenAnswers
public void addForbiddenAnswers(java.lang.String[] forbidden)
- Adds forbidden answer strings.
- Parameters:
forbidden - forbidden answers
apply
public Result[] apply(Result[] results)
- Filters duplicate results and increments the scores of the remaining
results by the scores of the dropped results.
- Overrides:
apply in class Filter
- Parameters:
results - array of Result objects
- Returns:
- array of
Result objects without duplicates