mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
fix function naming
This commit is contained in:
parent
bc3b9154e9
commit
4f401bf2a8
|
|
@ -248,7 +248,7 @@ final class BasicOcr
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function match(string $path, int $comparison = 3, int $limit = 0) : array
|
||||
public function matchImage(string $path, int $comparison = 3, int $limit = 0) : array
|
||||
{
|
||||
// @todo: implement image reading if it isn't an mnist file
|
||||
$Xtest = $this->readImages($path, $limit);
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ final class NaiveBayesClassifier
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function match(string $criteria, array $toMatch, int $minimum = 3) : float
|
||||
public function matchCriteria(string $criteria, array $toMatch, int $minimum = 3) : float
|
||||
{
|
||||
$this->preCalculateProbabilities($toMatch);
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ final class BasicOcrTest extends \PHPUnit\Framework\TestCase
|
|||
['label' => 0, 'prob' => 1], ['label' => 0, 'prob' => 1], ['label' => 0, 'prob' => 1],
|
||||
['label' => 4, 'prob' => 2 / 3], ['label' => 9, 'prob' => 1 / 3], ['label' => 4, 'prob' => 2 / 3],
|
||||
],
|
||||
$ocr->match(__DIR__ . '/t10k-images-idx3-ubyte', 3, 5)
|
||||
$ocr->matchImage(__DIR__ . '/t10k-images-idx3-ubyte', 3, 5)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ final class NaiveBayesClassifierTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
self::assertEqualsWithDelta(
|
||||
0.6,
|
||||
$filter->match('play', ['weather' => ['Sunny']], 1),
|
||||
$filter->matchCriteria('play', ['weather' => ['Sunny']], 1),
|
||||
0.01
|
||||
);
|
||||
}
|
||||
|
|
@ -86,7 +86,7 @@ final class NaiveBayesClassifierTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
self::assertEqualsWithDelta(
|
||||
0.999988,
|
||||
$filter->match('female', ['height' => 6, 'weight' => 130, 'foot' => 8]),
|
||||
$filter->matchCriteria('female', ['height' => 6, 'weight' => 130, 'foot' => 8]),
|
||||
0.01
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user