edit_distance 0.4.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 86

edit_distance #

Build Status

Implementation of string distance algorithms.

Description #

Edit distances algorithms for fuzzy matching. Specifically, this library provides:

Examples #

Levenshtein d = new Levenshtein();
print(d.distance('witch', 'kitsch')); // 2

Changelog #

0.4.1 #

  • Apply health suggestions to improve its score.

0.4.0 #

  • Update to Dart 2.x
  • Remove the quiver_iterable dependency and replace it with reduce and min from the built-in math library.

0.3.0 #

  • Add Jaccard and CombinedJaccard.

0.2.1 #

  • Turn on strong mode
  • Fix a bug: JaroWinkler mistakenly used / operator where ~/ is required.

0.2.0 #

  • Add JaroWinkler and LongestCommonSubsequence.
  • Add NormalizedStringDistance whose normalizedDistance method returns a similarity between 0.0 (exact same) and 1.0 (completely different).

0.1.0 #

  • Initial version


// Copyright (c) 2016, Kwang Yul Seo. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'package:edit_distance/edit_distance.dart';

void main() {
  Levenshtein d = new Levenshtein();
  print(d.distance('witch', 'kitsch')); // 2
  print(d.normalizedDistance('witch', 'kitsch')); // 0.3333333333333333

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  edit_distance: ^0.4.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:edit_distance/edit_distance.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Oct 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:edit_distance/edit_distance.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
test ^1.0.0