FLUTTER ECOSYSTEM

string_similarity

Finds degree of similarity between two strings, based on Dice's Coefficient, which is mostly better than Levenshtein distance.

Latest version
2.2.0
30-day downloads
73.7K
Likes
129
Pub points
160

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

The string_similarity package calculates the degree of similarity between two strings using Dice's Coefficient, a method often more accurate and faster than Levenshtein distance. It is ideal for tasks like fuzzy matching, typo correction, and duplicate detection in text data. The algorithm evaluates shared bigrams between strings to produce a similarity score from 0 (no match) to 1 (exact match). This lightweight utility supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux, making it versatile for cross-platform applications requiring efficient string comparison.

Use cases
  • Fuzzy search in user input
  • Detecting near-duplicate text entries
  • Auto-correct suggestions
  • Data deduplication
  • Matching product names across sources
  • Spelling correction
Key features
  • Uses Dice's Coefficient for accuracy
  • Fast performance compared to Levenshtein
  • Cross-platform compatibility
  • Simple API with clear similarity scores
  • Handles case-insensitive comparisons
  • Supports non-English characters
Suitable for
  • Text processing apps
  • Search and autocomplete features
  • Data cleaning workflows
  • User-facing input validation
  • Applications needing fast string matching
Considerations
  • Best for short to medium-length strings
  • Not optimized for very long texts
  • Does not support partial word matching
  • Limited to string-to-string comparison
  • No built-in handling of stopwords or stemming
Supported platformsAndroidiOSWebmacOSWindowsLinux

Install package

flutter pub add string_similarity

Categories

Source repository

Related projects