All Projects → wyndow → fuzzywuzzy

wyndow / fuzzywuzzy

Licence: other
Fuzzy string matching for PHP

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to fuzzywuzzy

beda
Beda is a golang library for detecting how similar a two string
Stars: ✭ 34 (-43.33%)
Mutual labels:  string-distance, string-matching
strutil
Golang metrics for calculating string similarity and other string utility functions
Stars: ✭ 114 (+90%)
Mutual labels:  string-distance, string-matching
stance
Learned string similarity for entity names using optimal transport.
Stars: ✭ 27 (-55%)
Mutual labels:  string-distance, string-matching
levenshtein.c
Levenshtein algorithm in C
Stars: ✭ 77 (+28.33%)
Mutual labels:  fuzzy-matching, string-matching
fuzzy-match
Library and command line utility to do approximate string matching of a source against a bitext index and get matched source and target.
Stars: ✭ 31 (-48.33%)
Mutual labels:  fuzzy-matching, string-matching
Abydos
Abydos NLP/IR library for Python
Stars: ✭ 91 (+51.67%)
Mutual labels:  fuzzy-matching
Tntsearch
A fully featured full text search engine written in PHP
Stars: ✭ 2,693 (+4388.33%)
Mutual labels:  fuzzy-matching
Faint
Extensible TUI fuzzy file file explorer
Stars: ✭ 82 (+36.67%)
Mutual labels:  fuzzy-matching
Fuse Swift
A lightweight fuzzy-search library, with zero dependencies
Stars: ✭ 767 (+1178.33%)
Mutual labels:  fuzzy-matching
affinegap
📐 A Cython implementation of the affine gap string distance
Stars: ✭ 57 (-5%)
Mutual labels:  string-distance
simd-byte-lookup
SIMDized check which bytes are in a set
Stars: ✭ 23 (-61.67%)
Mutual labels:  string-matching
Fuzzymatcher
Record linking package that fuzzy matches two Python pandas dataframes using sqlite3 fts4
Stars: ✭ 173 (+188.33%)
Mutual labels:  fuzzy-matching
Fastenshtein
The fastest .Net Levenshtein around
Stars: ✭ 115 (+91.67%)
Mutual labels:  fuzzy-matching
Fuzzball.js
Easy to use and powerful fuzzy string matching, port of fuzzywuzzy.
Stars: ✭ 225 (+275%)
Mutual labels:  fuzzy-matching
Refinr
Cluster and merge similar char values: an R implementation of Open Refine clustering algorithms
Stars: ✭ 91 (+51.67%)
Mutual labels:  fuzzy-matching
spaczz
Fuzzy matching and more functionality for spaCy.
Stars: ✭ 215 (+258.33%)
Mutual labels:  fuzzy-matching
Gitgot
Semi-automated, feedback-driven tool to rapidly search through troves of public data on GitHub for sensitive secrets.
Stars: ✭ 964 (+1506.67%)
Mutual labels:  fuzzy-matching
Fuzzysearch
Find parts of long text or data, allowing for some changes/typos.
Stars: ✭ 157 (+161.67%)
Mutual labels:  fuzzy-matching
React Command Palette
An accessible browser compatible javascript command palette
Stars: ✭ 140 (+133.33%)
Mutual labels:  fuzzy-matching
Symspell
SymSpell: 1 million times faster spelling correction & fuzzy search through Symmetric Delete spelling correction algorithm
Stars: ✭ 1,976 (+3193.33%)
Mutual labels:  fuzzy-matching

FuzzyWuzzy

Build Status

Fuzzy string matching for PHP, based on the python library of the same name.

Requirements

  • PHP 5.4 or higher

Installation

Using Composer

composer require wyndow/fuzzywuzzy

Usage

use FuzzyWuzzy\Fuzz;
use FuzzyWuzzy\Process;

$fuzz = new Fuzz();
$process = new Process($fuzz); // $fuzz is optional here, and can be omitted.

Simple Ratio

>>> $fuzz->ratio('this is a test', 'this is a test!')
=> 96

Partial Ratio

>>> $fuzz->partialRatio('this is a test', 'this is a test!')
=> 100

Token Sort Ratio

>>> $fuzz->ratio('fuzzy wuzzy was a bear', 'wuzzy fuzzy was a bear')
=> 90
>>> $fuzz->tokenSortRatio('fuzzy wuzzy was a bear', 'wuzzy fuzzy was a bear')
=> 100

Token Set Ratio

>>> $fuzz->tokenSortRatio('fuzzy was a bear', 'fuzzy fuzzy was a bear')
=> 84
>>> $fuzz->tokenSetRatio('fuzzy was a bear', 'fuzzy fuzzy was a bear')
=> 100

Process

>>> $choices = ['Atlanta Falcons', 'New York Jets', 'New York Giants', 'Dallas Cowboys']
>>> $c = $process->extract('new york jets', $choices, null, null, 2)
=> FuzzyWuzzy\Collection {#205}
>>> $c->toArray()
=> [
     [
       "New York Jets",
       100,
     ],
     [
       "New York Giants",
       78,
     ],
   ]
>>> $process->extractOne('cowboys', $choices)
=> [
     "Dallas Cowboys",
     90,
   ]

You can also pass additional parameters to extractOne to make it use a specific scorer.

>>> $process->extractOne('cowbell', $choices, null, [$fuzz, 'ratio'])
=> [
     "Dallas Cowboys",
     38,
   ]
>>> $process->extractOne('cowbell', $choices, null, [$fuzz, 'tokenSetRatio'])
=> [
     "Dallas Cowboys",
     57,
   ]

Caveats

Unicode strings may produce unexpected results. We intend to correct this in future versions.

Further Reading

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].