kennyyuen / shark-string-similarity
There is no license information available for the latest version (0.1.5) of this package.
0.1.5
2025-01-29 02:00 UTC
Requires
- php: ^8.3
This package is auto-updated.
Last update: 2025-05-29 01:58:32 UTC
README
The string-similarity
is a PHP library designed to provide advanced string similarity comparison capabilities.
Installation
You can install the library via Composer:
composer require kennyyuen/shark-string-similarity
Usage
To use the string-similarity, include the autoload file generated by Composer:
<?php
require 'vendor/autoload.php';
use Shark\Extensions\StringSimilarity\StringSimilarity;
use Shark\Extensions\StringSimilarity\Algorithm;
$string1 = "Hello World";
$string2 = "Hello World!";
$similarity = StringSimilarity::eval(Algorithm::JaroWinkler, $string1, $string2);
// a similarity value between 0 and 1
Supported Algorithm
- RatcliffObershelp
- JaroWinkler
- Jaro
- Levenshtein
- PHP Native (similar_text)
Contributing
Contributions are welcome! Please submit a pull request or open an issue to discuss your ideas.
License
This project is licensed under the MIT License.