Type Alias TrieSearchOptions
cache?: boolean;
expandRegexes?: [{
alternate: string;
regex: RegExp;
}];
ignoreCase?: boolean;
insertFullUnsplitKey?: boolean;
maxCacheSize?: number;
min?: number;
splitOnGetRegEx?: RegExp | false;
splitOnRegEx?: RegExp | false;
tokenizer?: ((str: string) => IterableIterator<string>);
}
Type declaration
Optionalcache?: booleanIs caching enabled; default: true.
OptionalexpandRegexes ?: [{
alternate: string;
regex: RegExp;
}]By default, this is set to an array of international vowels expansions, allowing searches for vowels like 'a' to return matches on 'å' or 'ä' etc. Set this to an empty array /
[]if you want to disable it. See the top ofsrc/trie/TrieSearch.jsfile for examples.OptionalignoreCase ?: booleanIgnores case in lookups; default:
true.OptionalinsertFull ?: booleanUnsplit Key In
TrieSearch.mapwhensplitOnRegExis defined andinsertFullUnsplitKeyis true the full key will also be mapped; default:false.OptionalmaxCache ?: numberSize The max cache size before removing entries in a LRU manner; default:
64.Optionalmin?: numberThe size of the prefix for keys; minimum length of a key to store and search. By default, this is
1, but you might improve performance by using2or3.OptionalsplitOn ?: RegExp | falseGet Reg Ex How phrases are split on retrieval / get; default:
/\s/g.OptionalsplitOn ?: RegExp | falseReg Ex How phrases are split on search; default:
/\s/g. By default, this is any whitespace. Set tofalseif you have whitespace in your keys! Set it to something else to split along other boundaries.Optionaltokenizer?: ((str: string) => IterableIterator<string>)Provide a custom tokenizer that is used to split keys. IE a Grapheme / Unicode tokenizer.
- (str): IterableIterator<string>
Parameters
- str: string
Returns IterableIterator<string>
Options for TrieSearch.