Class FuzzySearchTerm

java.lang.Object
io.goobi.viewer.model.search.FuzzySearchTerm

public class FuzzySearchTerm extends Object
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 Details

    • WORD_PATTERN

      public static final String WORD_PATTERN
      Regex matching all characters within words, including umlauts etc.
      See Also:
    • NOT_WORD_PATTERN

      public static final String NOT_WORD_PATTERN
      Regex matching anything not matching WORD_PATTERN, including an empty string
      See Also:
    • WORD_SURROUNDED_BY_OTHER_CHARACTERS

      public static final String WORD_SURROUNDED_BY_OTHER_CHARACTERS
      Regex matching a word (according to WORD_PATTERN, surrounded by other characters (according to NOT_WORD_PATTERN. The word itself is the first capture group
      See Also:
  • Constructor Details

    • FuzzySearchTerm

      public FuzzySearchTerm(String term)
  • Method Details

    • getFullTerm

      public String getFullTerm()
    • getTerm

      public String getTerm()
    • getMaxDistance

      public int getMaxDistance()
    • isWildcardBack

      public boolean isWildcardBack()
    • isWildcardFront

      public boolean isWildcardFront()
    • isFuzzyTerm

      public static boolean isFuzzyTerm(String term)
    • matches

      public boolean matches(String text)
      Test if a given text containing a single word
      Parameters:
      text -
      Returns:
      boolean
    • calculateOptimalDistance

      public static int calculateOptimalDistance(String term)