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

32 lines
792 B
PHP
Executable file

<?php
namespace Tests\TextAnalysis\Indexes;
use TextAnalysis\Documents\TokensDocument;
use TextAnalysis\Collections\DocumentArrayCollection;
use TextAnalysis\Indexes\TfIdf;
/**
* @author yooper (yooper)
*/
class TfIdfTest extends \PHPUnit\Framework\TestCase
{
public function testIdf()
{
$docs = array(
new TokensDocument(array("marquette", "michigan", "hiking", "hiking", "hiking" , "camping", "swimming")),
new TokensDocument(array("ironwood", "michigan", "hiking", "biking", "camping", "swimming","marquette")),
new TokensDocument(array("no","tokens"))
);
$docCollection = new DocumentArrayCollection($docs);
$tfIdf = new TfIdf($docCollection);
}
}