Skip to content
pubscout

text_comparison_score_codespark

1.0.0, released 5 months ago by ksaikiran.dev

Calculate string similarity and fuzzy matching scores using Levenshtein, Damerau-Levenshtein, and Jaro-Winkler.

WASM-ready
$ flutter pub add text_comparison_score_codespark
Source repository

What it does

Calculates match percentages and string distance metrics between text inputs. Supports algorithms like Levenshtein Distance, Damerau-Levenshtein Distance, and Jaro-Winkler, along with options for case-insensitive matching.

AI-written summary of version 1.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to detect typos or handle fuzzy search suggestions in your app.
  • You want to calculate string match percentages between user input and expected values.
  • You are comparing duplicate records or names in local data.

Skip it when

  • You require complex AI-powered semantic text embeddings or LLM-based understanding.
  • You are dealing with extremely large texts where more optimized batch processing or native vector search is required.

Strengths

  • Provides multiple well-known distance algorithms out of the box (Levenshtein, Damerau-Levenshtein, Jaro-Winkler).
  • Supports case-insensitive comparisons and match percentage calculations.
  • Lightweight and pure Dart/Flutter utility.

Weaknesses

  • Future updates plan for performance optimizations, phonetic algorithms (Soundex), and cosine similarity which are not yet available.
  • Limited to string edit distances and basic prefix/transposition metrics.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:text_comparison_score_codespark/text_comparison_score_codespark.dart';

void main() {
  String string1 = "kitten";
  String string2 = "sitting";
  double matchPercent = TextComparisonScore.calculateScore(string1, string2, algorithm: ComparisonAlgorithm.levenshtein);
  print("Levenshtein Match Percentage: $matchPercent%");
}

Alternatives

Packages that do the same job and could replace text_comparison_score_codespark.