PHP code example of alviden / yii2-corrector

1. Go to this page and download the library: Download alviden/yii2-corrector 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/ */

    

alviden / yii2-corrector example snippets


php composer.phar 

php yii migrate --migrationPath=@vendor/alviden/yii2-corrector/src/migrations

	$sh = new \alviden\corrector\models\Corrector();
	$sh->addWord('хлебцы');
	$sh->addWord('хлеб');
	$sh->addWord('клей');
	echo $sh->getCorrectWord('хлебы'); // хлеб
	echo $sh->getCorrectWord('хлебц'); // хлебцы

	$sh = new \alviden\corrector\models\Corrector();
	echo $sh->findRes('хлебц');
	/*  Current word: хлебцы
		Current koef: 0.96111111111111
		***
		NULL
	*/