pub struct DensityMetrics {
pub blocks_found: u8,
pub definitions: u16,
pub assignments: u16,
pub quantifiers: u16,
pub lambdas: u16,
pub implications: u16,
pub set_ops: u16,
pub symbol_count: u16,
pub token_count: u16,
}Expand description
Detailed density metrics
Fields§
§blocks_found: u8Required blocks found (out of 5)
definitions: u16Definition count (≜)
assignments: u16Assignment count (≔)
quantifiers: u16Quantifier count (∀, ∃)
lambdas: u16Lambda count (λ)
implications: u16Implication count (⇒, ⇔, →, ↔)
set_ops: u16Set operation count (∈, ⊆, ∩, ∪, ∅)
symbol_count: u16Total AISP symbols
token_count: u16Total non-whitespace tokens
Implementations§
Source§impl DensityMetrics
impl DensityMetrics
Sourcepub fn from_source(source: &str) -> Self
pub fn from_source(source: &str) -> Self
Calculate from source
Sourcepub fn total_bindings(&self) -> u16
pub fn total_bindings(&self) -> u16
Total semantic bindings
Sourcepub fn block_score(&self) -> f32
pub fn block_score(&self) -> f32
Block score (0.0 - 1.0)
Sourcepub fn binding_score(&self) -> f32
pub fn binding_score(&self) -> f32
Binding score (0.0 - 1.0, capped at 20 bindings)
Sourcepub fn pure_density(&self) -> f32
pub fn pure_density(&self) -> f32
Pure density (symbols per token)
Trait Implementations§
Source§impl Clone for DensityMetrics
impl Clone for DensityMetrics
Source§fn clone(&self) -> DensityMetrics
fn clone(&self) -> DensityMetrics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DensityMetrics
impl Debug for DensityMetrics
Source§impl Default for DensityMetrics
impl Default for DensityMetrics
Source§fn default() -> DensityMetrics
fn default() -> DensityMetrics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DensityMetrics
impl RefUnwindSafe for DensityMetrics
impl Send for DensityMetrics
impl Sync for DensityMetrics
impl Unpin for DensityMetrics
impl UnwindSafe for DensityMetrics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more