Package de.cxp.ocs.smartsuggest.util
Class Util
- java.lang.Object
-
- de.cxp.ocs.smartsuggest.util.Util
-
public class Util extends Object
-
-
Constructor Summary
Constructors Constructor Description Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doublecommonChars(@NonNull Locale locale, @NonNull String input, @NonNull String target)Returns the common chars of an input string compared to an target string.
-
-
-
Field Detail
-
APP_NAME
public static final String APP_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
commonChars
public static double commonChars(@NonNull @NonNull Locale locale, @NonNull @NonNull String input, @NonNull @NonNull String target)Returns the common chars of an input string compared to an target string. The logic works directional, so it's important to always compare to the same target and change the input- Parameters:
locale- the locale used to any string normalizationsinput- the input string to compare against the targettarget- the target string- Returns:
- a value between
1and0, where1means all chars are common and0means no chars are common.
-
-