Package opennlp.tools.models
Class WildcardMatcher
java.lang.Object
opennlp.tools.models.WildcardMatcher
Matches file names against the wildcards accepted by
AbstractClassPathModelFinder.matchesWildcard(java.net.URL, String). A *
matches any run of code points, including none, a ? matches exactly one code point,
and every other code point stands for itself; there is no escape character. The wildcard
must cover the whole input and the comparison is case-sensitive.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
ANY_RUN
private static final int ANY_RUN- See Also:
-
ANY_ONE
private static final int ANY_ONE- See Also:
-
-
Constructor Details
-
WildcardMatcher
private WildcardMatcher()
-
-
Method Details
-
matches
Tests whether the wholeinputis covered bywildcard. Both are compared by code point, so a supplementary character, or an unpaired surrogate, counts as one code point for?. The scan keeps a single backtracking point, the most recent*, so it never takes more thanwildcard.length() * input.length()steps.- Parameters:
wildcard- The wildcard expression. Must not benull.input- The text to test. Must not benull.- Returns:
trueifinputmatcheswildcardfrom start to end,falseotherwise.
-