MediaWiki  REL1_22
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:

List of all members.

Public Member Functions

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

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

SrConverter::autoConvert ( text,
toVariant = false 
)

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

Parameters:
$textstring
$toVariantbool
Returns:
string

Reimplemented from LanguageConverter.

Definition at line 140 of file LanguageSr.php.

References $wgTitle, and global.

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

Reimplemented from LanguageConverter.

Definition at line 115 of file LanguageSr.php.

References $link, and LanguageConverter\getPreferredVariant().

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 <[email protected]>
Since:
1.19

Reimplemented from LanguageConverter.

Definition at line 200 of file LanguageSr.php.

Load default conversion tables.

This method must be implemented in derived class.

Access:
private
Exceptions:
MWException

Reimplemented from LanguageConverter.

Definition at line 72 of file LanguageSr.php.

References array().

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.

SrConverter::translate ( text,
toVariant 
)

It translates text into variant, specials:

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

Reimplemented from LanguageConverter.

Definition at line 161 of file LanguageSr.php.

References $matches, $ret, as, and LanguageConverter\loadTables().


Member Data Documentation

SrConverter::$mToCyrillics
Initial value:
 array(
        '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.

SrConverter::$mToLatin
Initial value:
 array(
        'а' => '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: