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)
 
 getLanguageVariants ()
 Get supported variants of the language. More...
 
 getMainCode ()
 Get Main language code. More...
 
 getVariantsFallbacks ()
 Get language variants fallbacks. More...
 
 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
 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...
 
 convertSplitTitle ( $title)
 Auto convert a LinkTarget or PageReference to a readable string in the preferred variant, separating the namespace and the main part of the title. More...
 
 convertTitle ( $title)
 Auto convert a LinkTarget or PageReference to a readable string in the preferred variant. More...
 
 convertTo ( $text, $variant, bool $clearState=true)
 Same as convert() except a extra parameter to custom variant. More...
 
 getConvRuleTitle ()
 Get the title produced by the conversion rule. More...
 
 getDefaultVariant ()
 This function would not be affected by user's settings. More...
 
 getDescCodeSeparator ()
 Get desc code separator. More...
 
 getDescVarSeparator ()
 Get desc var separator. More...
 
 getExtraHashOptions ()
 Returns language specific hash options. More...
 
 getFlags ()
 Get strings that maps to the flags. More...
 
 getManualLevel ()
 Get manual level limit for supported variants. 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...
 
 getVariantNames ()
 Get variant names. More...
 
 getVariants ()
 Get all valid variants for current Converter. 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Ü'
 

Protected Member Functions

 loadDefaultTables ()
 @inheritDoc More...
 
- Protected Member Functions inherited from LanguageConverter
 applyManualConv (ConverterRule $convRule)
 Apply manual conversion rules. More...
 
 getAdditionalFlags ()
 Provides additional flags for converter. More...
 
 getAdditionalManualLevel ()
 Provides additional flags for converter. More...
 
 getHeaderVariant ()
 Determine the language variant from the Accept-Language header. More...
 
 getStaticDefaultVariant ()
 Get static default variant. 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 (&$tables)
 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...
 

Additional Inherited Members

- Static Public Attributes inherited from LanguageConverter
static array< string, string > $languagesWithStaticDefaultVariant
 static default variant of languages supporting variants for use with DefaultOptionsLookup.php More...
 
static string[] $languagesWithVariants
 languages supporting variants More...
 
- Protected Attributes inherited from LanguageConverter
ReplacementArray[] $mTables = []
 

Detailed Description

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

Adapted from https://crh.wikipedia.org/wiki/Qullan%C4%B1c%C4%B1:Don_Alessandro/Translit

Definition at line 30 of file CrhConverter.php.

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from LanguageConverter.

Definition at line 113 of file CrhConverter.php.

Member Function Documentation

◆ getLanguageVariants()

CrhConverter::getLanguageVariants ( )

Get supported variants of the language.

Since
1.36
Returns
array

Reimplemented from LanguageConverter.

Definition at line 92 of file CrhConverter.php.

◆ getMainCode()

CrhConverter::getMainCode ( )

Get Main language code.

Since
1.36
Returns
string

Reimplemented from LanguageConverter.

Definition at line 82 of file CrhConverter.php.

◆ getVariantsFallbacks()

CrhConverter::getVariantsFallbacks ( )

Get language variants fallbacks.

Since
1.36
Returns
array

Reimplemented from LanguageConverter.

Definition at line 102 of file CrhConverter.php.

◆ loadDefaultTables()

CrhConverter::loadDefaultTables ( )
protected

@inheritDoc

Reimplemented from LanguageConverter.

Definition at line 190 of file CrhConverter.php.

◆ translate()

CrhConverter::translate (   $text,
  $toVariant 
)

It translates text into variant, specials:

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

Reimplemented from LanguageConverter.

Definition at line 220 of file CrhConverter.php.

References $matches.

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 122 of file CrhConverter.php.

◆ $mCyrl2LatnExceptions

CrhConverter::$mCyrl2LatnExceptions = []

Definition at line 177 of file CrhConverter.php.

◆ $mCyrl2LatnPatterns

CrhConverter::$mCyrl2LatnPatterns = []

Definition at line 180 of file CrhConverter.php.

◆ $mCyrlCleanUpRegexes

CrhConverter::$mCyrlCleanUpRegexes = []

Definition at line 183 of file CrhConverter.php.

◆ $mExceptionsLoaded

CrhConverter::$mExceptionsLoaded = false

Definition at line 185 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 152 of file CrhConverter.php.

◆ $mLatn2CyrlExceptions

CrhConverter::$mLatn2CyrlExceptions = []

Definition at line 178 of file CrhConverter.php.

◆ $mLatn2CyrlPatterns

CrhConverter::$mLatn2CyrlPatterns = []

Definition at line 181 of file CrhConverter.php.

◆ C_CONS

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

Definition at line 46 of file CrhConverter.php.

◆ C_CONS_LC

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

Definition at line 41 of file CrhConverter.php.

◆ C_CONS_UC

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

Definition at line 39 of file CrhConverter.php.

◆ C_LC

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

Definition at line 37 of file CrhConverter.php.

◆ C_M_CONS

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

Definition at line 43 of file CrhConverter.php.

◆ C_UC

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

Definition at line 35 of file CrhConverter.php.

◆ L_CONS

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

Definition at line 66 of file CrhConverter.php.

◆ L_CONS_LC

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

Definition at line 64 of file CrhConverter.php.

◆ L_CONS_UC

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

Definition at line 62 of file CrhConverter.php.

◆ L_F

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

Definition at line 74 of file CrhConverter.php.

◆ L_F_UC

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

Definition at line 72 of file CrhConverter.php.

◆ L_LC

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

Definition at line 52 of file CrhConverter.php.

◆ L_M_CONS

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

Definition at line 60 of file CrhConverter.php.

◆ L_N_CONS

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

Definition at line 58 of file CrhConverter.php.

◆ L_N_CONS_LC

const CrhConverter::L_N_CONS_LC = 'çnrstz'

Definition at line 56 of file CrhConverter.php.

◆ L_N_CONS_UC

const CrhConverter::L_N_CONS_UC = 'ÇNRSTZ'

Definition at line 54 of file CrhConverter.php.

◆ L_UC

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

Definition at line 50 of file CrhConverter.php.

◆ L_VOW

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

Definition at line 70 of file CrhConverter.php.

◆ L_VOW_UC

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

Definition at line 68 of file CrhConverter.php.


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