-- Genel, PHP, Projeler

PHP – Türkçe Çekim ve Yapım Ekleri

Türkçe Çekim ve Yapım Ekleri (Turkish Suffix Library for PHP)

Composer ile Kurulum

Komut satırında composer ile dosyaları indirin.

composer require yasinkuyu/turkish

Composer autoload aktif değilse, dahil (include) edin.

require_once __DIR__ . '/vendor/autoload.php';

Elle (Manüel) Kurulum

Dosyayı indirin ve projenize dahil (include) edin.

require 'Turkish.php';

Kullanım
$tr = new Turkish;

echo $tr->makeGenitive("Öykü", array ( "proper_noun" => true ) );
echo $tr->makeDative("Fatma", array ( "proper_noun" => true ) );

echo $tr->makeDative("Yasin", array ( "proper_noun" => true ) );
echo $tr->makeDative("ALİ", array ( "proper_noun" => true ) );
echo $tr->makeAblative("Ali", array ( "proper_noun" => true ) );
echo $tr->makeAccusative("Kaliningrad", array ( "proper_noun" => true ) );

echo $tr->makeGenitive("ağaç", array ( "proper_noun" => false ) );
echo $tr->makeAccusative("erik", array ( "proper_noun" => false ) );
echo $tr->makeAccusative("Erik", array ( "proper_noun" => true ) );

echo $tr->possessiveAffix("kavanoz", array ( "person" => "1", "quantity" => "singular" ) );
echo $tr->possessiveAffix("kavanoz", array ( "person" => "2", "quantity" => "singular") );
echo $tr->possessiveAffix("kavanoz", array ( "person" => "3", "quantity" => "singular") );

echo $tr->possessiveAffix("halter", array ( "person" => "1", "quantity" => "plural") );
echo $tr->possessiveAffix("halter", array ( "person" => "2", "quantity" => "plural") );
echo $tr->possessiveAffix("halter", array ( "person" => "3", "quantity" => "plural") );

echo $tr->possessiveAffix("Kenya", array ( "person" => "3", "quantity" => "plural") );
Örneğin Çıktısı;
 Öykü'nün
 Fatma'ya
 Yasin'e
 ALİ'YE
 Ali'den
 Kaliningrad'ı
 ağacın
 eriği
 Erik'i
 kavanozum
 kavanozun
 kavanozu
 halterimiz
 halteriniz
 halterleri
 Kenyaları

GitHub