Class AbstractSearchParser
java.lang.Object
io.goobi.viewer.model.iiif.search.parser.AbstractSearchParser
- Direct Known Subclasses:
AltoSearchParser
,SolrSearchParser
Abstract AbstractSearchParser class.
- Author:
- florian
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getAutoSuggestRegex
(String query) Create a regular expression matching all anything starting with the given query followed by an arbitrary number of word characters and ignoring casestatic String
getContainedWordRegex
(String query) getContainedWordRegex.static String
getPrecedingText
(String text, int hitStartIndex, int maxLength) getPrecedingText.static String
getQueryRegex
(String query) getQueryRegex.static String
getSingleWordRegex
(String query) getSingleWordRegex.static String
getSucceedingText
(String text, int hitEndIndex, int maxLength) getSucceedingText.
-
Constructor Details
-
AbstractSearchParser
public AbstractSearchParser()
-
-
Method Details
-
getPrecedingText
getPrecedingText.
-
getSucceedingText
getSucceedingText.
-
getSingleWordRegex
getSingleWordRegex.
- Parameters:
query
- aString
object.- Returns:
- a regex matching a single word matching the given query regex (ignoring case)
-
getContainedWordRegex
getContainedWordRegex.
- Parameters:
query
- aString
object.- Returns:
- a regex matching any text containing the given query regex as single word
-
getQueryRegex
getQueryRegex.
- Parameters:
query
- aString
object.- Returns:
- a regex matching any word or sequence of words of the given query with '*' matching any number of word characters and ignoring case
-
getAutoSuggestRegex
Create a regular expression matching all anything starting with the given query followed by an arbitrary number of word characters and ignoring case- Parameters:
query
- aString
object.- Returns:
- the regular expression
(?i){query}[\w\d-]*
-