Example Code:
<?php
include('I18N_Arabic.php');
$Arabic = new I18N_Arabic('Stemmer');
$examples = array();
$examples[] = 'سيعرفونها من خلال العمل بالحاسوبين المستعملين لديهما';
$examples[] = 'الخيليات البرية المهددة بالإنقراض';
$examples[] = 'تزايدت الحواسيب الشخصية بمساعدة التطبيقات الرئيسية';
$examples[] = 'سيتعذر هذا على عمليات نشر المساعدات للجائعين بالطريقة الجديدة';
foreach ($examples as $str) {
echo $str . ' <br />(';
$words = split(' ', $str);
$stems = array();
foreach ($words as $word) {
$stem = $Arabic->stem($word);
if ($stem) {
$stems[] = $stem;
}
}
echo implode('، ', $stems) . ')<br /><br />';
}
?>
Total execution time is 0.037938117980957 seconds
Amount of memory allocated to this script is 256456 bytes
Names of included or required files:
- /srv/www/vhosts/ar-php.org/httpdocs/I18N_Arabic/I18N_Arabic/Examples/ArStemmer.php
- /srv/www/vhosts/ar-php.org/httpdocs/I18N_Arabic/I18N_Arabic.php
- /srv/www/vhosts/ar-php.org/httpdocs/I18N_Arabic/I18N_Arabic/I18N_Arabic_Stemmer.php
Related Class Documentation