ru_ru.php 1.29 KB
Newer Older
Яков's avatar
first  
Яков committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
class phpMorphy_GrammemsProvider_ru_RU extends phpMorphy_GrammemsProvider_ForFactory {
    static protected $self_encoding = 'windows-1251';
    static protected $instances = array();

    static protected $grammems_map = array( 
        '' => array('', '', ''), 
        '' => array('', ''), 
        '' => array('', ''), 
        '' => array('', '', '', '', '', '', '', '2'), 
        '' => array('', ''), 
        '' => array('', '', ''), 
        ' ' => array(''), 
        '' => array('1', '2', '3'), 
        '' => array(''), 
        ' ' => array(''), 
        ' ' => array(''),
        '' => array('', ''),
        '' => array('', ''),
        ' ' => array(''),
    ); 

    function getSelfEncoding() {
        return 'windows-1251';
    }

    function getGrammemsMap() {
        return self::$grammems_map;
    }

    static function instance(phpMorphy $morphy) {
        $key = $morphy->getEncoding();

        if(!isset(self::$instances[$key])) {
            $class = __CLASS__;
            self::$instances[$key] = new $class($key);
        }

        return self::$instances[$key];
    }
}