Package opennlp.tools.models
Class AbstractClassPathModelFinder
java.lang.Object
opennlp.tools.models.AbstractClassPathModelFinder
- All Implemented Interfaces:
ClassPathModelFinder
- Direct Known Subclasses:
ClassgraphModelFinder
,SimpleClassPathModelFinder
Enables the detection of OpenNLP models in the classpath. By default, this class will search
for JAR files starting with "opennlp-models-*". This wildcard pattern can be adjusted by
using the alternative constructor of this class.
-
Field Summary
Fields inherited from interface opennlp.tools.models.ClassPathModelFinder
OPENNLP_MODEL_JAR_PREFIX
-
Constructor Summary
ConstructorsConstructorDescriptionBy default, it scans forClassPathModelFinder.OPENNLP_MODEL_JAR_PREFIX
.AbstractClassPathModelFinder
(String jarModelPrefix) -
Method Summary
Modifier and TypeMethodDescriptionfindModels
(boolean reloadCache) Finds OpenNLP models within the classpath.
-
Constructor Details
-
AbstractClassPathModelFinder
public AbstractClassPathModelFinder()By default, it scans forClassPathModelFinder.OPENNLP_MODEL_JAR_PREFIX
. -
AbstractClassPathModelFinder
- 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 benull
.
-
-
Method Details
-
findModels
Description copied from interface:ClassPathModelFinder
Finds OpenNLP models within the classpath.- Specified by:
findModels
in interfaceClassPathModelFinder
- Parameters:
reloadCache
-true
, if the internal cache should explicitly be reloaded,false
otherwise.- Returns:
- A Set of
model entries
. It might be empty if none were found.
-