Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | public function tokenize(string $text): array |
||
35 | { |
||
36 | preg_match_all('/\w\w+/u', $text, $words); |
||
37 | |||
38 | $words = $words[0]; |
||
39 | |||
40 | $nGrams = []; |
||
41 | for ($j = $this->minGram; $j <= $this->maxGram; $j++) { |
||
42 | $nGrams = array_merge($nGrams, $this->getNgrams($words, $j)); |
||
43 | } |
||
44 | |||
45 | return $nGrams; |
||
46 | } |
||
65 |