Skip to content

Provides correct word suggestions based on a dictionary by levenshtein function

License

Notifications You must be signed in to change notification settings

uxmsdevs/didyoumean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Did You Mean?

Provides correct word suggestions based on a dictionary by levenshtein function.

dictionaries directory can be populated for supporting multilanguage suggestions

Usage

use Uxms\DidYouMean\MatchWord;
$dym = new MatchWord('en', 'Banana');

echo $dym->checkMatch();

OR

$dym = new MatchWord;
$dym->setLanguage('en')->setWord('Banana');

echo $dym->checkMatch();

OR

$dym = new MatchWord;
$dym->setLanguage('en');
$dym->setWord('Banana');

echo $dym->checkMatch();

Returns

Returns json encoded array like:

{"status":1,"description":"Exact match","closest":"banana"}

or if not matched:

{"status":0,"description":"Did you mean","closest":"banana"}

About

Provides correct word suggestions based on a dictionary by levenshtein function

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages