public class PatternDiscriminator extends Object
| Constructor and Description |
|---|
PatternDiscriminator(int limit,
boolean collapseAlphaNumeric,
boolean strict)
Creates a pattern discriminator with the specified behaviour.
|
| Modifier and Type | Method and Description |
|---|---|
Pattern |
analyze(String input)
Analyzes the specified string and attempts to categorize it as one of our existing
patterns up to the limit of the number of patterns that was indicated at construction
time.
|
ArrayList<String> |
getFormattedPatterns() |
ArrayList<Pattern> |
getPatterns() |
public PatternDiscriminator(int limit,
boolean collapseAlphaNumeric,
boolean strict)
limit - the limit of the number of distinct patterns we'll recognizecollapseAlphaNumeric - indicates we'll treat alphanumerics as a single class of token,
otherwise we differentiate between letters and numbersstrict - if true, when we try to match existing patterns, we'll take into account the length
of the individual tokens - if the lengths of each token on the pattern don't match, we don't match.public Pattern analyze(String input)
input - the string we'll analyzeCopyright © 2023. All rights reserved.