Before improving fields AttrCount

Removing the fields_count fetching reduced by 2 times the serach time, we should look at lazily pulling them form the criterions in needs

ugly-test: Make the fields_count fetching lazy

Just before running the exactness criterion
This commit is contained in:
Clément Renault 2019-11-29 16:31:47 +01:00 committed by Clément Renault
parent 11f3d7782d
commit ef6a4db182
No known key found for this signature in database
GPG key ID: 0151CDAB43460DAE
4 changed files with 79 additions and 60 deletions

View file

@ -2,7 +2,7 @@ mod dfa;
mod query_enhancer;
use std::cmp::Reverse;
use std::{cmp, vec};
use std::{cmp, fmt, vec};
use fst::{IntoStreamer, Streamer};
use levenshtein_automata::DFA;
@ -68,7 +68,6 @@ impl AutomatonGroup {
}
}
#[derive(Debug)]
pub struct Automaton {
pub index: usize,
pub ngram: usize,
@ -78,6 +77,14 @@ pub struct Automaton {
pub query: String,
}
impl fmt::Debug for Automaton {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Automaton")
.field("query", &self.query)
.finish()
}
}
impl Automaton {
pub fn dfa(&self) -> DFA {
if self.is_prefix {