# RussianTextUtils Class Reference
[Various accompanying utilities]

Inheritance diagram for RussianTextUtils:
[legend]

List of all members.

## Static Public Member Functions

static | selectCaseForNumber ($number, $cases)
| Selects russian case for number.
static | getMonthInGenitiveCase ($month)
| doesn't duplicate strftime('B', ...) only when 'russian' locale set in windoze
static | getMonthByGenitiveCase ($string)
static | getMonthInSubjectiveCase ($month)
static | getDayOfWeek ($day, $full=false)
static | getDateAsText (Timestamp $date, $todayWordNeed=true)
static | friendlyFileSize ($size, $precision=2)
static | getHumanDay (Date $date, $wordDayNeed=true)
static | toTranslit ($sourceString)
static | toRussian ($sourceString)
static | detectEncoding ($data)
| based on CPAN's Lingua::DetectCharset.
static | isAmbiguousDetection ()

## Public Attributes

const | MALE = 0
const | FEMALE = 1
const | NEUTRAL = 2

## Static Private Attributes

static | $orderedSuffixes
static | $orderedDigits
static | $bytePrefixes
static | $lettersMapping
static | $monthInGenitiveCase
static | $flippedLettersMapping = array()
static | $ambiguousDetection = false

## Detailed Description

Definition at line 15 of file RussianTextUtils.class.php.

## Member Function Documentation

static RussianTextUtils::detectEncoding | ( | $ | data | ) | `[static]`

based on CPAN's Lingua::DetectCharset.

Thanks to John Neystadt, http://www.neystadt.org/john/

Definition at line 233 of file RussianTextUtils.class.php.

References CyrillicPairs::getTable().

Here is the call graph for this function:

static RussianTextUtils::friendlyFileSize | ( | $ | size,
|  | $ | precision = `2` |
| ) |  |  | `[static]`

Definition at line 184 of file RussianTextUtils.class.php.

References selectCaseForNumber().

Here is the call graph for this function:

static RussianTextUtils::getDateAsText | ( | Timestamp $ | date,
|  | $ | todayWordNeed = `true` |
| ) |  |  | `[static]`

Definition at line 155 of file RussianTextUtils.class.php.

References Date::compare(), Timestamp::makeToday(), and Date::toStamp().

Here is the call graph for this function:

static RussianTextUtils::getDayOfWeek | ( | $ | day,
|  | $ | full = `false` |
| ) |  |  | `[static]`

Definition at line 137 of file RussianTextUtils.class.php.

static RussianTextUtils::getHumanDay | ( | Date $ | date,
|  | $ | wordDayNeed = `true` |
| ) |  |  | `[static]`

Definition at line 197 of file RussianTextUtils.class.php.

References Date::getDay(), Date::getMonth(), getMonthInGenitiveCase(), Date::makeToday(), and Date::toDate().

Here is the call graph for this function:

static RussianTextUtils::getMonthByGenitiveCase | ( | $ | string | ) | `[static]`

Definition at line 113 of file RussianTextUtils.class.php.

static RussianTextUtils::getMonthInGenitiveCase | ( | $ | month | ) | `[static]`

doesn't duplicate strftime('B', ...) only when 'russian' locale set in windoze

Definition at line 108 of file RussianTextUtils.class.php.

Referenced by getHumanDay().

static RussianTextUtils::getMonthInSubjectiveCase | ( | $ | month | ) | `[static]`

Definition at line 126 of file RussianTextUtils.class.php.

static RussianTextUtils::isAmbiguousDetection | ( |  | ) | `[static]`

Definition at line 326 of file RussianTextUtils.class.php.

static RussianTextUtils::selectCaseForNumber | ( | $ | number,
|  | $ | cases |
| ) |  |  | `[static]`

Selects russian case for number.

for example: 1 результат 2 результата 5 результатов

Parameters:

  | $number | integer
  | $cases | words to select from array('результат', 'результата', 'результатов')

Definition at line 85 of file RussianTextUtils.class.php.

Referenced by friendlyFileSize().

