public class TextMatcher extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
IGNORE_CASE
Flag indicating to ignore case differences.
|
static int |
IGNORE_PUNCTUATION
Flag indication to ignore punctuation differences.
|
static int |
IGNORE_WHITESPACES
Flag indicating to ignore whitespaces differences.
|
| Constructor and Description |
|---|
TextMatcher(LocaleId locale1,
LocaleId locale2)
Creates a new TextMatcher object.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(TextFragment frag1,
TextFragment frag2,
int options)
Compare two textFragment content.
|
int |
compareToBaseTokens(String text1,
List<String> tokens1,
TextFragment frag2)
Compare a list of tokens to a
TextFragment object. |
protected static short |
minimum(int value1,
int value2,
int value3)
Returns the minimum value between three given values.
|
List<String> |
prepareBaseTokens(String plainText)
Creates a list of tokens from a string to use
with the
compareToBaseTokens(String, List, TextFragment). |
public static final int IGNORE_CASE
public static final int IGNORE_WHITESPACES
public static final int IGNORE_PUNCTUATION
protected static short minimum(int value1,
int value2,
int value3)
value1 - the first given value.value2 - the second given value.value3 - the third given value.public int compare(TextFragment frag1, TextFragment frag2, int options)
frag1 - The base fragment.frag2 - the fragment to compare against the base fragment.options - Comparison options.public List<String> prepareBaseTokens(String plainText)
compareToBaseTokens(String, List, TextFragment).plainText - the based text.public int compareToBaseTokens(String text1, List<String> tokens1, TextFragment frag2)
TextFragment object.text1 - the original plain text.tokens1 - the list of tokens.frag2 - the fragment to compare against list of tokens.Copyright © 2019. All rights reserved.