public final class WordResolver extends Object
Although this is an efficient data struct for specific set of usage patterns, one restriction is that the full set of words to include has to be known before constructing the instnace. Also, the size of the set is limited to total word content of about 20k characters.
TODO: Should document the internal data structure...
Modifier and Type | Field and Description |
---|---|
static int |
MAX_WORDS
Maximum number of words (Strings) an instance can contain
|
public static final int MAX_WORDS
public static WordResolver constructInstance(TreeSet<String> wordSet)
Note: currently maximum number of words that can be contained
is limited to MAX_WORDS
; additionally, maximum length
of all such words can not exceed roughly 28000 characters.
public int size()
public String find(char[] str, int start, int end)
str
- Character array that contains the word to findstart
- Index of the first character of the wordend
- Index following the last character of the word,
so that end - start
equals word length (similar
to the way String.substring()
has).public String find(String str)
Copyright © 2018 FasterXML. All rights reserved.