Package com._1c.g5.v8.dt.common
Class FuzzyPattern
- java.lang.Object
-
- com._1c.g5.v8.dt.common.FuzzyPattern
-
public class FuzzyPattern extends Object
Fuzzy pattern matcher. Sample string matched if:
- Sample string contains pattern string as a simple substring.
- All pattern words are prefixes of corresponding sample words.
- Pattern may be split into words that all matches prefixes of sample words.
For example, given the pattern "foo123bar", the pattern words are:
foo
,123
,bar
.Following samples are matched:
FooBar123
,FoobuzBarbuz12345
,123 bar foo
,B12Ar3foo
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FuzzyPattern.Match
Represent the fuzzy match result.
-
Constructor Summary
Constructors Constructor Description FuzzyPattern(String pattern)
Instantiates a new fuzzy pattern.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FuzzyPattern.Match
match(String sample, boolean useMutation)
Matches the sample.
-
-
-
Constructor Detail
-
FuzzyPattern
public FuzzyPattern(String pattern)
Instantiates a new fuzzy pattern.- Parameters:
pattern
- the pattern
-
-
Method Detail
-
match
public FuzzyPattern.Match match(String sample, boolean useMutation)
Matches the sample.- Parameters:
sample
- sample to match.useMutation
- use mutation (splitting) of pattern- Returns:
FuzzyPattern.Match.NONE
if sample not matched,FuzzyPattern.Match
describing the match otherwise.
-
-