Class ClassPathModelLoader

java.lang.Object
opennlp.tools.models.ClassPathModelLoader

public class ClassPathModelLoader extends Object
Responsible for loading OpenNLP models from the classpath via entries. If models could be loaded successfully, those are provided as model references or as instances of the specified ModelType.
See Also:
  • Constructor Details

    • ClassPathModelLoader

      public ClassPathModelLoader()
  • Method Details

    • load

      public ClassPathModel load(opennlp.tools.models.ClassPathModelEntry entry) throws IOException
      Loads a ClassPathModel from a ClassPathModelEntry
      Parameters:
      entry - A valid ClassPathModelEntry, it must not be null. Moreover, it is validated that the binary data and meta-data are not null.
      Returns:
      A ClassPathModel containing the model resources.
      Throws:
      IOException - Thrown if something went wrong during reading resources from the classpath.