MediaWiki  master
CrhConverter Class Reference

Crimean Tatar (Qırımtatarca) converter routines. More...

Inheritance diagram for CrhConverter:
Collaboration diagram for CrhConverter:

Public Member Functions

 __construct ( $langobj)
 
 translate ( $text, $toVariant)
 It translates text into variant, specials: More...
 
- Public Member Functions inherited from LanguageConverterSpecific
 findVariantLink (&$link, &$nt, $ignoreOtherCond=false)
 A function wrapper: More...
 
- Public Member Functions inherited from LanguageConverter
 __construct ( $langobj, $maincode, $variants=[], $variantfallbacks=[], $flags=[], $manualLevel=[])
 
 autoConvert ( $text, $toVariant=false)
 Dictionary-based conversion. More...
 
 autoConvertToAllVariants ( $text)
 Call translate() to convert text to all valid variants. More...
 
 convert ( $text)
 Convert text to different variants of a language. More...
 
 convertCategoryKey ( $key)
 Convert the sorting key for category links. More...
 
 convertHtml ( $text)
 Perform output conversion on a string, and encode for safe HTML output. More...
 
 convertNamespace ( $index, $variant=null)
 Get the namespace display name in the preferred variant. More...
 
 convertTitle (LinkTarget $linkTarget)
 Auto convert a LinkTarget object to a readable string in the preferred variant. More...
 
 convertTo ( $text, $variant)
 Same as convert() except a extra parameter to custom variant. More...
 
 getConvRuleTitle ()
 Get the title produced by the conversion rule. More...
 
 getDefaultVariant ()
 Get default variant. More...
 
 getExtraHashOptions ()
 Returns language specific hash options. More...
 
 getPreferredVariant ()
 Get preferred language variant. More...
 
 getURLVariant ()
 Get the variant specified in the URL. More...
 
 getVariantFallbacks ( $variant)
 In case some variant is not defined in the markup, we need to have some fallback. More...
 
 getVariants ()
 Get all valid variants. More...
 
 getVarSeparatorPattern ()
 Get the cached separator pattern for ConverterRule::parseRules() More...
 
 guessVariant ( $text, $variant)
 Guess if a text is written in a variant. More...
 
 hasVariant ( $variant)
 Strict check if the language has the specific variant. More...
 
 hasVariants ()
 Check if this is a language with variants. More...
 
 markNoConversion ( $text, $noParse=false)
 Enclose a string with the "no conversion" tag. More...
 
 updateConversionTable (LinkTarget $linkTarget)
 Refresh the cache of conversion tables when MediaWiki:Conversiontable* is updated. More...
 
 validateVariant ( $variant=null)
 Validate the variant and return an appropriate strict internal variant code if one exists. More...
 

Public Attributes

 $mCyrillicToLatin
 
 $mCyrl2LatnExceptions = []
 
 $mCyrl2LatnPatterns = []
 
 $mCyrlCleanUpRegexes = []
 
 $mExceptionsLoaded = false
 
 $mLatinToCyrillic
 
 $mLatn2CyrlExceptions = []
 
 $mLatn2CyrlPatterns = []
 
const C_CONS = 'бвгджзйклмнпрстфхцчшщcñБВГДЖЗЙКЛМНПРСТФХЦЧШЩCÑ'
 
const C_CONS_LC = 'бвгджзйклмнпрстфхцчшщcñ'
 
const C_CONS_UC = 'БВГДЖЗЙКЛМНПРСТФХЦЧШЩCÑ'
 
const C_LC = 'абвгдеёжзийклмнопрстуфхцчшщъыьэюя'
 
const C_M_CONS = 'бгкмшcБГКМШC'
 
const C_UC = 'АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ'
 
const L_CONS = 'bcçdfgğhjklmnñpqrsştvzBCÇDFGĞHJKLMNÑPQRSŞTVZ'
 
const L_CONS_LC = 'bcçdfgğhjklmnñpqrsştvz'
 
const L_CONS_UC = 'BCÇDFGĞHJKLMNÑPQRSŞTVZ'
 
const L_F = 'eiöüEİÖÜ'
 
const L_F_UC = 'EİÖÜ'
 
const L_LC = 'aâbcçdefgğhıijklmnñoöpqrsştuüvyz'
 
const L_M_CONS = 'bcgkmpşBCGKMPŞ'
 
const L_N_CONS = 'çnrstzÇNRSTZ'
 
const L_N_CONS_LC = 'çnrstz'
 
const L_N_CONS_UC = 'ÇNRSTZ'
 
const L_UC = 'AÂBCÇDEFGĞHIİJKLMNÑOÖPQRSŞTUÜVYZ'
 
const L_VOW = 'aâeıioöuüAÂEIİOÖUÜ'
 
const L_VOW_UC = 'AÂEIİOÖUÜ'
 
- Public Attributes inherited from LanguageConverter
 $mDescCodeSep = ':'
 
 $mDescVarSep = ';'
 
 $mFlags
 
 $mMainLanguageCode
 
 $mManualLevel
 
 $mVariantNames
 
string[] $mVariants
 

Protected Member Functions

 loadDefaultTables ()
 Load default conversion tables. More...
 
- Protected Member Functions inherited from LanguageConverter
 applyManualConv (ConverterRule $convRule)
 Apply manual conversion rules. More...
 
 getHeaderVariant ()
 Determine the language variant from the Accept-Language header. More...
 
 getUserVariant (User $user)
 Determine if the user has a variant set. More...
 
 loadTables ( $fromCache=true)
 Load conversion tables either from the cache or the disk. More...
 
 postLoadTables ()
 Hook for post processing after conversion tables are loaded. More...
 
 recursiveConvertRule ( $text, $variant, &$startPos, $depth=0)
 Recursively convert text on the inside. More...
 
 recursiveConvertTopLevel ( $text, $variant, $depth=0)
 Recursively convert text on the outside. More...
 

Private Member Functions

 loadExceptions ()
 
 regsConverter ( $text, $toVariant)
 

Additional Inherited Members

- Static Public Attributes inherited from LanguageConverter
static array $languagesWithVariants
 languages supporting variants More...
 
- Protected Attributes inherited from LanguageConverter
ReplacementArray[] bool[] $mTables
 

Detailed Description

Crimean Tatar (Qırımtatarca) converter routines.

Definition at line 31 of file CrhConverter.php.

Constructor & Destructor Documentation

◆ __construct()

CrhConverter::__construct (   $langobj)
Parameters
Language$langobj

Definition at line 80 of file CrhConverter.php.

References loadExceptions().

Member Function Documentation

◆ loadDefaultTables()

CrhConverter::loadDefaultTables ( )
protected

Load default conversion tables.

This method must be implemented in derived class.

Exceptions
MWException

Reimplemented from LanguageConverter.

Definition at line 162 of file CrhConverter.php.

◆ loadExceptions()

CrhConverter::loadExceptions ( )
private

Definition at line 170 of file CrhConverter.php.

Referenced by __construct().

◆ regsConverter()

CrhConverter::regsConverter (   $text,
  $toVariant 
)
private

Definition at line 244 of file CrhConverter.php.

Referenced by translate().

◆ translate()

CrhConverter::translate (   $text,
  $toVariant 
)

It translates text into variant, specials:

  • omitting roman numbers
Parameters
string$text
bool$toVariant
Exceptions
MWException
Returns
string

Reimplemented from LanguageConverter.

Definition at line 192 of file CrhConverter.php.

References $matches, LanguageConverter\loadTables(), and regsConverter().

Member Data Documentation

◆ $mCyrillicToLatin

