Skip to content

Conversation

AlbertWeichselbraun
Copy link

This pull request allows specifying custom in-word characters for words by extending isPartialMatch in Trie.java, which improves the libraries flexibility in defining word boundaries.

Example:

// create a searcher that allows numbers and hyphens in words.
StringSearcher searcher = StringSearcher.builder().addSearchString("ER-Models")
                .addSearchString("Database").addSearchString("C2")
                .setIsInWordCharacter(ch -> Character.isAlphabetic(ch) || Character.isDigit(ch) || ch == '-').build();

Both the currently used onlyWholeWordsWhiteSpaceSeparated and onlyWholeWords flags can be expressed with a corresponding inWordCharacterexpression.
=> StringSearcherConfig.java has been adapted to continue supporting both flags as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant