cii-text-analysis/vendor/yooper/php-text-analysis/tests/TextAnalysis/Stemmers/LambdaStemmerTest.php
Jéremy Munsch f68d2ac333
premier poc
2026-02-11 08:24:04 +01:00

22 lines
457 B
PHP
Executable file

<?php
namespace Tests\TextAnalysis\Stemmers;
use TextAnalysis\Stemmers\LambdaStemmer;
/**
*
* @author yooper
*/
class LambdaStemmerTest extends \PHPUnit\Framework\TestCase
{
public function testSimpleLambda()
{
$lambdaFunc = function($word) {
return preg_filter("/my/i", "", $word);
};
$stemmer = new LambdaStemmer($lambdaFunc);
$this->assertEquals("tom", $stemmer->stem("tommy"));
}
}