Type Definition analiticcl::types::AnaValue
source · pub type AnaValue = UBig;
Expand description
The anagram hash: uses a bag-of-characters representation where each bit flags the presence/absence of a certain character (the order of the bits are defined by Alphabet)
Trait Implementations§
source§impl Anahash for AnaValue
impl Anahash for AnaValue
source§fn character(seqnr: CharIndexType) -> AnaValue
fn character(seqnr: CharIndexType) -> AnaValue
Computes the Anagram value for the n’th entry in the alphabet
source§fn insert(&self, value: &AnaValue) -> AnaValue
fn insert(&self, value: &AnaValue) -> AnaValue
Insert the characters represented by the anagram value, returning the result
source§fn delete(&self, value: &AnaValue) -> Option<AnaValue>
fn delete(&self, value: &AnaValue) -> Option<AnaValue>
Delete the characters represented by the anagram value, returning the result Returns None of the anagram was not found
source§fn contains(&self, value: &AnaValue) -> bool
fn contains(&self, value: &AnaValue) -> bool
Tests if the anagram value contains the specified anagram value
source§fn iter(&self, alphabet_size: CharIndexType) -> RecurseDeletionIterator<'_> ⓘ
fn iter(&self, alphabet_size: CharIndexType) -> RecurseDeletionIterator<'_> ⓘ
Iterate over all characters in this alphabet
Returns DeletionResult instances that holds
a charindex
attribute indicating the index
in the alphabet. If there are duplicates,
this iterator returns them all.
Examples
let anavalue: AnaValue = "house".anahash(&alphabet);
let mut chars: Vec<AnaValue> = Vec::new();
for (deletion, depth) in anavalue.iter(alphabet_size) {
chars.push(AnaValue::character(deletion.charindex));
}
source§fn iter_parents(&self, alphabet_size: CharIndexType) -> DeletionIterator<'_> ⓘ
fn iter_parents(&self, alphabet_size: CharIndexType) -> DeletionIterator<'_> ⓘ
Iterator over all the parents that are generated when applying all deletions within edit distance 1
source§fn iter_recursive(
&self,
alphabet_size: CharIndexType,
params: &SearchParams
) -> RecurseDeletionIterator<'_> ⓘ
fn iter_recursive( &self, alphabet_size: CharIndexType, params: &SearchParams ) -> RecurseDeletionIterator<'_> ⓘ
Iterator over all the possible deletions within the specified anagram distance
source§fn iter_recursive_external_cache<'a>(
&self,
alphabet_size: CharIndexType,
params: &SearchParams,
cache: &'a mut HashSet<AnaValue>
) -> RecurseDeletionIterator<'a> ⓘ
fn iter_recursive_external_cache<'a>( &self, alphabet_size: CharIndexType, params: &SearchParams, cache: &'a mut HashSet<AnaValue> ) -> RecurseDeletionIterator<'a> ⓘ
Iterator over all the possible deletions within the specified anagram distance
source§fn empty() -> AnaValue
fn empty() -> AnaValue
The value of an empty anahash Also corresponds to the root of the index
source§fn is_empty(&self) -> bool
fn is_empty(&self) -> bool
The value of an empty anahash Also corresponds to the root of the index