fuzzy_bolt 1.0.0
fuzzy_bolt: ^1.0.0 copied to clipboard
A powerful and optimized fuzzy search algorithm with typo tolerance and ranking.
๐ FuzzyBolt - A Fast & Efficient Fuzzy Search Library for Dart #
FuzzyBolt is a high-performance fuzzy search library for Dart, designed for fast and accurate matching of search queries within large datasets. It leverages Jaro-Winkler similarity and Damerau-Levenshtein distance to provide ranked results with typo tolerance.
โจ Features #
- ๐ Fast & Optimized - Uses Jaro-Winkler and Damerau-Levenshtein for accurate matching.
- โก Isolate Support - Automatically switches to isolates for large datasets.
- ๐ข Configurable Thresholds - Adjust strict and typo-matching sensitivity.
- ๐ Easy-to-Use API - Simple function calls with named parameters.
- ๐งช Well-Tested - Comes with robust test cases.
๐ฆ Installation #
Add fuzzy_bolt
to your project's pubspec.yaml
:
dependencies:
fuzzy_bolt: ^1.0.0
Then, run:
dart pub get
๐ Usage Example #
import 'package:fuzzy_bolt/fuzzy_bolt.dart';
void main() async {
final fuzzyBolt = FuzzyBolt();
List<String> dataset = [
"apple",
"banana",
"grapefruit",
"strawberry",
"raspberry",
"blackberry",
"blueberry",
"pineapple",
];
final results = await fuzzyBolt.search(
dataset: dataset,
query: "black rasp",
strictThreshold: 0.85,
typoThreshold: 0.7,
);
print("Top Matches:");
for (var result in results) {
print("${result['value']} (Score: ${result['rank']})");
}
}
๐ Output Example #
Top Matches:
blackberry (Score: 0.89)
raspberry (Score: 0.85)
blueberry (Score: 0.72)
โก API Reference #
FuzzyBolt.search({dataset, query, strictThreshold, typoThreshold}) โ Future<List<Map<String, dynamic>>>
Parameters: #
๐น dataset (List
๐ Example Use Cases #
โ
Search & Auto-Suggestions - Improve search bars with intelligent suggestions.
โ
Spell Checking - Detect and correct minor spelling errors.
โ
Command Line Interfaces - Enhance fuzzy matching in CLI applications.
โ
Data Deduplication - Identify similar records in datasets.
๐ฌ Running Tests #
To ensure FuzzyBolt works correctly, run:
dart test
๐ License #
This package is licensed under the MIT License. See the LICENSE file for details.
โค๏ธ Contributing #
Contributions are welcome! Feel free to open issues, submit PRs, or discuss improvements.
๐ฌ Have questions? Reach out on GitHub Issues!
๐ Like this package? Give it a star on GitHub! โญ