FuzzyOptions<T> constructor
FuzzyOptions<T> ({
- int location = 0,
- int distance = 100,
- double threshold = 0.6,
- int maxPatternLength = 32,
- bool isCaseSensitive = false,
- Pattern? tokenSeparator,
- bool findAllMatches = false,
- int minTokenCharLength = 1,
- int minMatchCharLength = 1,
- List<
WeightedKey< keys = const [],T> > - bool shouldSort = true,
- SorterFn<
T> ? sortFn, - bool tokenize = false,
- bool matchAllTokens = false,
- bool verbose = false,
- bool shouldNormalize = false,
Instantiate an options object.
The keys
list requires a positive number (they'll be normalized upon
instantiation). If any weight is not positive, throws an ArgumentError.
Implementation
FuzzyOptions({
this.location = 0,
this.distance = 100,
this.threshold = 0.6,
this.maxPatternLength = 32,
this.isCaseSensitive = false,
Pattern? tokenSeparator,
this.findAllMatches = false,
this.minTokenCharLength = 1,
this.minMatchCharLength = 1,
List<WeightedKey<T>> keys = const [],
this.shouldSort = true,
SorterFn<T>? sortFn,
this.tokenize = false,
this.matchAllTokens = false,
this.verbose = false,
this.shouldNormalize = false,
}) : tokenSeparator =
tokenSeparator ?? RegExp(r' +', caseSensitive: isCaseSensitive),
keys = _normalizeWeights(keys),
sortFn = sortFn ?? _defaultSortFn;