gestalt 1.0.0 copy "gestalt: ^1.0.0" to clipboard
gestalt: ^1.0.0 copied to clipboard

Simple Gestalt-style string similarity for Dart and Flutter.

gestalt #

Simple Gestalt-style string similarity for Dart and Flutter.

This package implements the basic matching approach used by Python's difflib.SequenceMatcher.ratio().

It recursively finds the longest contiguous matching parts of two strings and produces a similarity score between 0.0 and 1.0.

Features #

It is pure Dart and zero-dependency

Installation #

For Dart:

dart pub add gestalt
flutter pub add gestalt

Usage #

import 'package:gestalt/gestalt.dart';

void main() {
  final score = gestaltSimilarity(
    'hello world',
    'hello dart',
  );

  print(score);
}

The result is a value between 0.0 and 1.0.

gestaltSimilarity('hello', 'hello');
// 1.0

gestaltSimilarity('abc', 'xyz');
// 0.0

gestaltSimilarity('hello', 'hallo');
// 0.8
1
likes
0
points
127
downloads

Publisher

unverified uploader

Weekly Downloads

Simple Gestalt-style string similarity for Dart and Flutter.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on gestalt