Introduce the Words criterion

This commit is contained in:
Clément Renault
2021-02-19 15:32:14 +01:00
committed by Kerollmops
parent 2d068bd45b
commit 1e47f9b3ff
3 changed files with 112 additions and 2 deletions

View File

@ -13,7 +13,7 @@ pub struct Typo<'t> {
number_typos: u8,
candidates: Candidates,
bucket_candidates: RoaringBitmap,
parent: Option<Box<dyn Criterion>>,
parent: Option<Box<dyn Criterion + 't>>,
candidates_cache: HashMap<(Operation, u8), RoaringBitmap>,
typo_cache: HashMap<(String, bool, u8), Vec<(String, u8)>>,
}
@ -39,7 +39,7 @@ impl<'t> Typo<'t> {
pub fn new(
ctx: &'t dyn Context,
parent: Box<dyn Criterion>,
parent: Box<dyn Criterion + 't>,
) -> anyhow::Result<Self> where Self: Sized
{
Ok(Typo {