@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | require dirname(dirname(__FILE__)).'/vendor/autoload.php'; |
3 | -use morphos\Gender; |
|
4 | -use morphos\Russian\CardinalNumeral; |
|
5 | -use morphos\Russian\Cases; |
|
6 | -use morphos\Russian\GeneralDeclension; |
|
7 | -use morphos\Russian\GeographicalNamesDeclension; |
|
8 | -use morphos\Russian\Plurality; |
|
3 | +use morphos\Gender; |
|
4 | +use morphos\Russian\CardinalNumeral; |
|
5 | +use morphos\Russian\Cases; |
|
6 | +use morphos\Russian\GeneralDeclension; |
|
7 | +use morphos\Russian\GeographicalNamesDeclension; |
|
8 | +use morphos\Russian\Plurality; |
|
9 | 9 | use morphos\Russian\OrdinalNumeral; |
10 | 10 | |
11 | 11 | function safe_string($string) { |
@@ -131,6 +131,9 @@ discard block |
||
131 | 131 | } |
132 | 132 | } |
133 | 133 | |
134 | + /** |
|
135 | + * @param string|false $word |
|
136 | + */ |
|
134 | 137 | static public function declinateFirstDeclension($word) { |
135 | 138 | $word = S::lower($word); |
136 | 139 | $prefix = S::slice($word, 0, -1); |
@@ -166,6 +169,9 @@ discard block |
||
166 | 169 | return $forms; |
167 | 170 | } |
168 | 171 | |
172 | + /** |
|
173 | + * @param string|false $word |
|
174 | + */ |
|
169 | 175 | static public function declinateSecondDeclension($word, $animateness = false) { |
170 | 176 | $word = S::lower($word); |
171 | 177 | $last = S::slice($word, -1); |
@@ -210,6 +216,9 @@ discard block |
||
210 | 216 | return $forms; |
211 | 217 | } |
212 | 218 | |
219 | + /** |
|
220 | + * @param string|false $word |
|
221 | + */ |
|
213 | 222 | static public function declinateThirdDeclension($word) { |
214 | 223 | $word = S::lower($word); |
215 | 224 | $prefix = S::slice($word, 0, -1); |
@@ -225,6 +234,8 @@ discard block |
||
225 | 234 | |
226 | 235 | /** |
227 | 236 | * Rules are from http://rusgram.narod.ru/1216-1231.html |
237 | + * @param string|false $word |
|
238 | + * @param boolean $animateness |
|
228 | 239 | */ |
229 | 240 | static public function declinateAdjective($word, $animateness) { |
230 | 241 | $prefix = S::slice($word, 0, -2); |
@@ -285,6 +296,9 @@ discard block |
||
285 | 296 | return $forms[$case]; |
286 | 297 | } |
287 | 298 | |
299 | + /** |
|
300 | + * @param string|false $last |
|
301 | + */ |
|
288 | 302 | static public function getPrefixOfSecondDeclension($word, $last) { |
289 | 303 | // слова с бегающей гласной в корне |
290 | 304 | if (in_array($word, self::$masculineWithSoftAndRunAwayVowels)) |
@@ -306,6 +320,10 @@ discard block |
||
306 | 320 | return $forms[Cases::IMENIT]; |
307 | 321 | } |
308 | 322 | |
323 | + /** |
|
324 | + * @param string|false $word |
|
325 | + * @param string|false $last |
|
326 | + */ |
|
309 | 327 | static public function getPredCaseOf12Declensions($word, $last, $prefix) { |
310 | 328 | if (in_array(S::slice($word, -2), array('ий', 'ие'))) { |
311 | 329 | if ($last == 'ё') |
@@ -94,6 +94,10 @@ discard block |
||
94 | 94 | return self::declinateSubstative($word, $animateness); |
95 | 95 | } |
96 | 96 | |
97 | + /** |
|
98 | + * @param string|false $word |
|
99 | + * @param boolean $animateness |
|
100 | + */ |
|
97 | 101 | static protected function declinateSubstative($word, $animateness) { |
98 | 102 | $prefix = S::slice($word, 0, -1); |
99 | 103 | $last = S::slice($word, -1); |
@@ -172,6 +176,8 @@ discard block |
||
172 | 176 | |
173 | 177 | /** |
174 | 178 | * Rules are from http://rusgram.narod.ru/1216-1231.html |
179 | + * @param string|false $word |
|
180 | + * @param boolean $animateness |
|
175 | 181 | */ |
176 | 182 | static protected function declinateAdjective($word, $animateness) { |
177 | 183 | $prefix = S::slice($word, 0, -2); |