pub struct Adaptive { /* private fields */ }Expand description
自适应爬取的状态:每个查询词的证据数、已经见过的相关段落、连续没有新信息的页数。
Implementations§
Source§impl Adaptive
impl Adaptive
pub fn new(opts: AdaptiveOptions, terms: usize) -> Adaptive
pub fn evidence(&self) -> &[usize]
Sourcepub fn last_fresh(&self) -> bool
pub fn last_fresh(&self) -> bool
上一次 Self::observe 的页面带来了新的切题内容(有收获)。
Sourcepub fn observe(
&mut self,
query: &Query,
markdown: &str,
relevance: f32,
blind: bool,
) -> Option<&'static str>
pub fn observe( &mut self, query: &Query, markdown: &str, relevance: f32, blind: bool, ) -> Option<&'static str>
记下一页的正文(relevance 是这一页的相关度);信息够了时返回停止原因。
blind 说这一页是不是“盲探“来的:链接本身没有查询词的线索,分数只是栏目保底分
(见 super::is_blind)。
还没有收获时,无关页不算“没有新信息“(门户、新闻集群挡在前面是常态),但连着
2 × patience 页都是盲探、都无关,就是站点上找不到查询的线索:停(no_relevant_pages)。
一路有线索的链接可走时不停,那是内容藏得深,不是没有内容。
Auto Trait Implementations§
impl Freeze for Adaptive
impl RefUnwindSafe for Adaptive
impl Send for Adaptive
impl Sync for Adaptive
impl Unpin for Adaptive
impl UnsafeUnpin for Adaptive
impl UnwindSafe for Adaptive
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