felipecwb/soundslike

Sounds Like Text Search

0.1 2016-11-18 17:56 UTC

This package is not auto-updated.

Last update: 2024-09-28 19:58:19 UTC


README

PHP Sounds Like Text Search

composer require "felipecwb/soundslike"

It's looks like that:

use Felipecwb\SoundsLike\TextSearch;

$search = new TextSearch([
    "São Paulo - SP",
    "Osasco - SP",
    "Curitiba - PR",
    "Curitibanos - SC",
    "Vitória - ES",
    "Rio de Janeiro - RJ",
    "Natal - RN"
]);

// find for the best matching text
$result = $search->findBestMatch('Sao paulo');

$result->getPhrase(); //São Paulo - SP
$result->getAgainst(); //Sao paulo
$result->getSimilarity(); //7