CrhConverter::$mCyrillicToLatin
Initial value:
= [
## these are independent of location in the word, but have
## to go first so other transforms don't bleed them
'гъ' => 'ğ', 'Гъ' => 'Ğ', 'ГЪ' => 'Ğ',
'къ' => 'q', 'Къ' => 'Q', 'КЪ' => 'Q',
'нъ' => 'ñ', 'Нъ' => 'Ñ', 'НЪ' => 'Ñ',
'дж' => 'c', 'Дж' => 'C', 'ДЖ' => 'C',
'А' => 'A', 'а' => 'a', 'Б' => 'B', 'б' => 'b',
'В' => 'V', 'в' => 'v', 'Г' => 'G', 'г' => 'g',
'Д' => 'D', 'д' => 'd', 'Ж' => 'J', 'ж' => 'j',
'З' => 'Z', 'з' => 'z', 'И' => 'İ', 'и' => 'i',
'Й' => 'Y', 'й' => 'y', 'К' => 'K', 'к' => 'k',
'Л' => 'L', 'л' => 'l', 'М' => 'M', 'м' => 'm',
'Н' => 'N', 'н' => 'n', 'П' => 'P', 'п' => 'p',
'Р' => 'R', 'р' => 'r', 'С' => 'S', 'с' => 's',
'Т' => 'T', 'т' => 't', 'Ф' => 'F', 'ф' => 'f',
'Х' => 'H', 'х' => 'h', 'Ч' => 'Ç', 'ч' => 'ç',
'Ш' => 'Ş', 'ш' => 'ş', 'Ы' => 'I', 'ы' => 'ı',
'Э' => 'E', 'э' => 'e', 'Е' => 'E', 'е' => 'e',
'Я' => 'Â', 'я' => 'â', 'У' => 'U', 'у' => 'u',
'О' => 'O', 'о' => 'o',
'Ё' => 'Yo', 'ё' => 'yo', 'Ю' => 'Yu', 'ю' => 'yu',
'Ц' => 'Ts', 'ц' => 'ts', 'Щ' => 'Şç', 'щ' => 'şç',
'Ь' => '', 'ь' => '', 'Ъ' => '', 'ъ' => '',
]

Definition at line 97 of file CrhConverter.php.

◆ $mCyrl2LatnExceptions

CrhConverter::$mCyrl2LatnExceptions = []

Definition at line 152 of file CrhConverter.php.

◆ $mCyrl2LatnPatterns

CrhConverter::$mCyrl2LatnPatterns = []

Definition at line 155 of file CrhConverter.php.

◆ $mCyrlCleanUpRegexes

CrhConverter::$mCyrlCleanUpRegexes = []

Definition at line 158 of file CrhConverter.php.

◆ $mExceptionsLoaded

CrhConverter::$mExceptionsLoaded = false

Definition at line 160 of file CrhConverter.php.

◆ $mLatinToCyrillic

CrhConverter::$mLatinToCyrillic
Initial value:
= [
'Â' => 'Я', 'â' => 'я', 'B' => 'Б', 'b' => 'б',
'Ç' => 'Ч', 'ç' => 'ч', 'D' => 'Д', 'd' => 'д',
'F' => 'Ф', 'f' => 'ф', 'G' => 'Г', 'g' => 'г',
'H' => 'Х', 'h' => 'х', 'I' => 'Ы', 'ı' => 'ы',
'İ' => 'И', 'i' => 'и', 'J' => 'Ж', 'j' => 'ж',
'K' => 'К', 'k' => 'к', 'L' => 'Л', 'l' => 'л',
'M' => 'М', 'm' => 'м', 'N' => 'Н', 'n' => 'н',
'O' => 'О', 'o' => 'о', 'P' => 'П', 'p' => 'п',
'R' => 'Р', 'r' => 'р', 'S' => 'С', 's' => 'с',
'Ş' => 'Ш', 'ş' => 'ш', 'T' => 'Т', 't' => 'т',
'V' => 'В', 'v' => 'в', 'Z' => 'З', 'z' => 'з',
'ya' => 'я', 'Ya' => 'Я', 'YA' => 'Я',
'ye' => 'е', 'YE' => 'Е', 'Ye' => 'Е',
'A' => 'А', 'a' => 'а', 'E' => 'Е', 'e' => 'е',
'Ö' => 'Ё', 'ö' => 'ё', 'U' => 'У', 'u' => 'у',
'Ü' => 'Ю', 'ü' => 'ю', 'Y' => 'Й', 'y' => 'й',
'C' => 'Дж', 'c' => 'дж', 'Ğ' => 'Гъ', 'ğ' => 'гъ',
'Ñ' => 'Нъ', 'ñ' => 'нъ', 'Q' => 'Къ', 'q' => 'къ',
]

