1 | <?php namespace CMSFactory\Services\Morphy; |
||
10 | class Morphy |
||
11 | { |
||
|
|||
12 | |||
13 | /** |
||
14 | * @var array |
||
15 | */ |
||
16 | private $cases = [ |
||
17 | 1 => 'ИМ',//Именительный |
||
18 | 2 => 'РД',//Родительный |
||
19 | 3 => 'ДТ',//Дательный |
||
20 | 4 => 'ВН',//Винительный |
||
21 | 5 => 'ТВ',//Творительный |
||
22 | 6 => 'ПР',//Предложный |
||
23 | ]; |
||
24 | |||
25 | const PLURAL = 'МН'; |
||
26 | const SINGULAR = 'ЕД'; |
||
27 | |||
28 | /** |
||
29 | * method processing meta data |
||
30 | * @var phpMorphy |
||
31 | */ |
||
32 | private $phpMorphy; |
||
33 | |||
34 | private $wordsCache = []; |
||
35 | |||
36 | /** |
||
37 | * Morphy constructor |
||
38 | * @param phpMorphy $phpMorphy |
||
39 | */ |
||
40 | public function __construct(phpMorphy $phpMorphy) { |
||
43 | |||
44 | /** |
||
45 | * @param string $string |
||
46 | * @param int $case |
||
47 | * @return mixed|string |
||
48 | */ |
||
49 | public function morphy($string, $case = 1) { |
||
68 | |||
69 | /** |
||
70 | * @param string $word |
||
71 | * @param string $case |
||
72 | * @return mixed|string |
||
73 | */ |
||
74 | private function morphyWord($word, $case) { |
||
114 | |||
115 | /** |
||
116 | * @param string $string |
||
117 | * @return int |
||
118 | */ |
||
119 | private function getStrCase($string) { |
||
127 | } |