Class LeipzigLanguageSampleStream

java.lang.Object
opennlp.tools.formats.leipzig.LeipzigLanguageSampleStream
All Implemented Interfaces:
AutoCloseable, opennlp.tools.util.ObjectStream<opennlp.tools.langdetect.LanguageSample>

public class LeipzigLanguageSampleStream extends Object implements opennlp.tools.util.ObjectStream<opennlp.tools.langdetect.LanguageSample>
  • Constructor Details

    • LeipzigLanguageSampleStream

      public LeipzigLanguageSampleStream(File leipzigFolder, int sentencesPerSample, int samplesPerLanguage) throws IOException
      Parameters:
      leipzigFolder - The directory which contains files to process.
      sentencesPerSample - The number of sentences per sample.
      samplesPerLanguage - The number of samples per language to process at maximum.
      Throws:
      IOException - Thrown if IO errors occurred.
  • Method Details

    • read

      public opennlp.tools.langdetect.LanguageSample read() throws IOException
      Specified by:
      read in interface opennlp.tools.util.ObjectStream<opennlp.tools.langdetect.LanguageSample>
      Throws:
      IOException
    • reset

      public void reset() throws IOException
      Specified by:
      reset in interface opennlp.tools.util.ObjectStream<opennlp.tools.langdetect.LanguageSample>
      Throws:
      IOException