net.java.sen
Class StreamTagger

java.lang.Object
  extended by net.java.sen.StreamTagger

public class StreamTagger
extends Object

Tokenizes text read from a java.io.Reader

See examples.StreamTaggerDemo in the Sen source for an example of how to use this class

Thread Safety: Objects of this class are NOT thread safe and should not be accessed simultaneously by multiple threads. Note that creating additional instances using SenFactory is relatively cheap in both memory and time


Constructor Summary
StreamTagger(StringTagger stringTagger, Reader reader)
           
 
Method Summary
 void addFilter(StreamFilter filter)
          Adds a StreamFilter
 boolean hasNext()
          Tests if more Tokens are available
 Token next()
          Returns the next available token
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamTagger

public StreamTagger(StringTagger stringTagger,
                    Reader reader)
Parameters:
stringTagger - The StringTagger to use to tokenise the read text
reader - The Reader to read text from
Method Detail

hasNext

public boolean hasNext()
                throws IOException
Tests if more Tokens are available

Returns:
true if more Tokens are available, otherwise false
Throws:
IOException

next

public Token next()
           throws IOException
Returns the next available token

Returns:
The next available token
Throws:
IOException

addFilter

public void addFilter(StreamFilter filter)
Adds a StreamFilter

Parameters:
filter - The StreamFilter to add


Copyright © 2012. All Rights Reserved.