Module util

Source

Functions§

filter_map_chunks
Performs a depth-first traversal over all possible chunk sequences in a slice, applies a filter-map function to each chunk in each sequence, and collects the filter-mapped sequences in a Vec.
full_keyword
Given a list of keywords for a suggestion, returns a phrase that best completes the user’s query. This function uses two heuristics to pick the best match:
i18n_cmp
Compares two strings ignoring case, Unicode combining marks, and some punctuation. Intended to be used as a Sqlite collating sequence for comparing natural language strings like keywords and geoname names.
i18n_transform
Performs the following transforms on the given string:
split_keyword
Given a keyword for a suggestion, splits the keyword by the first whitespace into the prefix and the suffix. Returns an empty string as the suffix if there is no whitespace.