Trait analiticcl::anahash::Anahash [−][src]
pub trait Anahash: One + Zero { fn character(seqnr: CharIndexType) -> AnaValue; fn empty() -> AnaValue; fn is_empty(&self) -> bool; fn insert(&self, value: &AnaValue) -> AnaValue; fn delete(&self, value: &AnaValue) -> Option<AnaValue>; fn contains(&self, value: &AnaValue) -> bool; fn iter(&self, alphabet_size: CharIndexType) -> RecurseDeletionIterator<'_>ⓘ; fn iter_parents(&self, alphabet_size: CharIndexType) -> DeletionIterator<'_>ⓘNotable traits for RecurseDeletionIterator<'_>
impl Iterator for RecurseDeletionIterator<'_> type Item = (DeletionResult, u32);
; fn iter_recursive(Notable traits for DeletionIterator<'a>
impl<'a> Iterator for DeletionIterator<'a> type Item = DeletionResult;
&self,
alphabet_size: CharIndexType,
params: &SearchParams
) -> RecurseDeletionIterator<'_>ⓘ; fn iter_recursive_external_cache<'a>(Notable traits for RecurseDeletionIterator<'_>
impl Iterator for RecurseDeletionIterator<'_> type Item = (DeletionResult, u32);
&self,
alphabet_size: CharIndexType,
params: &SearchParams,
cache: &'a mut HashSet<AnaValue>
) -> RecurseDeletionIterator<'a>ⓘ; fn char_count(&self, alphabet_size: CharIndexType) -> u16; fn alphabet_upper_bound(Notable traits for RecurseDeletionIterator<'_>
impl Iterator for RecurseDeletionIterator<'_> type Item = (DeletionResult, u32);
&self,
alphabet_size: CharIndexType
) -> (CharIndexType, u16); }
This trait can be applied to types that can function as anahashes. It can be implemented for integer types.
Required methods
fn character(seqnr: CharIndexType) -> AnaValue
[src]
fn empty() -> AnaValue
[src]
fn is_empty(&self) -> bool
[src]
fn insert(&self, value: &AnaValue) -> AnaValue
[src]
fn delete(&self, value: &AnaValue) -> Option<AnaValue>
[src]
fn contains(&self, value: &AnaValue) -> bool
[src]
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);
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;
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);
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);
fn char_count(&self, alphabet_size: CharIndexType) -> u16
[src]
fn alphabet_upper_bound(
&self,
alphabet_size: CharIndexType
) -> (CharIndexType, u16)
[src]
&self,
alphabet_size: CharIndexType
) -> (CharIndexType, u16)
Implementors
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