gov.sandia.cognition.text.term.filter
Class StopListFilter

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.text.term.filter.AbstractSingleTermFilter
          extended by gov.sandia.cognition.text.term.filter.StopListFilter
All Implemented Interfaces:
SingleTermFilter, TermFilter, CloneableSerializable, Serializable, Cloneable

public class StopListFilter
extends AbstractSingleTermFilter

A term filter that rejects any term that appears in a given stop list.

Since:
3.0
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
protected  StopList stopList
          The stop list for the filter to use.
 
Constructor Summary
StopListFilter()
          Creates a new StopListFilter.
StopListFilter(StopList stopList)
          Creates a new StopListFilter with the given stop list.
 
Method Summary
 TermOccurrence filterTerm(TermOccurrence occurence)
          Takes a single term occurrence and filters that occurrence into a new occurrence or returns null, indicating that the filter rejects that term.
 StopList getStopList()
          Gets the stop list used by the filter.
 void setStopList(StopList stopList)
          Sets the stop list for the filter to use.
 
Methods inherited from class gov.sandia.cognition.text.term.filter.AbstractSingleTermFilter
filterTerms
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Field Detail

stopList

protected StopList stopList
The stop list for the filter to use.

Constructor Detail

StopListFilter

public StopListFilter()
Creates a new StopListFilter.


StopListFilter

public StopListFilter(StopList stopList)
Creates a new StopListFilter with the given stop list.

Parameters:
stopList - The stop list to use.
Method Detail

filterTerm

public TermOccurrence filterTerm(TermOccurrence occurence)
Description copied from interface: SingleTermFilter
Takes a single term occurrence and filters that occurrence into a new occurrence or returns null, indicating that the filter rejects that term.

Parameters:
occurence - The term occurrence to filter.
Returns:
A term occurrence (may be a new instance or the same as the given one) of the term to replace the given one or null to indicate that the filter has rejected the given term.

getStopList

public StopList getStopList()
Gets the stop list used by the filter.

Returns:
The stop list.

setStopList

public void setStopList(StopList stopList)
Sets the stop list for the filter to use.

Parameters:
stopList - The stop list.