info.ephyra.answerselection.filters
Class StopwordFilter

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

public class StopwordFilter
extends Filter

A filter that drops a result if the answer string

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-07-17
Author:
Nico Schlaefer

Constructor Summary
StopwordFilter()
           
 
Method Summary
 Result apply(Result result)
          Filters a single Result object.
private  Result filterAdverbs(Result result)
          Drops a result if the answer string is an adverb.
private  Result filterFunctionWords(Result result)
          Drops a result if the answer string contains only function words and single characters (except digits).
private  Result filterInterrogatives(Result result)
          Drops a result if the answer string contains an interrogative.
private  Result filterSingleBracket(Result result)
          Drops a result if the answer string contains a single bracket or quotation mark.
 
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
 

Constructor Detail

StopwordFilter

public StopwordFilter()
Method Detail

filterFunctionWords

private Result filterFunctionWords(Result result)
Drops a result if the answer string contains only function words and single characters (except digits).

Parameters:
result - result to filter
Returns:
result or null

filterInterrogatives

private Result filterInterrogatives(Result result)
Drops a result if the answer string contains an interrogative.

Parameters:
result - result to be filtered
Returns:
result or null

filterSingleBracket

private Result filterSingleBracket(Result result)
Drops a result if the answer string contains a single bracket or quotation mark.

Parameters:
result - result to be filtered
Returns:
result or null

filterAdverbs

private Result filterAdverbs(Result result)
Drops a result if the answer string is an adverb.

Parameters:
result - result to filter
Returns:
result or null

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