static RussianTextUtils::toRussian | ( | $ | sourceString | ) | `[static]`

Definition at line 220 of file RussianTextUtils.class.php.

static RussianTextUtils::toTranslit | ( | $ | sourceString | ) | `[static]`

Definition at line 215 of file RussianTextUtils.class.php.

## Member Data Documentation

RussianTextUtils::$ambiguousDetection = false`[static, private]`

Definition at line 74 of file RussianTextUtils.class.php.

RussianTextUtils::$bytePrefixes`[static, private]`

Initial value:

     array(
                null, 'К', 'М', 'Г', 'Т', 'П'
            )

Definition at line 40 of file RussianTextUtils.class.php.

RussianTextUtils::$flippedLettersMapping = array()`[static, private]`

Definition at line 72 of file RussianTextUtils.class.php.

RussianTextUtils::$lettersMapping`[static, private]`

Initial value:

     array(
                'а' => 'a',        'б' => 'b',        'в' => 'v',        'г' => 'g',
                'д' => 'd',        'е' => 'e',        'ё' => 'jo',   'ж' => 'zh',
                'з' => 'z',        'и' => 'i',        'й' => 'jj',   'к' => 'k',
                'л' => 'l',        'м' => 'm',        'н' => 'n',        'о' => 'o',
                'п' => 'p',        'р' => 'r',        'с' => 's',        'т' => 't',
                'у' => 'u',        'ф' => 'f',        'х' => 'kh',   'ц' => 'c',
                'ч' => 'ch',   'ш' => 'sh',   'щ' => 'shh',  'ъ' => '\'',
                'ы' => 'y',        'ь' => '\'',   'э' => 'eh',   'ю' => 'ju',
                'я' => 'ja',

                'А' => 'A',        'Б' => 'B',        'В' => 'V',        'Г' => 'G',
                'Д' => 'D',    'Е' => 'E',        'Ё' => 'JO',   'Ж' => 'ZH',
                'З' => 'Z',        'И' => 'I',        'Й' => 'JJ',   'К' => 'K',
                'Л' => 'L',        'М' => 'M',        'Н' => 'N',        'О' => 'O',
                'П' => 'P',        'Р' => 'R',        'С' => 'S',        'Т' => 'T',
                'У' => 'U',        'Ф' => 'F',        'Х' => 'KH',   'Ц' => 'C',
                'Ч' => 'CH',   'Ш' => 'SH',   'Щ' => 'SHH',  'Ъ' => '\'',
                'Ы' => 'Y',        'Ь' => '\'',   'Э' => 'EH',   'Ю' => 'JU',
                'Я' => 'JA'
            )

Definition at line 44 of file RussianTextUtils.class.php.

RussianTextUtils::$monthInGenitiveCase`[static, private]`

Initial value:

     array(
                'января', 'февраля', 'марта', 'апреля',
                'мая', 'июня', 'июля', 'августа', 'сентября',
                'октября', 'ноября', 'декабря'
            )

Definition at line 66 of file RussianTextUtils.class.php.

RussianTextUtils::$orderedDigits`[static, private]`

Initial value:

     array(
                'перв',
                'втор',
                'трет',
                'четвёрт',
                'пят',
                'шест',
                'седьм',
                'восьм',
                'девят',
                'десят'
            )

Definition at line 27 of file RussianTextUtils.class.php.

RussianTextUtils::$orderedSuffixes`[static, private]`

Initial value:

     array(
                self::MALE      => array('ый', 'ой', 'ий'),
                self::FEMALE    => array('ая', 'ья', null),
                self::NEUTRAL   => array('ое', 'ье', null)
            )

Definition at line 21 of file RussianTextUtils.class.php.

const RussianTextUtils::FEMALE = 1

Definition at line 18 of file RussianTextUtils.class.php.

const RussianTextUtils::MALE = 0

Definition at line 17 of file RussianTextUtils.class.php.

const RussianTextUtils::NEUTRAL = 2

Definition at line 19 of file RussianTextUtils.class.php.

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

- main/Utils/RussianTextUtils.class.php