gordonlesti/levenshtein

1.0.0 2017-01-19 14:59 UTC

This package is auto-updated.

Last update: 2024-10-18 05:26:03 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Total Downloads

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.