Skip to content

Instantly share code, notes, and snippets.

@hkulekci
Created Apr 27, 2020
Embed
What would you like to do?
Turkish Stemmer PHP Test

Sample Usage For the PHP Turkish Stemmer Project

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": "haydarkulekci@gmail.com"
}
],
"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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment