gordonlesti / levenshtein
Installs: 47 673
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.0
Requires (Dev)
- phpmd/phpmd: ^2.5
- phpunit/phpunit: ^5.7
- satooshi/php-coveralls: ^1.0
- sebastian/phpcpd: ^2.0
- squizlabs/php_codesniffer: ^2.7
This package is auto-updated.
Last update: 2024-10-18 05:26:03 UTC
README
Plain PHP implementation of the Levenshtein distance.
- No 255 characters limit
- Works with UTF-8
- Accepts float as custom costs
Install
Via Composer
$ composer require gordonlesti/levenshtein
Usage
use GordonLesti\Levenshtein\Levenshtein;
With default default costs.
$levDist = Levenshtein::levenshtein("AC", "ABAA");
With insert cost 7.7
, replace cost 9.4
and delete cost 2.5
.
$levDist = Levenshtein::levenshtein("ACCB", "BC", 7.7, 9.4, 2.5);
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email info@gordonlesti.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.