Skip to content

Instantly share code, notes, and snippets.

@hkulekci
Created April 27, 2020 11:20
Show Gist options
  • Save hkulekci/9405e3f229da2136bacda20d61bd01bf to your computer and use it in GitHub Desktop.
Save hkulekci/9405e3f229da2136bacda20d61bd01bf to your computer and use it in GitHub Desktop.
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": "[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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment