DoubleArrayTries

Documentation for DoubleArrayTries.

DoubleArrayTries.CommonPrefixSearchType
CommonPrefixSearch(dat::DoubleArrayTrie, key::AbstractString)

Return a iterable object that iterate through all string in the trie that has common prefix with key. Each element is a tuple of id and the string (Tuple{Int, String}).

DoubleArrayTries.DoubleArrayTrieMethod
DoubleArrayTrie(keys::AbstractVector{<:AbstractString}; bin_mode = true)

Accept a list of strings and build the double array trie. If keys is a Vector, it will be modified by sort! and unique!. Set bin_mode = true allow '' as a character, this is needed for non-ascii strings.

DoubleArrayTries.PredictiveSearchType
PredictiveSearch(dat::DoubleArrayTrie, key::AbstractString)

Return a iterable object that iterate through all string in the trie that has prefix of prefix. Each element is be a tuple of id and the string (Tuple{Int, String}).

DoubleArrayTries.decodeMethod
decode(dat::DoubleArrayTrie, i::Int)

Take an id i and return a corresponding string in the trie. If i <= 0 || i > length(dat), it will always return nothing.

DoubleArrayTries.lookupMethod
lookup(dat::DoubleArrayTrie, key::S) where S <: Union{AbstractString, AbstractVector{UInt8}}

Lookup the key in the trie, return a unique id where 0 <= id <= length(dat). If the id is 0, it means the key does not present in the trie.