Type Definition analiticcl::types::AnaValue [−][src]
type AnaValue = UBig;
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
impl Anahash for AnaValue
[src]
impl Anahash for AnaValue
[src]fn character(seqnr: CharIndexType) -> AnaValue
[src]
Computes the Anagram value for the n’th entry in the alphabet
fn insert(&self, value: &AnaValue) -> AnaValue
[src]
Insert the characters represented by the anagram value, returning the result
fn delete(&self, value: &AnaValue) -> Option<AnaValue>
[src]
Delete the characters represented by the anagram value, returning the result Returns None of the anagram was not found
fn contains(&self, value: &AnaValue) -> bool
[src]
Tests if the anagram value contains the specified anagram value
fn iter(&self, alphabet_size: CharIndexType) -> RecurseDeletionIterator<'_>ⓘNotable traits for RecurseDeletionIterator<'_>
impl Iterator for RecurseDeletionIterator<'_> type Item = (DeletionResult, u32);
[src]
Notable traits for RecurseDeletionIterator<'_>
impl Iterator for RecurseDeletionIterator<'_> type Item = (DeletionResult, u32);
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)); }
fn iter_parents(&self, alphabet_size: CharIndexType) -> DeletionIterator<'_>ⓘNotable traits for DeletionIterator<'a>
impl<'a> Iterator for DeletionIterator<'a> type Item = DeletionResult;
[src]
Notable traits for DeletionIterator<'a>
impl<'a> Iterator for DeletionIterator<'a> type Item = DeletionResult;
Iterator over all the parents that are generated when applying all deletions within edit distance 1
fn iter_recursive(
&self,
alphabet_size: CharIndexType,
params: &SearchParams
) -> RecurseDeletionIterator<'_>ⓘNotable traits for RecurseDeletionIterator<'_>
impl Iterator for RecurseDeletionIterator<'_> type Item = (DeletionResult, u32);
[src]
&self,
alphabet_size: CharIndexType,
params: &SearchParams
) -> RecurseDeletionIterator<'_>ⓘ
Notable traits for RecurseDeletionIterator<'_>
impl Iterator for RecurseDeletionIterator<'_> type Item = (DeletionResult, u32);
Iterator over all the possible deletions within the specified anagram distance
fn iter_recursive_external_cache<'a>(
&self,
alphabet_size: CharIndexType,
params: &SearchParams,
cache: &'a mut HashSet<AnaValue>
) -> RecurseDeletionIterator<'a>ⓘNotable traits for RecurseDeletionIterator<'_>
impl Iterator for RecurseDeletionIterator<'_> type Item = (DeletionResult, u32);
[src]
&self,
alphabet_size: CharIndexType,
params: &SearchParams,
cache: &'a mut HashSet<AnaValue>
) -> RecurseDeletionIterator<'a>ⓘ
Notable traits for RecurseDeletionIterator<'_>
impl Iterator for RecurseDeletionIterator<'_> type Item = (DeletionResult, u32);
Iterator over all the possible deletions within the specified anagram distance
fn empty() -> AnaValue
[src]
The value of an empty anahash Also corresponds to the root of the index
fn is_empty(&self) -> bool
[src]
The value of an empty anahash Also corresponds to the root of the index
fn char_count(&self, alphabet_size: CharIndexType) -> u16
[src]
Computes the number of characters in this anagram
fn alphabet_upper_bound(
&self,
alphabet_size: CharIndexType
) -> (CharIndexType, u16)
[src]
&self,
alphabet_size: CharIndexType
) -> (CharIndexType, u16)
Returns the the upper bound of the alphabet size as used in this anavalue, which may be lower than the actual alphabet size. Returns a character index in the alphabet, also returns the character count as 2nd member of the tuple