PHPackages                             dijitaladam/laravel-string-similarities - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dijitaladam/laravel-string-similarities

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dijitaladam/laravel-string-similarities
=======================================

Compare two string and get a similarity percentage

2.0.0(6y ago)1373MITPHPPHP ~7.0

Since Jan 8Pushed 4y agoCompare

[ Source](https://github.com/Dijitaladam/laravel-string-similarities)[ Packagist](https://packagist.org/packages/dijitaladam/laravel-string-similarities)[ Docs](https://github.com/atomescrochus/laravel-string-similarities)[ GitHub Sponsors](https://github.com/jpmurray)[ RSS](/packages/dijitaladam-laravel-string-similarities/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (12)Used By (0)

laravel-string-similarities (Supports PHP 8.0)
==============================================

[](#laravel-string-similarities-supports-php-80)

[![Latest Stable Version](https://camo.githubusercontent.com/6de45fde612f9c6c8f76e212e2a6b043883b27d5f364370224315ae42079469d/68747470733a2f2f706f7365722e707567782e6f72672f61746f6d657363726f636875732f6c61726176656c2d737472696e672d73696d696c617269746965732f762f737461626c65)](https://packagist.org/packages/atomescrochus/laravel-string-similarities)[![License](https://camo.githubusercontent.com/27ab8e1cbe5fbf994d7dcb0499b651308909fa54809179394499061244fb125b/68747470733a2f2f706f7365722e707567782e6f72672f61746f6d657363726f636875732f6c61726176656c2d737472696e672d73696d696c617269746965732f6c6963656e7365)](https://packagist.org/packages/atomescrochus/laravel-string-similarities)[![Total Downloads](https://camo.githubusercontent.com/858533ca0dd8eb074a8a64bce5623497faeb60a1bef5c2e64b37efcf44498eec/68747470733a2f2f706f7365722e707567782e6f72672f61746f6d657363726f636875732f6c61726176656c2d737472696e672d73696d696c617269746965732f646f776e6c6f616473)](https://packagist.org/packages/atomescrochus/laravel-string-similarities)

Compare two string and get a similarity percentage. Note that I did not write the algorithms myself, see down this document for the full credits.

Some methods are usable in production, some are not, see usage for informations. Pull requests are more than welcomed!

Install
-------

[](#install)

You can install this package via composer:

```
$ composer require dijitaladam/laravel-string-similarities
```

Then you have to install the package' service provider, *unless you are running Laravel &gt;=5.5* (it'll use package auto-discovery) :

```
// config/app.php
'providers' => [
    ...
    Atomescrochus\StringSimilarities\StringSimilaritiesServiceProvider::class,
];
```

Usage
-----

[](#usage)

```
$comparison = new \Atomescrochus\StringSimilarities\Compare();

// the functions returns similarity percentage between strings
$jaroWinkler = $comparison->jaroWinkler('first string', 'second string'); // JaroWinkler comparison
$levenshtein = $comparison->levenshtein('first string', 'second string'); // Levenshtein comparison
$smg = $comparison->smg('first string', 'second string'); // Smith Waterman Gotoh comparison
$similar = $comparison->similarText('first string', 'second string'); // Using "similar_text()"

// This next one will return an array containing the results of all working comparison methods
// plus an array of 'data' that includes the first and second string, and the time in second it took to run all
// comparison. BE AWARE that comparing long string can results in really long compute time!
$all = $comparison->all('first string', 'second string');
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

HELP NEEDED.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Jean-Philippe Murray](https://github.com/jpmurray/)
- [joshweir over StackOverflow](http://stackoverflow.com/a/38236357/1001942) for pointing me to the solutions and algorithms for the Jaro Winkler and Smith Waterman Gotoh comparison
- [All Contributors](https://github.com/atomescrochus/laravel-string-similarities/graphs/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 87.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~131 days

Recently: every ~226 days

Total

10

Last Release

2233d ago

Major Versions

0.0.1 → 1.0.02017-01-08

1.3.3 → 2.0.02020-03-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/01c4247b1f33f4a364c18970207bf7657341968b6e71f2562ff3ed746a68f0f5?d=identicon)[husmen73](/maintainers/husmen73)

---

Top Contributors

[![jpmurray](https://avatars.githubusercontent.com/u/1550428?v=4)](https://github.com/jpmurray "jpmurray (49 commits)")[![husmen73](https://avatars.githubusercontent.com/u/222654?v=4)](https://github.com/husmen73 "husmen73 (4 commits)")[![jbardnz](https://avatars.githubusercontent.com/u/1628446?v=4)](https://github.com/jbardnz "jbardnz (2 commits)")[![dearsina](https://avatars.githubusercontent.com/u/3647339?v=4)](https://github.com/dearsina "dearsina (1 commits)")

---

Tags

stringcomparisonlevenshteinatomescrochuslaravel-string-similaritiesJaroWinklerSmithWatermanGotoh

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/dijitaladam-laravel-string-similarities/health.svg)

```
[![Health](https://phpackages.com/badges/dijitaladam-laravel-string-similarities/health.svg)](https://phpackages.com/packages/dijitaladam-laravel-string-similarities)
```

###  Alternatives

[atomescrochus/laravel-string-similarities

Compare two string and get a similarity percentage

70160.1k2](/packages/atomescrochus-laravel-string-similarities)[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[danielstjules/stringy

A string manipulation library with multibyte support

2.4k26.0M191](/packages/danielstjules-stringy)[edgaras/strsim

Collection of string similarity and distance algorithms in PHP including Levenshtein, Damerau-Levenshtein, Jaro-Winkler, and more

2423.0k](/packages/edgaras-strsim)[coduo/php-to-string

Simple library that converts PHP value into strings

27112.7M10](/packages/coduo-php-to-string)[kwn/number-to-words

Multi language standalone PHP number to words converter. Fully tested, open for extensions and new languages.

4235.0M21](/packages/kwn-number-to-words)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
