public class ADSentenceSampleStream extends java.lang.Object implements ObjectStream<SentenceSample>
| Constructor and Description |
|---|
ADSentenceSampleStream(java.io.FileInputStream in,
java.lang.String charsetName,
boolean includeHeadlines)
Deprecated.
|
ADSentenceSampleStream(InputStreamFactory in,
java.lang.String charsetName,
boolean includeHeadlines)
Creates a new
SentenceSample stream from a FileInputStream |
ADSentenceSampleStream(ObjectStream<java.lang.String> lineStream,
boolean includeHeadlines)
Creates a new
SentenceSample stream from a line stream, i.e. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the
ObjectStream and releases all allocated
resources. |
SentenceSample |
read()
Returns the next object.
|
void |
reset()
Repositions the stream at the beginning and the previously seen object sequence
will be repeated exactly.
|
public ADSentenceSampleStream(ObjectStream<java.lang.String> lineStream, boolean includeHeadlines)
SentenceSample stream from a line stream, i.e.
ObjectStream<String>, that could be a
PlainTextByLineStream object.lineStream - a stream of lines as StringincludeHeadlines - if true will output the sentences marked as news headlinespublic ADSentenceSampleStream(InputStreamFactory in, java.lang.String charsetName, boolean includeHeadlines) throws java.io.IOException
SentenceSample stream from a FileInputStreamin - input stream from the corpuscharsetName - the charset to use while reading the corpusincludeHeadlines - if true will output the sentences marked as news headlinesjava.io.IOException@Deprecated
public ADSentenceSampleStream(java.io.FileInputStream in,
java.lang.String charsetName,
boolean includeHeadlines)
SentenceSample stream from a FileInputStreamin - input stream from the corpuscharsetName - the charset to use while reading the corpusincludeHeadlines - if true will output the sentences marked as news headlinespublic SentenceSample read() throws java.io.IOException
ObjectStreamread in interface ObjectStream<SentenceSample>java.io.IOException - if there is an error during readingpublic void reset()
throws java.io.IOException,
java.lang.UnsupportedOperationException
ObjectStreamreset in interface ObjectStream<SentenceSample>java.io.IOException - if there is an error during reseting the streamjava.lang.UnsupportedOperationExceptionpublic void close()
throws java.io.IOException
ObjectStreamObjectStream and releases all allocated
resources. After close was called its not allowed to call
read or reset.close in interface java.lang.AutoCloseableclose in interface ObjectStream<SentenceSample>java.io.IOException - if there is an error during closing the streamCopyright © 2010 - 2020 Adobe. All Rights Reserved