पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

GitHub रिपॉज़िटरीSphericalKat/dart-fuzzywuzzy

dart-fuzzywuzzy

लोकप्रिय fuzzywuzzy पैकेज का डार्ट संस्करण

dart-fuzzywuzzy प्रोजेक्ट कवर
स्टार
48
फ़ोर्क
7
अंतिम पुश (UTC)
11 सित॰ 2026
प्रोजेक्ट स्थिति
सक्रिय

मूल README

यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।

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)
Amogh Lele GitHub avatar
GitHub लेखक

Amogh Lele ↗

Rustacean | Kotlin | JavaScript | TypeScript

भाषाएँDart

श्रेणियाँ

इस रिपॉज़िटरी के पैकेज

उपयोग की गई निर्भरताएँ

निर्भरता सूची 4 आइटम

अपने प्रोजेक्ट के लिए रिपॉज़िटरी कैसे चुनें?

उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।

  1. नाम, लेखक या विवरण से खोजें और तकनीकी विषय से परिणाम सीमित करें।
  2. स्टार, फ़ोर्क और हाल के पुश की तुलना करें। स्टार रुचि दर्शाते हैं, गुणवत्ता की गारंटी नहीं।
  3. उपयोग से पहले GitHub पर README, लाइसेंस और Issues जाँचें।

स्रोत और रखरखाव

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