Class AbstractClassPathModelFinder

java.lang.Object
opennlp.tools.models.AbstractClassPathModelFinder
All Implemented Interfaces:
opennlp.tools.models.ClassPathModelFinder
Direct Known Subclasses:
ClassgraphModelFinder, SimpleClassPathModelFinder

public abstract class AbstractClassPathModelFinder extends Object implements opennlp.tools.models.ClassPathModelFinder
A base implementation of a ClassPathModelFinder for the detection of OpenNLP models in the classpath. By default, AbstractClassPathModelFinder will scan for JAR files starting with "opennlp-models-*".

This search mask can be adjusted by using the one argument constructor. Wildcard search is supported by using asterisk symbol.

See Also:
  • ClassPathModelFinder
  • Constructor Details

    • AbstractClassPathModelFinder

      public AbstractClassPathModelFinder()
      By default, it scans for ClassPathModelFinder.OPENNLP_MODEL_JAR_PREFIX.
    • AbstractClassPathModelFinder

      public AbstractClassPathModelFinder(String jarModelPrefix)
      Parameters:
      jarModelPrefix - The leafnames of the jars that should be canned (e.g. "opennlp.jar"). May contain a wildcard glob ("opennlp-*.jar"). It must not be null.
  • Method Details

    • findModels

      public Set<opennlp.tools.models.ClassPathModelEntry> findModels(boolean reloadCache)
      Specified by:
      findModels in interface opennlp.tools.models.ClassPathModelFinder