-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_pspell_php.php
More file actions
31 lines (24 loc) · 831 Bytes
/
Copy pathtest_pspell_php.php
File metadata and controls
31 lines (24 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
include "test_header.php";
use PhpSpellcheck\Spellchecker\PHPPspell;
require_once __DIR__ . '/vendor/autoload.php';
$testName = "Tigitz PHP (Ppsell PHP extension)";
$checker = new PHPPspell();
foreach($tests as $locale => $featureFile) {
$content = file_get_contents(__DIR__ . $featureFile);
$misspelling_counter[$locale] = 0;
$i = 0;
while ($i < $testsLoop) {
$misspellings = $checker->check($content, [$locale], ['Pspell context']);
foreach ($misspellings as $misspelling) {
$misspelling_counter[$locale]++;
// print_r([
// $misspelling->getWord(),
// $misspelling->getLineNumber(),
// $misspelling->getOffset(),
// ]);
}
$i++;
}
}
include "test_footer.php";