-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
restlin
committed
Oct 21, 2020
1 parent
2a2e9da
commit 67a1318
Showing
2 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
* @todo добавить проверки на несуществующий падеж во все функции | ||
* @author Ilia Shumilov <[email protected]> | ||
*/ | ||
class MorphologicHelper | ||
final class MorphologicHelper | ||
{ | ||
|
||
/** | ||
|
@@ -97,7 +97,7 @@ public static function identSexByPatronymic(string $patron) : int | |
* Получить окончания имен | ||
* @return Array | ||
*/ | ||
protected static function nameEnds() : Array | ||
private static function nameEnds() : Array | ||
{ | ||
return [ | ||
self::GENETIVE => ['и', 'и', 'ы', 'я', 'а', 'и'], | ||
|
@@ -112,7 +112,7 @@ protected static function nameEnds() : Array | |
* Получить массив нестандартных имен | ||
* @return Array | ||
*/ | ||
protected static function uniqueNames() : Array | ||
private static function uniqueNames() : Array | ||
{ | ||
return [ | ||
'павел' => 'павл', | ||
|
@@ -174,7 +174,7 @@ public static function patronymicCase(string $patron, int $sex, string $case) : | |
* Получить окончания фамилий | ||
* @return Array | ||
*/ | ||
protected static function surnameEnds() : array | ||
private static function surnameEnds() : array | ||
{ | ||
return [ | ||
self::GENETIVE => ['и', 'ы', '$1я', 'ы', 'ого', 'ца', 'я', 'а', 'ой', 'ы', 'ой', 'и'], | ||
|
@@ -191,7 +191,7 @@ protected static function surnameEnds() : array | |
* @param Array $ends окончания для соответствующего падежа | ||
* @return string | ||
*/ | ||
protected static function surnameMaleCase(string $surname, array $ends) : string | ||
private static function surnameMaleCase(string $surname, array $ends) : string | ||
{ | ||
if (preg_match('/[кгх]а$/ui', $surname)) { | ||
$surname = preg_replace("/.$/ui", $ends[0], $surname); //0 | ||
|
@@ -228,7 +228,7 @@ protected static function surnameMaleCase(string $surname, array $ends) : string | |
* @param Array $ends окончания для соответствующего падежа | ||
* @return string | ||
*/ | ||
protected static function surnameFemaleCase(string $surname, Array $ends) : string | ||
private static function surnameFemaleCase(string $surname, Array $ends) : string | ||
{ | ||
if (preg_match('/[бвгдежзийлкмнпорстуфхцчьшщ]$/ui', $surname)) { | ||
$surname = $surname; | ||
|
@@ -268,7 +268,7 @@ public static function surnameCase(string $surname, int $sex, string $case) : st | |
* получить массив окончаний должностей | ||
* @return array | ||
*/ | ||
protected static function profEnds() : array | ||
private static function profEnds() : array | ||
{ | ||
return [ | ||
self::GENETIVE => ['ого', 'его', 'а', 'я', 'ого'], | ||
|
@@ -315,7 +315,7 @@ public static function profToSimpleForm(string $prof) : string | |
* получить массив окончаний слов | ||
* @return array | ||
*/ | ||
protected static function wordEnds() : array | ||
private static function wordEnds() : array | ||
{ | ||
return [ | ||
self::GENETIVE => ['ого', 'его', 'а', 'я', 'ой', 'и', 'я', 'ка', 'а', 'ы', 'ей', 'и'], | ||
|
@@ -369,14 +369,14 @@ public static function wordCase(string $word, string $case): string | |
return $word; | ||
} | ||
} | ||
protected static function getPathForTmpFile(): string { | ||
private static function getPathForTmpFile(): string { | ||
return sys_get_temp_dir().DIRECTORY_SEPARATOR.'restlin-words.php'; | ||
} | ||
|
||
/** | ||
* Загрузить словарь в $words | ||
*/ | ||
protected static function loadWords() | ||
private static function loadWords() | ||
{ | ||
if (self::$words) { | ||
return true; | ||
|
@@ -447,7 +447,7 @@ public static function getConnectedWords(string $word): array | |
* @param string $word слово | ||
* @return bool | ||
*/ | ||
protected static function isWordMainCase(string $word): bool | ||
private static function isWordMainCase(string $word): bool | ||
{ | ||
$base = str_replace('ё', 'е', mb_strtolower($word, 'utf-8')); | ||
return !self::$words || key_exists($base, self::$words); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,5 @@ | |
"email": "[email protected]" | ||
} | ||
], | ||
"minimum-stability": "dev" | ||
"minimum-stability": "stable" | ||
} |