kylm.reader
Class TextStreamSentenceReader

java.lang.Object
  extended by kylm.reader.TextStreamSentenceReader
All Implemented Interfaces:
java.lang.Iterable<java.lang.String[]>, SentenceReader

public class TextStreamSentenceReader
extends java.lang.Object
implements SentenceReader

A sentence loader that loads from an arbitrary input stream

Author:
neubig

Constructor Summary
TextStreamSentenceReader(java.io.InputStream is)
          The constructor, saves the sentence array and uses a single space as the default divider
TextStreamSentenceReader(java.io.InputStream is, java.lang.String divider)
          The constructor, saves the sentence array and uses the passed in divider
 
Method Summary
 java.util.Iterator<java.lang.String[]> iterator()
           
 boolean supportsReset()
          Whether the sentence loader supports returning multiple iterators or not.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextStreamSentenceReader

public TextStreamSentenceReader(java.io.InputStream is)
The constructor, saves the sentence array and uses a single space as the default divider

Parameters:
is - The text stream from which to load the sentences

TextStreamSentenceReader

public TextStreamSentenceReader(java.io.InputStream is,
                                java.lang.String divider)
The constructor, saves the sentence array and uses the passed in divider

Parameters:
is - The text stream from which to load the sentences
divider - The divider that is used to divide the text strings
Method Detail

iterator

public java.util.Iterator<java.lang.String[]> iterator()
Specified by:
iterator in interface java.lang.Iterable<java.lang.String[]>
Specified by:
iterator in interface SentenceReader

supportsReset

public boolean supportsReset()
Description copied from interface: SentenceReader
Whether the sentence loader supports returning multiple iterators or not. If multiple iterators are not supported, input can only be read once.

Specified by:
supportsReset in interface SentenceReader
Returns:
Whether multiple iterators can be returned.