info.ephyra.answerselection.filters
Class TruncationFilter

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

public class TruncationFilter
extends Filter

A filter that truncates the answer strings. It drops the following prefixes and suffixes:

After truncation, similar answers are merged.

This filter is not applied to answer strings that have been extracted with a rule- or list-based NE tagger since these answers are assumed to be properly formatted.

This class extends the class Filter.

Version:
2007-05-28
Author:
Nico Schlaefer

Field Summary
private static java.lang.String ARTICLES
          Articles that are truncated from answer strings.
private static java.lang.String SPECIAL_CHARS
          Special characters that are truncated from answer strings.
 
Constructor Summary
TruncationFilter()
           
 
Method Summary
 Result apply(Result result)
          Filters a single Result object.
 Result[] apply(Result[] results)
          Filters an array of Result objects.
static java.lang.String truncate(java.lang.String phrase)
          Truncates a phrase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPECIAL_CHARS

private static final java.lang.String SPECIAL_CHARS
Special characters that are truncated from answer strings. The following characters are excluded because they may be the first/last character of an answer:


ARTICLES

private static final java.lang.String ARTICLES
Articles that are truncated from answer strings.

See Also:
Constant Field Values
Constructor Detail

TruncationFilter

public TruncationFilter()
Method Detail

truncate

public static java.lang.String truncate(java.lang.String phrase)
Truncates a phrase.

Parameters:
phrase - phrase to truncate
Returns:
truncated phrase

apply

public Result apply(Result result)
Filters a single Result object.

Overrides:
apply in class Filter
Parameters:
result - result to filter
Returns:
result or null

apply

public Result[] apply(Result[] results)
Filters an array of Result objects.

Overrides:
apply in class Filter
Parameters:
results - results to filter
Returns:
filtered results