Struct sea_canal::Analyzer
[−]
[src]
pub struct Analyzer { /* fields omitted */ }
Identifies patterns that describe a given sequence.
Methods
impl Analyzer
[src]
fn from_slice(seq: &[i32]) -> Self
Creates a new Analyzer from a slice of integers.
fn with_meta(seq: &[i32]) -> Self
Same as from_slice
, but also finds meta-patterns.
fn with_custom_patterns(seq: &[i32], pats: Vec<CustomPatternElem>) -> Self
Same as from_slice
, but allows custom patterns elements to be specified.
fn with_options(seq: &[i32], meta: bool, pats: Vec<CustomPatternElem>) -> Self
Creates a new Analyzer, specifying custom pattern elements and whether meta-patterns should be found.
fn find_any_pattern_of_length(&self, n: usize) -> Option<Pattern>
Attempts to find exactly one pattern of n
operations that described the given sequence.
fn find_any_pattern(&self, max: usize) -> Option<Pattern>
Attempts to find exactly one pattern of maximum size max
(in terms of number of
operations) that describes the given sequence. It returns the smallest such pattern it can
find .
fn find_patterns_of_length(&self, range: usize) -> Vec<Pattern>
Finds all patterns with n
operations that describe the given sequence.
fn find_patterns(&self, max: usize) -> Vec<Pattern>
Finds patterns of maximum size max
(in terms of number of operations) that describe the
given sequence. It will return all such patterns that are of minimal size (i.e. if a
sequence can be described by a pattern of two operations, it will return all such patterns,
but none of size three or greater).