pub struct CachePredictor { /* private fields */ }
Expand description
缓存预测器
Implementations§
Source§impl CachePredictor
impl CachePredictor
pub fn new() -> Self
Sourcepub fn record_access(&mut self, text: &str)
pub fn record_access(&mut self, text: &str)
记录访问模式
Sourcepub fn record_co_occurrence(&mut self, texts: &[String])
pub fn record_co_occurrence(&mut self, texts: &[String])
记录共现模式
Sourcepub fn predict_next(&self, recent_texts: &[String]) -> Vec<String>
pub fn predict_next(&self, recent_texts: &[String]) -> Vec<String>
预测接下来可能需要的翻译
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CachePredictor
impl RefUnwindSafe for CachePredictor
impl Send for CachePredictor
impl Sync for CachePredictor
impl Unpin for CachePredictor
impl UnwindSafe for CachePredictor
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