pub struct SelfCorrector { /* private fields */ }Expand description
自我纠错器
Implementations§
Source§impl SelfCorrector
impl SelfCorrector
Sourcepub async fn learn_pattern(
&self,
error_signature: &str,
strategy: CorrectionStrategy,
)
pub async fn learn_pattern( &self, error_signature: &str, strategy: CorrectionStrategy, )
学习纠错模式
Sourcepub async fn get_recommended_strategy(
&self,
error: &str,
) -> Option<CorrectionStrategy>
pub async fn get_recommended_strategy( &self, error: &str, ) -> Option<CorrectionStrategy>
获取推荐的纠错策略
Sourcepub async fn record_result(&self, record: CorrectionRecord)
pub async fn record_result(&self, record: CorrectionRecord)
记录纠错结果
Sourcepub async fn get_success_rate(&self) -> f32
pub async fn get_success_rate(&self) -> f32
获取纠错成功率
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SelfCorrector
impl !RefUnwindSafe for SelfCorrector
impl !UnwindSafe for SelfCorrector
impl Send for SelfCorrector
impl Sync for SelfCorrector
impl Unpin for SelfCorrector
impl UnsafeUnpin for SelfCorrector
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