PlainTextNaiveBayesModelReader (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.ml.naivebayes

## Class PlainTextNaiveBayesModelReader

- java.lang.Object
- - opennlp.tools.ml.model.AbstractModelReader
  - - opennlp.tools.ml.naivebayes.NaiveBayesModelReader
    - - opennlp.tools.ml.naivebayes.PlainTextNaiveBayesModelReader

-     public class PlainTextNaiveBayesModelReader
      extends NaiveBayesModelReader

- - ### Field Summary

    - ### Fields inherited from class opennlp.tools.ml.model.AbstractModelReader

      `MAX_ENTRIES_PROPERTY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PlainTextNaiveBayesModelReader(BufferedReader br)` Constructor which directly instantiates the BufferedReader containing the model contents.
    `PlainTextNaiveBayesModelReader(File f)` Constructor which takes a File and creates a reader for it.

  - ### Method Summary

    - ### Methods inherited from class opennlp.tools.ml.naivebayes.NaiveBayesModelReader

      `checkModelType, constructModel`

    - ### Methods inherited from class opennlp.tools.ml.model.AbstractModelReader

      `getModel, readDouble, readInt, readUTF`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PlainTextNaiveBayesModelReader

          public PlainTextNaiveBayesModelReader(BufferedReader br)

      Constructor which directly instantiates the BufferedReader containing the model contents.
      Parameters:
        `br` - The BufferedReader containing the model information.

    - #### PlainTextNaiveBayesModelReader

          public PlainTextNaiveBayesModelReader(File f)
                                         throws IOException

      Constructor which takes a File and creates a reader for it. Detects whether the file is gzipped or not based on whether the suffix contains ".gz".
      Parameters:
        `f` - The File in which the model is stored.
      Throws:
        `IOException`

Copyright © 2026 The Apache Software Foundation. All rights reserved.