1 | <?php |
||
8 | class NGrams extends Shift implements \Iterator, \Countable |
||
9 | { |
||
10 | /** |
||
11 | * @var |
||
12 | */ |
||
13 | protected $currentValue; |
||
14 | |||
15 | /** |
||
16 | * NGrams constructor. |
||
17 | * |
||
18 | * @param array $dataset |
||
19 | * The dataset |
||
20 | * @param int $length |
||
21 | * The shift length |
||
22 | */ |
||
23 | 4 | public function __construct(array $dataset = [], $length = 1) |
|
28 | |||
29 | /** |
||
30 | * {@inheritdoc} |
||
31 | */ |
||
32 | 4 | public function next() |
|
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | */ |
||
41 | public function rewind() |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | 4 | public function current() |
|
54 | } |
||
55 |