1 | <?php declare(strict_types=1); |
||
13 | class StopWords |
||
14 | { |
||
15 | /** @var Configuration */ |
||
16 | private $config; |
||
17 | |||
18 | /** @var string[] */ |
||
19 | private $cached = []; |
||
20 | |||
21 | /** @var string[] */ |
||
22 | private $languages = [ |
||
23 | 'ar', 'da', 'de', 'en', 'es', 'fi', |
||
24 | 'fr', 'hu', 'id', 'it', 'ja', 'ko', |
||
25 | 'nb', 'nl', 'no', 'pl', 'pt', 'ru', |
||
26 | 'sv', 'zh' |
||
27 | ]; |
||
28 | |||
29 | /** |
||
30 | * @param Configuration $config |
||
31 | */ |
||
32 | public function __construct(Configuration $config) { |
||
35 | |||
36 | /** |
||
37 | * @return Configuration |
||
38 | */ |
||
39 | public function config(): Configuration { |
||
42 | |||
43 | /** |
||
44 | * @param string $str |
||
45 | * |
||
46 | * @return string |
||
47 | */ |
||
48 | public function removePunctuation(string $str): string { |
||
51 | |||
52 | /** |
||
53 | * @return string |
||
54 | */ |
||
55 | public function getLanguage(): string { |
||
63 | |||
64 | /** |
||
65 | * @return mixed |
||
66 | */ |
||
67 | public function getWordList(): array { |
||
76 | |||
77 | /** |
||
78 | * @param string $content |
||
79 | * |
||
80 | * @return WordStats |
||
81 | */ |
||
82 | public function getStopwordCount(string $content): WordStats { |
||
103 | |||
104 | /** |
||
105 | * @param string $strippedInput |
||
106 | * |
||
107 | * @return array |
||
108 | */ |
||
109 | public function getCandidateWords(string $strippedInput): string { |
||
118 | } |