Package io.goobi.viewer.model.search
Class FuzzySearchTerm
java.lang.Object
io.goobi.viewer.model.search.FuzzySearchTerm
Class for extracting the actual search term from a fuzzy search. For creating a fuzzy search term see
SearchHelper.addFuzzySearchToken(String, String, String)- Author:
- Florian Alpers
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringRegex matching anything not matchingWORD_PATTERN, including an empty string.static final StringRegex matching all characters within words, including umlauts etc.static final StringRegex matching a word (according toWORD_PATTERN, surrounded by other characters (according toNOT_WORD_PATTERN. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intintgetTerm()static booleanisFuzzyTerm(String term) booleanbooleanbooleanTests if a given text containing a single word.
-
Field Details
-
WORD_PATTERN
Regex matching all characters within words, including umlauts etc.- See Also:
-
NOT_WORD_PATTERN
Regex matching anything not matchingWORD_PATTERN, including an empty string.- See Also:
-
WORD_SURROUNDED_BY_OTHER_CHARACTERS
Regex matching a word (according toWORD_PATTERN, surrounded by other characters (according toNOT_WORD_PATTERN. The word itself is the first capture group- See Also:
-
-
Constructor Details
-
FuzzySearchTerm
-
-
Method Details
-
getFullTerm
-
getTerm
-
getMaxDistance
public int getMaxDistance() -
isWildcardBack
public boolean isWildcardBack() -
isWildcardFront
public boolean isWildcardFront() -
isFuzzyTerm
-
matches
Tests if a given text containing a single word.- Parameters:
text- single word to test against this fuzzy search term- Returns:
- boolean
-
calculateOptimalDistance
-