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! β