Struct bio::data_structures::qgram_index::QGramIndex [−][src]
pub struct QGramIndex { /* fields omitted */ }
A classical, flexible, q-gram index implementation.
Methods
impl QGramIndex
[src]
impl QGramIndex
pub fn new(q: u32, text: &[u8], alphabet: &Alphabet) -> Self
[src]
pub fn new(q: u32, text: &[u8], alphabet: &Alphabet) -> Self
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.
pub fn with_max_count(
q: u32,
text: &[u8],
alphabet: &Alphabet,
max_count: usize
) -> Self
[src]
pub fn with_max_count(
q: u32,
text: &[u8],
alphabet: &Alphabet,
max_count: usize
) -> Self
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.
pub fn q(&self) -> u32
[src]
pub fn q(&self) -> u32
The used q.
pub fn qgram_matches(&self, qgram: usize) -> &[usize]
[src]
pub fn qgram_matches(&self, qgram: usize) -> &[usize]
Return text positions with matching q-gram. Complexity O(1).
pub fn matches(&self, pattern: &[u8], min_count: usize) -> Vec<Match>
[src]
pub fn matches(&self, pattern: &[u8], min_count: usize) -> Vec<Match>
Return matches of the given pattern. Complexity O(m + k) for pattern of length m and k being the number of matching q-grams.
pub fn exact_matches(&self, pattern: &[u8]) -> Vec<ExactMatch>
[src]
pub fn exact_matches(&self, pattern: &[u8]) -> Vec<ExactMatch>
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.
Auto Trait Implementations
impl Send for QGramIndex
impl Send for QGramIndex
impl Sync for QGramIndex
impl Sync for QGramIndex