org.egothor.core
Class Filter

java.lang.Object
  extended by org.egothor.core.Filter
All Implemented Interfaces:
Sequence<Token>
Direct Known Subclasses:
DupWithoutDiacritics, Grammer, LowerCase, ParagraphFilter, ParagraphPunctFilter, Phonetics, PunctFilter, RemoveDiacritics, Stemmer, StopFilter, WordNGrammer

public class Filter
extends java.lang.Object
implements Sequence<Token>

This object works as a tokenizer filter. It can be used for filtering stop words.

Author:
Leo Galambos

Field Summary
 Sequence<Token> prev
          The Tokenizer used by Filter.
 
Constructor Summary
Filter(Sequence<Token> prev)
          Constructor for the Filter object.
 
Method Summary
 Token action(Token t)
          Used for changing tokens of the input tokenizer.
 Sequence<Token> getPrevTokenizer()
          Return the tokenizer this filter reads from.
 Token next()
          The next token of input tokenizer is modified by action(org.egothor.core.Token) and the product is also the product of this method.
 void setPrevTokenizer(Sequence<Token> prev)
          Set the tokenizer this filter reads from.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prev

public Sequence<Token> prev
The Tokenizer used by Filter.

Constructor Detail

Filter

public Filter(Sequence<Token> prev)
Constructor for the Filter object.

Parameters:
prev - this object's Tokenizer
Method Detail

setPrevTokenizer

public final void setPrevTokenizer(Sequence<Token> prev)
Set the tokenizer this filter reads from.

Parameters:
prev - the new Tokenizer

getPrevTokenizer

public final Sequence<Token> getPrevTokenizer()
Return the tokenizer this filter reads from.

Returns:
the Tokenizer

next

public Token next()
The next token of input tokenizer is modified by action(org.egothor.core.Token) and the product is also the product of this method.

Specified by:
next in interface Sequence<Token>
Returns:
the next token as defined by action(), or null if the Tokenizer is null

action

public Token action(Token t)
Used for changing tokens of the input tokenizer. You must return the object that is passed as the parameter!

Parameters:
t - the Token
Returns:
t