fuzzy_bolt 1.1.2 copy "fuzzy_bolt: ^1.1.2" to clipboard
fuzzy_bolt: ^1.1.2 copied to clipboard

A high-performance fuzzy search algorithm in Dart, designed for intelligent auto-suggestions, typo tolerance, and fast string matching.

FuzzyBolt πŸ”₯ #

A powerful and optimized fuzzy search algorithm with typo tolerance and ranking.

pub package License: BSD-3-Clause

Features #

βœ… Blazing Fast Performance πŸš€
βœ… Advanced String Matching with Jaro-Winkler & Levenshtein Distance
βœ… Ideal for Autocomplete, Search Bars, and Query Refinement
βœ… Asynchronous & Optimized for Large Datasets

πŸ“¦ Installation #

Add FuzzyBolt to your pubspec.yaml:

dependencies:
  fuzzy_bolt: <latest_version>  

Then, run:

dart pub get

πŸ“–Normal Search Usage #

import 'package:fuzzy_bolt/fuzzy_bolt.dart';

void main() async {
  final results = await fuzzyBolt.search(
  dataset: ["encyclopedia", "phenomenon", "philosophy", "psychology"],
  query: "phsychology", // Typo: "phsychology" instead of "psychology"
  strictThreshold: 0.8,
  typoThreshold: 0.7,
);
}

πŸ›  Output Example: #

psychology (Score: 0.92)  βœ…  (Fixes minor spelling mistake)
philosophy (Score: 0.75)  ❌  (Less relevant but somewhat similar)

⚑ API Reference #

Future<List<Map<String, dynamic>>> search({
  required List<String> dataset,
  required String query,
  required double strictThreshold,
  required double typoThreshold,
})
import 'package:fuzzy_bolt/fuzzy_bolt.dart';

void main() async {
  final queryController = StreamController<String>();
  final searchStream = fuzzyBolt.streamSearch(
    dataset: ["apple", "banana", "berry", "grape", "pineapple"],
    query: queryController.stream,
  );

  searchStream.listen((results) {
    print(results);
  });

  queryController.add("b");
  queryController.add("be");
  queryController.add("ber");
  queryController.add("berr");
  queryController.add("berry");
}

πŸ›  Output Example: #

πŸš€ Running Stream-Based Search...

⌨️ Typing: 'b'
πŸ”„ Stream Update:
   πŸ”Ή banana (Score: 0.750)
   πŸ”Ή blueberry (Score: 0.733)
   πŸ”Ή blackberry (Score: 0.730)

⌨️ Typing: 'be'
πŸ”„ Stream Update:
   πŸ”Ή blueberry (Score: 0.767)

⌨️ Typing: 'ber'
πŸ”„ Stream Update:
   πŸ”Ή blueberry (Score: 0.667)
   πŸ”Ή tangerine (Score: 0.630)
   πŸ”Ή watermelon (Score: 0.622)
   πŸ”Ή pomegranate (Score: 0.616)

⌨️ Typing: 'berr'
πŸ”„ Stream Update:
   πŸ”Ή blueberry (Score: 0.725)
   πŸ”Ή blackberry (Score: 0.610)

⌨️ Typing: 'berry'
πŸ”„ Stream Update:
   πŸ”Ή blueberry (Score: 0.680)
   πŸ”Ή raspberry (Score: 0.444)
🏁 Stream-based search completed.
Parameter Type Description
dataset List<String> The list of items to search through.
query String The search term entered by the user.
strictThreshold double Minimum Jaro-Winkler similarity score required for a match.
typoThreshold double Minimum Damerau-Levenshtein distance score required for a match.

πŸ“š Use Cases #

βœ… Search & Auto-Suggestions - Enhance search bars with intelligent suggestions.
βœ… Spell Checking - Detect and correct minor spelling errors.
βœ… Command Line Interfaces - Improve fuzzy matching in CLI applications.
βœ… Data Deduplication - Identify similar records in datasets.

πŸ”₯ Platform Support #

Platform Supported
Android βœ… Yes
iOS βœ… Yes
macOS βœ… Yes
Windows βœ… Yes
Linux βœ… Yes
Web ❌ No

Why no Web support?
FuzzyBolt uses Dart isolates for parallel computation, which are not supported on Flutter Web. I'll eventually enhance a fallback mechanism which leverages Web Workers for web platform.

πŸ”¬ Running Tests #

To run tests, use:

dart test
test/fuzzy_bolt_test.dart

πŸ“œ License #

This package is licensed under the BSD-3-Clause License. See the LICENSE file for details.

❀️ Contributing #

We welcome contributions! If you'd like to improve FuzzyBolt:

  • Open an issue on GitHub
  • Submit a pull request
  • Suggest new features or report bugs

πŸ’¬ Questions? #

If you have any questions, feel free to open a discussion on GitHub or raise an issue.

🌟 Like this package? Star it on GitHub! ⭐

πŸ”Ή Made with ❀️ by Vishwa Karthik. #

6
likes
0
points
537
downloads

Publisher

verified publishervishwakarthik.in

Weekly Downloads

A high-performance fuzzy search algorithm in Dart, designed for intelligent auto-suggestions, typo tolerance, and fast string matching.

Repository (GitHub)
View/report issues

Topics

#fuzzy-search #search #text-processing #autocomplete #ranking

License

unknown (license)

Dependencies

collection

More

Packages that depend on fuzzy_bolt