public class FuzzyMatcher
extends java.lang.Object
Constructor and Description |
---|
FuzzyMatcher() |
Modifier and Type | Method and Description |
---|---|
static java.util.HashMap<java.lang.String,java.lang.Object> |
getMatch(java.lang.String str,
java.util.ArrayList<java.lang.String> list)
Overloaded method of getMatch(String str, String[] StringsToBematched),that allows passing in
an ArrayList instead of String[].
|
static java.util.HashMap<java.lang.String,java.lang.Object> |
getMatch(java.lang.String str,
java.lang.String[] stringsToBeMatched)
Pass in a String to be matched to, along with an Array of Strings that are to be examined
for the closest match.
|
static java.util.ArrayList<java.util.HashMap> |
matchLists(java.util.ArrayList<java.lang.String> a,
java.util.ArrayList<java.lang.String> b)
Returns an ArrayList<HashMap> for the closest match for each element in ArrayList a to ArrayList b.
|
static float |
score(java.lang.String a,
java.lang.String b)
Returns a percentage of characters that match between strings.
|
@NotNull public static java.util.ArrayList<java.util.HashMap> matchLists(@NotNull java.util.ArrayList<java.lang.String> a, @NotNull java.util.ArrayList<java.lang.String> b)
a
- ArrayList<String> of items to be matchedb
- ArrayList<String> of items of possible matches@NotNull public static java.util.HashMap<java.lang.String,java.lang.Object> getMatch(@Nullable java.lang.String str, @Nullable java.lang.String[] stringsToBeMatched)
HashMap
with String fields "MATCH" and "SCORE" of
the String in the array with the closest match.str
- String base to find closest match forstringsToBeMatched
- String[] of strings to test against str@NotNull public static java.util.HashMap<java.lang.String,java.lang.Object> getMatch(java.lang.String str, @NotNull java.util.ArrayList<java.lang.String> list)
str
- Base String to be matched tolist
- ArrayList<String> of strings to be tested for the closest match to strpublic static float score(@Nullable java.lang.String a, @Nullable java.lang.String b)
a
- Stringb
- String