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
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Regex matching anything not matchingWORD_PATTERN
, including an empty stringstatic final String
Regex matching all characters within words, including umlauts etc.static final String
Regex matching a word (according toWORD_PATTERN
, surrounded by other characters (according toNOT_WORD_PATTERN
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
int
getTerm()
static boolean
isFuzzyTerm
(String term) boolean
boolean
boolean
Test 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
Test if a given text containing a single word- Parameters:
text
-- Returns:
- boolean
-
calculateOptimalDistance
-