2007-06-02 20:13:51 +00:00
|
|
|
<?php
|
2012-06-05 20:13:22 +00:00
|
|
|
/**
|
|
|
|
|
* Belarusian in Taraškievica orthography (Беларуская тарашкевіца) specific code.
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*
|
|
|
|
|
* @file
|
|
|
|
|
* @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
|
2018-05-23 23:23:42 +00:00
|
|
|
* @license GPL-2.0-or-later
|
|
|
|
|
* @license GFDL-1.3-or-later
|
2012-06-05 20:13:22 +00:00
|
|
|
* @ingroup Language
|
|
|
|
|
*/
|
2007-06-02 20:13:51 +00:00
|
|
|
|
2012-06-05 20:13:22 +00:00
|
|
|
/**
|
|
|
|
|
* Belarusian in Taraškievica orthography (Беларуская тарашкевіца)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup Language
|
2018-10-20 18:49:56 +00:00
|
|
|
* @see https://be-tarask.wikipedia.org/wiki/Project_talk:LanguageBe_tarask.php
|
2012-06-05 20:13:22 +00:00
|
|
|
*/
|
2018-01-01 13:10:16 +00:00
|
|
|
// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
|
2007-06-02 20:13:51 +00:00
|
|
|
class LanguageBe_tarask extends Language {
|
2008-01-02 18:40:05 +00:00
|
|
|
/**
|
2010-07-29 09:43:18 +00:00
|
|
|
* The Belarusian language uses apostrophe sign,
|
2010-04-12 21:12:34 +00:00
|
|
|
* but the characters used for this could be both U+0027 and U+2019.
|
|
|
|
|
* This function unifies apostrophe sign in search index values
|
|
|
|
|
* to enable seach using both apostrophe signs.
|
2011-05-29 15:53:18 +00:00
|
|
|
*
|
2014-04-17 13:31:28 +00:00
|
|
|
* @param string $string
|
2011-05-29 15:53:18 +00:00
|
|
|
*
|
|
|
|
|
* @return string
|
2010-04-12 21:12:34 +00:00
|
|
|
*/
|
2019-10-11 18:44:16 +00:00
|
|
|
public function normalizeForSearch( $string ) {
|
2010-04-12 21:12:34 +00:00
|
|
|
# MySQL fulltext index doesn't grok utf-8, so we
|
|
|
|
|
# need to fold cases and convert to hex
|
|
|
|
|
|
|
|
|
|
# Replacing apostrophe sign U+2019 with U+0027
|
2021-08-27 20:37:54 +00:00
|
|
|
$s = str_replace( "\u{2019}", '\'', $string );
|
2010-04-12 21:12:34 +00:00
|
|
|
|
|
|
|
|
$s = parent::normalizeForSearch( $s );
|
|
|
|
|
|
|
|
|
|
return $s;
|
|
|
|
|
}
|
2007-06-02 20:13:51 +00:00
|
|
|
}
|