You can download the gist as zip and open it. After open it, run the below command:
composer install
Then our environment ready. Just run the file :
php example.php
{ | |
"name": "sample_project/test", | |
"authors": [ | |
{ | |
"name": "Haydar KULEKCI", | |
"email": "[email protected]" | |
} | |
], | |
"require": { | |
"hkulekci/turkish-stemmer-php": "dev-master" | |
} | |
} |
<?php | |
include_once 'vendor/autoload.php'; | |
use TurkishStemmer\Stemmer; | |
$stemmer = new Stemmer(); | |
// Amasya | |
echo $stemmer->stem('Amasyalılar') . PHP_EOL; | |
// Köy | |
echo $stemmer->stem('köylülerimiz') . PHP_EOL; | |
// Köyl => burada hatalı sonuç veriyor örneğin | |
echo $stemmer->stem('köylü') . PHP_EOL; | |