pub struct ConfigBuilder { /* private fields */ }Expand description
Fluent builder for Config.
§Example
use drain3::Config;
let cfg = Config::builder()
.depth(5)
.similarity_threshold(0.6)
.build()
.unwrap();Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn similarity_threshold(self, v: f64) -> Self
pub fn similarity_threshold(self, v: f64) -> Self
Fraction of tokens that must match for a line to join a cluster during training.
Sourcepub fn match_threshold(self, v: f64) -> Self
pub fn match_threshold(self, v: f64) -> Self
Fraction of tokens that must match for a line to be considered a match.
Sourcepub fn max_children(self, v: usize) -> Self
pub fn max_children(self, v: usize) -> Self
Max children per inner node. One slot is reserved for the param catch-all.
Sourcepub fn max_tokens(self, v: usize) -> Self
pub fn max_tokens(self, v: usize) -> Self
Max tokens per line. Lines with more tokens are skipped.
Sourcepub fn max_bytes(self, v: usize) -> Self
pub fn max_bytes(self, v: usize) -> Self
Max bytes per line. Lines longer than this are skipped.
Sourcepub fn max_clusters(self, v: usize) -> Self
pub fn max_clusters(self, v: usize) -> Self
Max clusters. 0 = unlimited.
Sourcepub fn param_string(self, v: impl Into<String>) -> Self
pub fn param_string(self, v: impl Into<String>) -> Self
Placeholder string for param tokens (default: <*>).
Sourcepub fn parametrize_numeric_tokens(self, v: bool) -> Self
pub fn parametrize_numeric_tokens(self, v: bool) -> Self
Whether numeric tokens are automatically parameterized during tree insertion.
Sourcepub fn extra_delimiters(self, v: Vec<String>) -> Self
pub fn extra_delimiters(self, v: Vec<String>) -> Self
Additional delimiter strings to replace with spaces before tokenization.
Sourcepub fn enable_match_prefilter(self, v: bool) -> Self
pub fn enable_match_prefilter(self, v: bool) -> Self
Enable the first/last token prefilter optimization for matching.
Trait Implementations§
Source§impl Clone for ConfigBuilder
impl Clone for ConfigBuilder
Source§fn clone(&self) -> ConfigBuilder
fn clone(&self) -> ConfigBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConfigBuilder
impl Debug for ConfigBuilder
Source§impl Default for ConfigBuilder
impl Default for ConfigBuilder
Source§impl PartialEq for ConfigBuilder
impl PartialEq for ConfigBuilder
Source§fn eq(&self, other: &ConfigBuilder) -> bool
fn eq(&self, other: &ConfigBuilder) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ConfigBuilder
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnsafeUnpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
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