Type Alias 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)

Aliased Type§

struct AnaValue(/* private fields */);

Trait Implementations§

source§

impl Anahash for AnaValue

source§

fn character(seqnr: CharIndexType) -> AnaValue

Computes the Anagram value for the n’th entry in the alphabet

source§

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>

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

Tests if the anagram value contains the specified anagram value

source§

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<'_>

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<'_>

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>

Iterator over all the possible deletions within the specified anagram distance

source§

fn empty() -> AnaValue

The value of an empty anahash Also corresponds to the root of the index

source§

fn is_empty(&self) -> bool

The value of an empty anahash Also corresponds to the root of the index

source§

fn char_count(&self, alphabet_size: CharIndexType) -> u16

Computes the number of characters in this anagram
source§

fn count_matches(&self, value: &AnaValue) -> usize

Count how many times an anagram value occurs in this anagram
source§

fn alphabet_upper_bound( &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