PHP code example of pendenga / phonespell

1. Go to this page and download the library: Download pendenga/phonespell library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pendenga / phonespell example snippets


use Pendenga\PhoneSpell\Dictionary;
use Pendenga\PhoneSpell\PhoneSpell;
use Pendenga\PhoneSpell\WordListFactory;
use Psr\Log\NullLogger;

$logger = new NullLogger();
$wlf = WordListFactory::instance(Dictionary::instance($logger), $logger);

$results = PhoneSpell::instance($wlf, $logger)->lookForAllWords('593563');

print "Top 10 Results: \n";
print_r(array_slice($results, 0, 10));