Definition at line 127 of file CrhConverter.php.

◆ $mLatn2CyrlExceptions

CrhConverter::$mLatn2CyrlExceptions = []

Definition at line 153 of file CrhConverter.php.

◆ $mLatn2CyrlPatterns

CrhConverter::$mLatn2CyrlPatterns = []

Definition at line 156 of file CrhConverter.php.

◆ C_CONS

const CrhConverter::C_CONS = 'бвгджзйклмнпрстфхцчшщcñБВГДЖЗЙКЛМНПРСТФХЦЧШЩCÑ'

Definition at line 47 of file CrhConverter.php.

◆ C_CONS_LC

const CrhConverter::C_CONS_LC = 'бвгджзйклмнпрстфхцчшщcñ'

Definition at line 42 of file CrhConverter.php.

◆ C_CONS_UC

const CrhConverter::C_CONS_UC = 'БВГДЖЗЙКЛМНПРСТФХЦЧШЩCÑ'

Definition at line 40 of file CrhConverter.php.

◆ C_LC

const CrhConverter::C_LC = 'абвгдеёжзийклмнопрстуфхцчшщъыьэюя'

Definition at line 38 of file CrhConverter.php.

◆ C_M_CONS

const CrhConverter::C_M_CONS = 'бгкмшcБГКМШC'

Definition at line 44 of file CrhConverter.php.

◆ C_UC

const CrhConverter::C_UC = 'АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ'

Definition at line 36 of file CrhConverter.php.

◆ L_CONS

const CrhConverter::L_CONS = 'bcçdfgğhjklmnñpqrsştvzBCÇDFGĞHJKLMNÑPQRSŞTVZ'

Definition at line 67 of file CrhConverter.php.

◆ L_CONS_LC

const CrhConverter::L_CONS_LC = 'bcçdfgğhjklmnñpqrsştvz'

Definition at line 65 of file CrhConverter.php.

◆ L_CONS_UC

const CrhConverter::L_CONS_UC = 'BCÇDFGĞHJKLMNÑPQRSŞTVZ'

Definition at line 63 of file CrhConverter.php.

◆ L_F

const CrhConverter::L_F = 'eiöüEİÖÜ'

Definition at line 75 of file CrhConverter.php.

◆ L_F_UC

const CrhConverter::L_F_UC = 'EİÖÜ'

Definition at line 73 of file CrhConverter.php.

◆ L_LC

const CrhConverter::L_LC = 'aâbcçdefgğhıijklmnñoöpqrsştuüvyz'

Definition at line 53 of file CrhConverter.php.

◆ L_M_CONS

const CrhConverter::L_M_CONS = 'bcgkmpşBCGKMPŞ'

Definition at line 61 of file CrhConverter.php.

◆ L_N_CONS

const CrhConverter::L_N_CONS = 'çnrstzÇNRSTZ'

Definition at line 59 of file CrhConverter.php.

◆ L_N_CONS_LC

const CrhConverter::L_N_CONS_LC = 'çnrstz'

Definition at line 57 of file CrhConverter.php.

◆ L_N_CONS_UC

const CrhConverter::L_N_CONS_UC = 'ÇNRSTZ'

Definition at line 55 of file CrhConverter.php.

◆ L_UC

const CrhConverter::L_UC = 'AÂBCÇDEFGĞHIİJKLMNÑOÖPQRSŞTUÜVYZ'

Definition at line 51 of file CrhConverter.php.

◆ L_VOW

const CrhConverter::L_VOW = 'aâeıioöuüAÂEIİOÖUÜ'

Definition at line 71 of file CrhConverter.php.

◆ L_VOW_UC

const CrhConverter::L_VOW_UC = 'AÂEIİOÖUÜ'

Definition at line 69 of file CrhConverter.php.


The documentation for this class was generated from the following file: