info.ephyra.answerselection.filters
Class ResultLengthFilter

java.lang.Object
  extended by info.ephyra.answerselection.filters.Filter
      extended by info.ephyra.answerselection.filters.ResultLengthFilter

public class ResultLengthFilter
extends Filter

A filter that cuts off results if the total length of non-whitespace characters exceeds a threshold.

This class extends the class Filter.

Version:
2006-07-15
Author:
Guido Sautter, Nico Schlaefer

Field Summary
private  int cutoffLength
           
private static int MAX_NON_WHITESPACE
          Maximum number of non-whitespace characters per question.
 
Constructor Summary
ResultLengthFilter()
           
ResultLengthFilter(int cutoffLength)
           
 
Method Summary
 Result[] apply(Result[] results)
          Ensures that the total number of non-whitespace characters in all answer strings does not exceed cutoffLength.
 
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
 

Field Detail

MAX_NON_WHITESPACE

private static final int MAX_NON_WHITESPACE
Maximum number of non-whitespace characters per question.

See Also:
Constant Field Values

cutoffLength

private int cutoffLength
Constructor Detail

ResultLengthFilter

public ResultLengthFilter()

ResultLengthFilter

public ResultLengthFilter(int cutoffLength)
Parameters:
cutoffLength -
Method Detail

apply

public Result[] apply(Result[] results)
Ensures that the total number of non-whitespace characters in all answer strings does not exceed cutoffLength.

Overrides:
apply in class Filter
Parameters:
results - array of Result objects
Returns:
filtered array of Result objects