cii-text-analysis/vendor/yooper/php-text-analysis/tests/TextAnalysis/Indexes/TfIdfTest.php

33 lines
792 B
PHP
Raw Permalink Normal View History

2026-02-10 16:19:59 +01:00
<?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);
}
}