Class ADSentenceSampleStream
java.lang.Object
opennlp.tools.formats.ad.ADSentenceSampleStream
- All Implemented Interfaces:
AutoCloseable, opennlp.tools.util.ObjectStream<opennlp.tools.sentdetect.SentenceSample>
@Internal
public class ADSentenceSampleStream
extends Object
implements opennlp.tools.util.ObjectStream<opennlp.tools.sentdetect.SentenceSample>
Note:
Do not use this class, internal use only!
-
Constructor Summary
ConstructorsConstructorDescriptionADSentenceSampleStream(opennlp.tools.util.InputStreamFactory in, String charsetName, boolean includeHeadlines) Initializes a newADSentenceSampleStream.ADSentenceSampleStream(opennlp.tools.util.ObjectStream<String> lineStream, boolean includeHeadlines) Initializes a newADSentenceSampleStreamfrom aopennlp.tools.util.ObjectStream<String>, that could be aPlainTextByLineStreamobject. -
Method Summary
-
Constructor Details
-
ADSentenceSampleStream
public ADSentenceSampleStream(opennlp.tools.util.ObjectStream<String> lineStream, boolean includeHeadlines) Initializes a newADSentenceSampleStreamfrom aopennlp.tools.util.ObjectStream<String>, that could be aPlainTextByLineStreamobject.- Parameters:
lineStream- A stream of lines asString.includeHeadlines- Iftruewill output the sentences marked as news headlines.
-
ADSentenceSampleStream
public ADSentenceSampleStream(opennlp.tools.util.InputStreamFactory in, String charsetName, boolean includeHeadlines) throws IOException Initializes a newADSentenceSampleStream.- Parameters:
in- TheInputStreamFactoryfor the corpus.charsetName- Thecharsetto use for reading of the corpus.includeHeadlines- Iftruewill output the sentences marked as news headlines.- Throws:
IOException- Thrown if IO errors occurred.
-
-
Method Details
-
read
- Specified by:
readin interfaceopennlp.tools.util.ObjectStream<opennlp.tools.sentdetect.SentenceSample>- Throws:
IOException
-
reset
- Specified by:
resetin interfaceopennlp.tools.util.ObjectStream<opennlp.tools.sentdetect.SentenceSample>- Throws:
IOExceptionUnsupportedOperationException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceopennlp.tools.util.ObjectStream<opennlp.tools.sentdetect.SentenceSample>- Throws:
IOException
-