Pakete, Repositories und App-Kategorien suchen

Paketdetailsv1.2.0

fuzzywuzzy

Eine Implementierung des beliebten fuzzywuzzy-Pakets in Dart, um all Ihre Anforderungen an die unscharfe Zeichenkettenübereinstimmung/Suche zu erfüllen!

AndroidiOSWebmacOSWindowsLinux
30-Tage-Downloads
72.100
Likes
153
Pub-Punkte
150

Paket installieren

flutter pub add fuzzywuzzy

Paketübersicht

Aus öffentlichen Paketdaten erstellte Orientierung.

Fuzzywuzzy ist eine Dart-Implementierung der beliebten Bibliothek für fuzzy String-Matching, die präzise und flexible String-Vergleiche für Aufgaben wie Suche, Deduplizierung und Datenrekonstruktion ermöglicht. Es berechnet Ähnlichkeitsscores zwischen Strings mithilfe von Algorithmen wie der Levenshtein-Distanz und tokenbasierten Methoden, wodurch es ideal für die Behandlung von Tippfehlern, Variationen und Annäherungen ist. Das Paket unterstützt mehrere Plattformen wie Android, iOS, Web, macOS, Windows und Linux und gewährleistet breite Kompatibilität. Es ist leichtgewichtig und einfach über Flutter pub zu integrieren.

Anwendungsfälle

  • Textsuche mit Tippfehlern
  • Datendeduplizierung
  • Namensübereinstimmung über Datensätze hinweg
  • Automatische Vorschläge mit Toleranz
  • Übereinstimmung von Benutzereingaben mit Datenbankeinträgen

Hauptmerkmale

  • Levenshtein-Distanz-Bewertung
  • Token-Sortierung und Mengenverhältnisse
  • Groß-/Kleinschreibung-unabhängige Übereinstimmung
  • Plattformübergreifende Unterstützung
  • Einfache API-Integration

Geeignet für

  • Entwickler, die eine robuste Zeichenfolgenübereinstimmung benötigen
  • Apps mit benutzererzeugter Texteingabe
  • Datenbereinigungspipelines
  • Suchfunktionen mit Fehlertoleranz

Hinweise

  • Kann bei großen Datensätzen langsamer sein
  • Nicht für Echtzeit-Hochfrequenz-Abgleich optimiert
  • Erfordert sorgfältige Abstimmung des Schwellenwerts für Genauigkeit

Original-README

Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.

FuzzyWuzzy

Tests Coverage Status

This is a Dart port of the popular FuzzyWuzzy python package. This algorithm uses Levenshtein distance to calculate similarity between strings.

I personally needed to use this for my own search algorithms, and there weren't any packages as good as my experience with FuzzyWuzzy was, so here we are. Enjoy!

  • Just one dependency (collection).
  • Pure Dart implementation of the superfast python-Levenshtein.
  • Simple to use.
  • Lightweight.
  • Massive props to the folks over at seatgeek for coming up with the algorithm.

Get started

Add dependency
dependencies:
  fuzzywuzzy: <latest version>

Usage

First, import the package

import 'package:fuzzywuzzy/fuzzywuzzy.dart'
Simple ratio
ratio("mysmilarstring", "myawfullysimilarstirng") // 72
ratio("mysmilarstring", "mysimilarstring")        // 97
Partial ratio
partialRatio("similar", "somewhresimlrbetweenthisstring") // 71
Token sort ratio
tokenSortPartialRatio("order words out of", "words out of order") // 100
tokenSortRatio("order words out of","  words out of order")       // 100
Token set ratio
tokenSetRatio("fuzzy was a bear", "fuzzy fuzzy fuzzy bear")         // 100
tokenSetPartialRatio("fuzzy was a bear", "fuzzy fuzzy fuzzy bear")  // 100
Weighted ratio
weightedRatio("The quick brown fox jimps ofver the small lazy dog", "the quick brown fox jumps over the small lazy dog") // 97
Extract
extractOne(
        query: 'cowboys',
        choices: [
          'Atlanta Falcons',
          'New York Jets',
          'New York Giants',
          'Dallas Cowboys'
        ],
        cutoff: 10,
      ) // (string Dallas Cowboys, score: 90, index: 3)
extractTop(
        query: 'goolge',
        choices: [
          'google',
          'bing',
          'facebook',
          'linkedin',
          'twitter',
          'googleplus',
          'bingnews',
          'plexoogl'
        ],
        limit: 4,
        cutoff: 50,
      ) // [(string google, score: 83, index: 0), (string googleplus, score: 75, index: 5)]
extractAllSorted(
        query: 'goolge',
        choices: [
          'google',
          'bing',
          'facebook',
          'linkedin',
          'twitter',
          'googleplus',
          'bingnews',
          'plexoogl'
        ],
        cutoff: 10,
      ) // [(string google, score: 83, index: 0), (string googleplus, score: 75, index: 5), (string plexoogl, score: 43, index: 7), (string bingnews, score: 29, index: 6), (string linkedin, score: 29, index: 3), (string facebook, score: 29, index: 2), (string bing, score: 23, index: 1), (string twitter, score: 15, index: 4)]
extractAll(
        query: 'goolge',
        choices: [
          'google',
          'bing',
          'facebook',
          'linkedin',
          'twitter',
          'googleplus',
          'bingnews',
          'plexoogl'
        ],
        cutoff: 10,
      ) // [(string google, score: 83, index: 0), (string bing, score: 23, index: 1), (string facebook, score: 29, index: 2), (string linkedin, score: 29, index: 3), (string twitter, score: 15, index: 4), (string googleplus, score: 75, index: 5), (string bingnews, score: 29, index: 6), (string plexoogl, score: 43, index: 7)]
Extract using any a list of any type

All extract methods can receive List<T> and return List<ExtractedResult<T>>

class TestContainer {
  final String innerVal;
  TestContainer(this.innerVal);
}

extractOne<TestContainer>(
        query: 'cowboys',
        choices: [
          'Atlanta Falcons',
          'New York Jets',
          'New York Giants',
          'Dallas Cowboys'
        ].map((e) => TestContainer(e)).toList(),
        cutoff: 10,
        getter: (x) => x.innerVal
      ).toString(); // (string Dallas Cowboys, score: 90, index: 3)

Kategorien

Abhängigkeiten

Abhängigkeiten 1 Einträge

Quell-Repository

Projekte, die dieses Paket verwenden