pub struct SpecificityScorer { /* private fields */ }Expand description
Scores module names based on specificity and descriptiveness
Implementations§
Source§impl SpecificityScorer
impl SpecificityScorer
Sourcepub fn calculate_specificity(&self, name: &str) -> f64
pub fn calculate_specificity(&self, name: &str) -> f64
Sourcepub fn is_acceptable(&self, name: &str, min_threshold: f64) -> bool
pub fn is_acceptable(&self, name: &str, min_threshold: f64) -> bool
Sourcepub fn assess_quality(&self, name: &str) -> &'static str
pub fn assess_quality(&self, name: &str) -> &'static str
Get a human-readable assessment of name quality
Sourcepub fn calculate_specificity_type_aware(
&self,
name: &str,
is_type_based: bool,
) -> f64
pub fn calculate_specificity_type_aware( &self, name: &str, is_type_based: bool, ) -> f64
Calculate specificity score with type-awareness (Spec 193 Phase 2)
Type-based splits get stricter penalties for generic names because they originate from Rust type names which are often too vague for module names.
§Arguments
name- Module name to score (without .rs extension)is_type_based- true if this name comes from type-based clustering
§Returns
Specificity score in range [0.0, 1.0]
Sourcepub fn is_acceptable_for_type_based(&self, name: &str) -> bool
pub fn is_acceptable_for_type_based(&self, name: &str) -> bool
Check if name is acceptable for type-based splits (stricter threshold)
Type-based splits require a higher quality bar (0.65) because they originate from type names which are often too generic.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SpecificityScorer
impl RefUnwindSafe for SpecificityScorer
impl Send for SpecificityScorer
impl Sync for SpecificityScorer
impl Unpin for SpecificityScorer
impl UnsafeUnpin for SpecificityScorer
impl UnwindSafe for SpecificityScorer
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
Source§impl<T> EnsureExt<T> for T
impl<T> EnsureExt<T> for T
Source§fn ensure<P, E>(self, predicate: P, error: E) -> Validation<T, NonEmptyVec<E>>where
P: Predicate<T>,
fn ensure<P, E>(self, predicate: P, error: E) -> Validation<T, NonEmptyVec<E>>where
P: Predicate<T>,
Validate that this value satisfies the given predicate. Read more
Source§fn ensure_with<P, E, F>(
self,
predicate: P,
error_fn: F,
) -> Validation<T, NonEmptyVec<E>>
fn ensure_with<P, E, F>( self, predicate: P, error_fn: F, ) -> Validation<T, NonEmptyVec<E>>
Validate with an error-generating function. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more