logo
pub struct QGramIndex { /* private fields */ }
Expand description

A classical, flexible, q-gram index implementation.

Uses |alphabet|^q + k words of memory, where k is the number of q-grams in the text with count at most max_count (if specified).

Implementations

Create a new q-gram index. The q has to be smaller than b / log2(|A|) with |A| being the alphabet size and b the number bits with the usize data type.

Create a new q-gram index, only considering q-grams that occur at most max_count times. The q has to be smaller than b / log2(|A|) with |A| being the alphabet size and b the number bits with the usize data type.

The used q.

Return text positions with matching q-gram. Complexity O(1).

Return matches of the given pattern, matching in at least min_count q-grams. Complexity O(m + k) for pattern of length m and k being the number of matching q-grams.

A match is a substring of pattern and a corresponding substring of the text that share at least min_count q-grams.

Return exact matches (substrings) of the given pattern. Complexity O(m + k) for pattern of length m and k being the number of matching q-grams.

An exact match is a substring of pattern occurring in the text of length at least q.

Trait Implementations

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.