Struct bio::alphabets::RankTransform [−][src]
pub struct RankTransform { pub ranks: SymbolRanks, }
Tools based on transforming the alphabet symbols to their lexicographical ranks.
Fields
ranks: SymbolRanks
Methods
impl RankTransform
[src]
impl RankTransform
pub fn new(alphabet: &Alphabet) -> Self
[src]
pub fn new(alphabet: &Alphabet) -> Self
Construct a new RankTransform
.
pub fn get(&self, a: u8) -> u8
[src]
pub fn get(&self, a: u8) -> u8
Get the rank of symbol a
.
pub fn transform<'a, T: IntoTextIterator<'a>>(&self, text: T) -> Vec<u8>
[src]
pub fn transform<'a, T: IntoTextIterator<'a>>(&self, text: T) -> Vec<u8>
Transform a given text
.
ⓘImportant traits for QGrams<'a, T>pub fn qgrams<'a, T: IntoTextIterator<'a>>(
&'a self,
q: u32,
text: T
) -> QGrams<T::IntoIter>
[src]
ⓘImportant traits for QGrams<'a, T>
pub fn qgrams<'a, T: IntoTextIterator<'a>>(
&'a self,
q: u32,
text: T
) -> QGrams<T::IntoIter>
Iterate over q-grams (substrings of length q) of given text
. The q-grams are encoded
as usize
by storing the symbol ranks in log2(|A|) bits (with |A| being the alphabet size).
If q is larger than usize::BITS / log2(|A|), this method fails with an assertion.
pub fn alphabet(&self) -> Alphabet
[src]
pub fn alphabet(&self) -> Alphabet
Restore alphabet from transform.
Auto Trait Implementations
impl Send for RankTransform
impl Send for RankTransform
impl Sync for RankTransform
impl Sync for RankTransform