MediaWiki  1.23.13
SrConverter Class Reference

There are two levels of conversion for Serbian: the script level (Cyrillics <-> Latin), and the variant level (ekavian <->iyekavian). More...

Inheritance diagram for SrConverter:
Collaboration diagram for SrConverter:

Public Member Functions

 autoConvert ( $text, $toVariant=false)
 An ugly function wrapper for parsing Image titles (to prevent image name conversion) More...
 
 findVariantLink (&$link, &$nt, $ignoreOtherCond=false)
 A function wrapper: More...
 
 guessVariant ( $text, $variant)
 Guess if a text is written in Cyrillic or Latin. More...
 
 loadDefaultTables ()
 
 parseManualRule ( $rule, $flags=array())
 rules should be defined as -{ekavian | iyekavian-} -or- -{code:text | code:text | ...}- More...
 
 translate ( $text, $toVariant)
 It translates text into variant, specials: More...
 

Public Attributes

 $mToCyrillics
 
 $mToLatin
 

Detailed Description

There are two levels of conversion for Serbian: the script level (Cyrillics <-> Latin), and the variant level (ekavian <->iyekavian).

The two are orthogonal. So we really only need two dictionaries: one for Cyrillics and Latin, and one for ekavian and iyekavian.

Definition at line 35 of file LanguageSr.php.

Member Function Documentation

◆ autoConvert()

SrConverter::autoConvert (   $text,
  $toVariant = false 
)

An ugly function wrapper for parsing Image titles (to prevent image name conversion)

Parameters
$textstring
$toVariantbool
Returns
string

Definition at line 140 of file LanguageSr.php.

References $wgTitle, global, and NS_FILE.

◆ findVariantLink()

SrConverter::findVariantLink ( $link,
$nt,
  $ignoreOtherCond = false 
)

A function wrapper:

  • if there is no selected variant, leave the link names as they were
  • do not try to find variants for usernames
Parameters
$linkstring
$ntTitle
$ignoreOtherCondbool

Definition at line 115 of file LanguageSr.php.

References $link, NS_USER, and NS_USER_TALK.

◆ guessVariant()

SrConverter::guessVariant (   $text,
  $variant 
)

Guess if a text is written in Cyrillic or Latin.

Overrides LanguageConverter::guessVariant()

Parameters
string$textThe text to be checked
string$variantLanguage code of the variant to be checked for
Returns
bool true if $text appears to be written in $variant
Author
Nikola Smolenski smole.nosp@m.nsk@.nosp@m.eunet.nosp@m..rs
Since
1.19

Definition at line 200 of file LanguageSr.php.

◆ loadDefaultTables()

SrConverter::loadDefaultTables ( )

Definition at line 72 of file LanguageSr.php.

References array().

◆ parseManualRule()

SrConverter::parseManualRule (   $rule,
  $flags = array() 
)

rules should be defined as -{ekavian | iyekavian-} -or- -{code:text | code:text | ...}-

update: delete all rule parsing because it's not used currently, and just produces a couple of bugs

Parameters
$rulestring
$flagsarray
Returns
array

Definition at line 91 of file LanguageSr.php.

References $flags, array(), and as.

◆ translate()

SrConverter::translate (   $text,
  $toVariant 
)

It translates text into variant, specials:

  • ommiting roman numbers
Parameters
$textstring
$toVariantstring
Exceptions
MWException
Returns
string

Definition at line 161 of file LanguageSr.php.

References $matches, $ret, as, and Makefile\translate().

Member Data Documentation

◆ $mToCyrillics

SrConverter::$mToCyrillics
Initial value:
'a' => 'а', 'b' => 'б', 'c' => 'ц', 'č' => 'ч', 'ć' => 'ћ',
'd' => 'д', 'dž' => 'џ', 'đ' => 'ђ', 'e' => 'е', 'f' => 'ф',
'g' => 'г', 'h' => 'х', 'i' => 'и', 'j' => 'ј', 'k' => 'к',
'l' => 'л', 'lj' => 'љ', 'm' => 'м', 'n' => 'н', 'nj' => 'њ',
'o' => 'о', 'p' => 'п', 'r' => 'р', 's' => 'с', 'š' => 'ш',
't' => 'т', 'u' => 'у', 'v' => 'в', 'z' => 'з', 'ž' => 'ж',
'A' => 'А', 'B' => 'Б', 'C' => 'Ц', 'Č' => 'Ч', 'Ć' => 'Ћ',
'D' => 'Д', 'Dž' => 'Џ', 'Đ' => 'Ђ', 'E' => 'Е', 'F' => 'Ф',
'G' => 'Г', 'H' => 'Х', 'I' => 'И', 'J' => 'Ј', 'K' => 'К',
'L' => 'Л', 'LJ' => 'Љ', 'M' => 'М', 'N' => 'Н', 'NJ' => 'Њ',
'O' => 'О', 'P' => 'П', 'R' => 'Р', 'S' => 'С', 'Š' => 'Ш',
'T' => 'Т', 'U' => 'У', 'V' => 'В', 'Z' => 'З', 'Ž' => 'Ж',
'DŽ' => 'Џ', 'd!ž' => 'дж', 'D!ž' => 'Дж', 'D!Ž' => 'ДЖ',
'Lj' => 'Љ', 'l!j' => 'лј', 'L!j' => 'Лј', 'L!J' => 'ЛЈ',
'Nj' => 'Њ', 'n!j' => 'нј', 'N!j' => 'Нј', 'N!J' => 'НЈ'
)

Definition at line 52 of file LanguageSr.php.

◆ $mToLatin

SrConverter::$mToLatin
Initial value:
'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd',
'ђ' => 'đ', 'е' => 'e', 'ж' => 'ž', 'з' => 'z', 'и' => 'i',
'ј' => 'j', 'к' => 'k', 'л' => 'l', 'љ' => 'lj', 'м' => 'm',
'н' => 'n', 'њ' => 'nj', 'о' => 'o', 'п' => 'p', 'р' => 'r',
'с' => 's', 'т' => 't', 'ћ' => 'ć', 'у' => 'u', 'ф' => 'f',
'х' => 'h', 'ц' => 'c', 'ч' => 'č', 'џ' => 'dž', 'ш' => 'š',
'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D',
'Ђ' => 'Đ', 'Е' => 'E', 'Ж' => 'Ž', 'З' => 'Z', 'И' => 'I',
'Ј' => 'J', 'К' => 'K', 'Л' => 'L', 'Љ' => 'Lj', 'М' => 'M',
'Н' => 'N', 'Њ' => 'Nj', 'О' => 'O', 'П' => 'P', 'Р' => 'R',
'С' => 'S', 'Т' => 'T', 'Ћ' => 'Ć', 'У' => 'U', 'Ф' => 'F',
'Х' => 'H', 'Ц' => 'C', 'Ч' => 'Č', 'Џ' => 'Dž', 'Ш' => 'Š',
)

Definition at line 36 of file LanguageSr.php.


The documentation for this class was generated from the following file:
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.