@@ -68,6 +68,9 @@ discard block |
||
| 68 | 68 | return true; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | + /** |
|
| 72 | + * @param string|false $word |
|
| 73 | + */ |
|
| 71 | 74 | static public function getDeclension($word) { |
| 72 | 75 | $word = S::lower($word); |
| 73 | 76 | $last = S::slice($word, -1); |
@@ -119,6 +122,9 @@ discard block |
||
| 119 | 122 | } |
| 120 | 123 | } |
| 121 | 124 | |
| 125 | + /** |
|
| 126 | + * @param string|false $word |
|
| 127 | + */ |
|
| 122 | 128 | static public function declinateFirstDeclension($word) { |
| 123 | 129 | $word = S::lower($word); |
| 124 | 130 | $prefix = S::slice($word, 0, -1); |
@@ -154,6 +160,9 @@ discard block |
||
| 154 | 160 | return $forms; |
| 155 | 161 | } |
| 156 | 162 | |
| 163 | + /** |
|
| 164 | + * @param string|false $word |
|
| 165 | + */ |
|
| 157 | 166 | static public function declinateSecondDeclension($word, $animateness = false) { |
| 158 | 167 | $word = S::lower($word); |
| 159 | 168 | $last = S::slice($word, -1); |
@@ -198,6 +207,9 @@ discard block |
||
| 198 | 207 | return $forms; |
| 199 | 208 | } |
| 200 | 209 | |
| 210 | + /** |
|
| 211 | + * @param string|false $word |
|
| 212 | + */ |
|
| 201 | 213 | static public function declinateThirdDeclension($word) { |
| 202 | 214 | $word = S::lower($word); |
| 203 | 215 | $prefix = S::slice($word, 0, -1); |
@@ -217,6 +229,10 @@ discard block |
||
| 217 | 229 | return $forms[$case]; |
| 218 | 230 | } |
| 219 | 231 | |
| 232 | + /** |
|
| 233 | + * @param string|false $word |
|
| 234 | + * @param string|false $last |
|
| 235 | + */ |
|
| 220 | 236 | static public function getPrefixOfFirstDeclension($word, $last) { |
| 221 | 237 | if ($word == 'день') |
| 222 | 238 | $prefix = 'дн'; |
@@ -227,6 +243,9 @@ discard block |
||
| 227 | 243 | return $prefix; |
| 228 | 244 | } |
| 229 | 245 | |
| 246 | + /** |
|
| 247 | + * @param boolean $animate |
|
| 248 | + */ |
|
| 230 | 249 | static public function getVinitCaseByAnimateness(array $forms, $animate) { |
| 231 | 250 | if ($animate) |
| 232 | 251 | return $forms[Cases::RODIT]; |
@@ -234,6 +253,10 @@ discard block |
||
| 234 | 253 | return $forms[Cases::IMENIT]; |
| 235 | 254 | } |
| 236 | 255 | |
| 256 | + /** |
|
| 257 | + * @param string|false $word |
|
| 258 | + * @param string|false $last |
|
| 259 | + */ |
|
| 237 | 260 | static public function getPredCaseOf12Declensions($word, $last, $prefix) { |
| 238 | 261 | if (S::slice($word, -2) == 'ий') { |
| 239 | 262 | if ($last == 'ё') |
@@ -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) {
|