Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
LanguageBe_tarask
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 normalizeForSearch
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
17 *
18 * @file
19 * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
20 * @license GPL-2.0-or-later
21 * @license GFDL-1.3-or-later
22 */
23
24/**
25 * Belarusian in Taraškievica orthography (Беларуская тарашкевіца)
26 *
27 * @ingroup Languages
28 * @see https://be-tarask.wikipedia.org/wiki/Project_talk:LanguageBe_tarask.php
29 */
30// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
31class LanguageBe_tarask extends Language {
32    /**
33     * The Belarusian language uses apostrophe sign,
34     * but the characters used for this could be both U+0027 and U+2019.
35     * This function unifies apostrophe sign in search index values
36     * to enable search using both apostrophe signs.
37     *
38     * @inheritDoc
39     */
40    public function normalizeForSearch( $text ) {
41        # MySQL fulltext index doesn't grok utf-8, so we
42        # need to fold cases and convert to hex
43
44        # Replacing apostrophe sign U+2019 with U+0027
45        $text = str_replace( "\u{2019}", '\'', $text );
46
47        return parent::normalizeForSearch( $text );
48    }
49}