Description
FuzzyScore was adapted from StringUtils#getFuzzyDistance and the JavaDoc was copied as is. The deprecated utility method took three arguments (term, query, locale). The class takes locale as a constructor argument and the remaining as method arguments. However, the JavaDoc was unchanged and shows the locale method parameter.
/** * <p> * Find the Fuzzy Score which indicates the similarity score between two * Strings. * </p> * * <pre> * score.fuzzyScore(null, null, null) = IllegalArgumentException * score.fuzzyScore("", "", Locale.ENGLISH) = 0 * score.fuzzyScore("Workshop", "b", Locale.ENGLISH) = 0 * score.fuzzyScore("Room", "o", Locale.ENGLISH) = 1 * score.fuzzyScore("Workshop", "w", Locale.ENGLISH) = 1 * score.fuzzyScore("Workshop", "ws", Locale.ENGLISH) = 2 * score.fuzzyScore("Workshop", "wo", Locale.ENGLISH) = 4 * score.fuzzyScore("Apache Software Foundation", "asf", Locale.ENGLISH) = 3 * </pre> * * @param term a full term that should be matched against, must not be null * @param query the query that will be matched against a term, must not be * null * @return result score * @throws IllegalArgumentException if either CharSequence input is {@code null} */ public Integer fuzzyScore(final CharSequence term, final CharSequence query) {
Attachments
Issue Links
- links to