Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 9 |
| Porter | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 9 |
| normalize(array $tokens) | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
| anonymous function ($token) | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
| <?php | |
| /** | |
| * This file is part of the Statistical Classifier package. | |
| * | |
| * (c) Cam Spiers <camspiers@gmail.com> | |
| * | |
| * For the full copyright and license information, please view the LICENSE | |
| * file that was distributed with this source code. | |
| */ | |
| namespace Camspiers\StatisticalClassifier\Normalizer\Token; | |
| use Porter as PorterStemmer; | |
| /** | |
| * @author Cam Spiers <camspiers@gmail.com> | |
| * @package Statistical Classifier | |
| */ | |
| class Porter implements NormalizerInterface | |
| { | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function normalize(array $tokens) | |
| { | |
| return array_map( | |
| function ($token) { | |
| return PorterStemmer::Stem(strtolower($token)); | |
| }, | |
| $tokens | |
| ); | |
| } | |
| } |