xref: /dokuwiki/inc/Search/Collection/FrequencyCollection.php (revision f2bbffb509f37291c31c023167b8aeb383079d6d)
1<?php
2
3namespace dokuwiki\Search\Collection;
4
5/**
6 * Abstract collection for frequency-based indexes
7 *
8 * In a frequency collection the same token can appear multiple times per entity. The frequency of each
9 * token per entity is tracked.
10 *
11 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
12 * @author Andreas Gohr <andi@splitbrain.org>
13 * @author Tom N Harris <tnharris@whoopdedo.org>
14 */
15abstract class FrequencyCollection extends AbstractCollection
16{
17    /** @inheritdoc */
18    protected function countTokens(array $tokens): array
19    {
20        return array_count_values($tokens);
21    }
22}
23