mirror of
https://github.com/exoticorn/upkr.git
synced 2026-01-21 03:56:42 +01:00
add compression levels
This commit is contained in:
@@ -45,14 +45,34 @@ impl MatchFinder {
|
||||
suffixes,
|
||||
rev_suffixes,
|
||||
lcp,
|
||||
max_queue_size: 1000,
|
||||
max_matches_per_length: 10,
|
||||
patience: 1000,
|
||||
max_length_diff: 4,
|
||||
max_queue_size: 100,
|
||||
max_matches_per_length: 5,
|
||||
patience: 100,
|
||||
max_length_diff: 2,
|
||||
queue: BinaryHeap::new()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn with_max_queue_size(mut self, v: usize) -> MatchFinder {
|
||||
self.max_queue_size = v;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_patience(mut self, v: usize) -> MatchFinder {
|
||||
self.patience = v;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_max_matches_per_length(mut self, v: usize) -> MatchFinder {
|
||||
self.max_matches_per_length = v;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_max_length_diff(mut self, v: usize) -> MatchFinder {
|
||||
self.max_length_diff = v;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn matches(&mut self, pos: usize) -> Matches {
|
||||
let index = self.rev_suffixes[pos] as usize;
|
||||
self.queue.clear();
|
||||
|
||||
Reference in New Issue
Block a user