One point is given for every matched character. Subsequent matches yield two bonus points. A higher score indicates a higher similarity.
This code has been adapted from Apache Commons Lang 3.3.
| Modifier and Type | Field and Description |
|---|---|
| private final Locale | locale
Locale used to change the case of text. |
| Access | Constructor and Description |
|---|---|
| public | FuzzyScore(final Locale
The string matching logic is case insensitive. A locale)Locale is necessary to normalize both Strings to lower case.Constructs a new instance for a |
| Modifier and Type | Method and Description |
|---|---|
| public Integer | Returns: result score.a full term that should be matched against, must not be null. term, final CharSequence the query that will be matched against a term, must not be null. query)Computes the Fuzzy Score which indicates the similarity score between two Strings. |
| public Locale |
| locale | back to summary |
|---|---|
| private final Locale locale Locale used to change the case of text. | |
| FuzzyScore | back to summary |
|---|---|
| public FuzzyScore(final Locale locale) Constructs a new instance for a
| |
| fuzzyScore | back to summary |
|---|---|
| public Integer fuzzyScore(final CharSequence term, final CharSequence query) Computes the Fuzzy Score which indicates the similarity score between two Strings. score.fuzzyScore(null, null) = Throws
| |
| getLocale | back to summary |
|---|---|
| public Locale getLocale() Gets the locale.
| |