mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-23 15:17:47 +09:00
Update dependencies
This commit is contained in:
@@ -21,7 +21,7 @@ final class EnglishInflector implements InflectorInterface
|
||||
private const PLURAL_MAP = [
|
||||
// First entry: plural suffix, reversed
|
||||
// Second entry: length of plural suffix
|
||||
// Third entry: Whether the suffix may succeed a vocal
|
||||
// Third entry: Whether the suffix may succeed a vowel
|
||||
// Fourth entry: Whether the suffix may succeed a consonant
|
||||
// Fifth entry: singular suffix, normal
|
||||
|
||||
@@ -55,6 +55,9 @@ final class EnglishInflector implements InflectorInterface
|
||||
// indices (index), appendices (appendix), prices (price)
|
||||
['seci', 4, false, true, ['ex', 'ix', 'ice']],
|
||||
|
||||
// codes (code)
|
||||
['sedoc', 5, false, true, 'code'],
|
||||
|
||||
// selfies (selfie)
|
||||
['seifles', 7, true, true, 'selfie'],
|
||||
|
||||
@@ -64,6 +67,9 @@ final class EnglishInflector implements InflectorInterface
|
||||
// movies (movie)
|
||||
['seivom', 6, true, true, 'movie'],
|
||||
|
||||
// names (name)
|
||||
['seman', 5, true, false, 'name'],
|
||||
|
||||
// conspectuses (conspectus), prospectuses (prospectus)
|
||||
['sesutcep', 8, true, true, 'pectus'],
|
||||
|
||||
@@ -88,6 +94,9 @@ final class EnglishInflector implements InflectorInterface
|
||||
// accesses (access), addresses (address), kisses (kiss)
|
||||
['sess', 4, true, false, 'ss'],
|
||||
|
||||
// statuses (status)
|
||||
['sesutats', 8, true, true, 'status'],
|
||||
|
||||
// analyses (analysis), ellipses (ellipsis), fungi (fungus),
|
||||
// neuroses (neurosis), theses (thesis), emphases (emphasis),
|
||||
// oases (oasis), crises (crisis), houses (house), bases (base),
|
||||
@@ -132,6 +141,9 @@ final class EnglishInflector implements InflectorInterface
|
||||
// shoes (shoe)
|
||||
['se', 2, true, true, ['', 'e']],
|
||||
|
||||
// status (status)
|
||||
['sutats', 6, true, true, 'status'],
|
||||
|
||||
// tags (tag)
|
||||
['s', 1, true, true, ''],
|
||||
|
||||
@@ -150,10 +162,13 @@ final class EnglishInflector implements InflectorInterface
|
||||
private const SINGULAR_MAP = [
|
||||
// First entry: singular suffix, reversed
|
||||
// Second entry: length of singular suffix
|
||||
// Third entry: Whether the suffix may succeed a vocal
|
||||
// Third entry: Whether the suffix may succeed a vowel
|
||||
// Fourth entry: Whether the suffix may succeed a consonant
|
||||
// Fifth entry: plural suffix, normal
|
||||
|
||||
// axes (axis)
|
||||
['sixa', 4, false, false, 'axes'],
|
||||
|
||||
// criterion (criteria)
|
||||
['airetirc', 8, false, false, 'criterion'],
|
||||
|
||||
@@ -241,6 +256,9 @@ final class EnglishInflector implements InflectorInterface
|
||||
// seasons (season), treasons (treason), poisons (poison), lessons (lesson)
|
||||
['nos', 3, true, true, 'sons'],
|
||||
|
||||
// icons (icon)
|
||||
['noc', 3, true, true, 'cons'],
|
||||
|
||||
// bacteria (bacterium), criteria (criterion), phenomena (phenomenon)
|
||||
['no', 2, true, true, 'a'],
|
||||
|
||||
@@ -273,6 +291,9 @@ final class EnglishInflector implements InflectorInterface
|
||||
// circuses (circus)
|
||||
['suc', 3, true, true, 'cuses'],
|
||||
|
||||
// status (status)
|
||||
['sutats', 6, true, true, ['status', 'statuses']],
|
||||
|
||||
// conspectuses (conspectus), prospectuses (prospectus)
|
||||
['sutcep', 6, true, true, 'pectuses'],
|
||||
|
||||
@@ -328,15 +349,30 @@ final class EnglishInflector implements InflectorInterface
|
||||
// deer
|
||||
'reed',
|
||||
|
||||
// equipment
|
||||
'tnempiuqe',
|
||||
|
||||
// feedback
|
||||
'kcabdeef',
|
||||
|
||||
// fish
|
||||
'hsif',
|
||||
|
||||
// health
|
||||
'htlaeh',
|
||||
|
||||
// history
|
||||
'yrotsih',
|
||||
|
||||
// info
|
||||
'ofni',
|
||||
|
||||
// information
|
||||
'noitamrofni',
|
||||
|
||||
// money
|
||||
'yenom',
|
||||
|
||||
// moose
|
||||
'esoom',
|
||||
|
||||
@@ -348,11 +384,14 @@ final class EnglishInflector implements InflectorInterface
|
||||
|
||||
// species
|
||||
'seiceps',
|
||||
|
||||
// traffic
|
||||
'ciffart',
|
||||
|
||||
// aircraft
|
||||
'tfarcria',
|
||||
];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function singularize(string $plural): array
|
||||
{
|
||||
$pluralRev = strrev($plural);
|
||||
@@ -384,14 +423,14 @@ final class EnglishInflector implements InflectorInterface
|
||||
if ($j === $suffixLength) {
|
||||
// Is there any character preceding the suffix in the plural string?
|
||||
if ($j < $pluralLength) {
|
||||
$nextIsVocal = false !== strpos('aeiou', $lowerPluralRev[$j]);
|
||||
$nextIsVowel = str_contains('aeiou', $lowerPluralRev[$j]);
|
||||
|
||||
if (!$map[2] && $nextIsVocal) {
|
||||
// suffix may not succeed a vocal but next char is one
|
||||
if (!$map[2] && $nextIsVowel) {
|
||||
// suffix may not succeed a vowel but next char is one
|
||||
break;
|
||||
}
|
||||
|
||||
if (!$map[3] && !$nextIsVocal) {
|
||||
if (!$map[3] && !$nextIsVowel) {
|
||||
// suffix may not succeed a consonant but next char is one
|
||||
break;
|
||||
}
|
||||
@@ -429,9 +468,6 @@ final class EnglishInflector implements InflectorInterface
|
||||
return [$plural];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function pluralize(string $singular): array
|
||||
{
|
||||
$singularRev = strrev($singular);
|
||||
@@ -464,14 +500,14 @@ final class EnglishInflector implements InflectorInterface
|
||||
if ($j === $suffixLength) {
|
||||
// Is there any character preceding the suffix in the plural string?
|
||||
if ($j < $singularLength) {
|
||||
$nextIsVocal = false !== strpos('aeiou', $lowerSingularRev[$j]);
|
||||
$nextIsVowel = str_contains('aeiou', $lowerSingularRev[$j]);
|
||||
|
||||
if (!$map[2] && $nextIsVocal) {
|
||||
// suffix may not succeed a vocal but next char is one
|
||||
if (!$map[2] && $nextIsVowel) {
|
||||
// suffix may not succeed a vowel but next char is one
|
||||
break;
|
||||
}
|
||||
|
||||
if (!$map[3] && !$nextIsVocal) {
|
||||
if (!$map[3] && !$nextIsVowel) {
|
||||
// suffix may not succeed a consonant but next char is one
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -110,9 +110,6 @@ final class FrenchInflector implements InflectorInterface
|
||||
*/
|
||||
private const UNINFLECTED = '/^(abcès|accès|abus|albatros|anchois|anglais|autobus|bois|brebis|carquois|cas|chas|colis|concours|corps|cours|cyprès|décès|devis|discours|dos|embarras|engrais|entrelacs|excès|fils|fois|gâchis|gars|glas|héros|intrus|jars|jus|kermès|lacis|legs|lilas|marais|mars|matelas|mépris|mets|mois|mors|obus|os|palais|paradis|parcours|pardessus|pays|plusieurs|poids|pois|pouls|printemps|processus|progrès|puits|pus|rabais|radis|recors|recours|refus|relais|remords|remous|rictus|rhinocéros|repas|rubis|sans|sas|secours|sens|souris|succès|talus|tapis|tas|taudis|temps|tiers|univers|velours|verglas|vernis|virus)$/i';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function singularize(string $plural): array
|
||||
{
|
||||
if ($this->isInflectedWord($plural)) {
|
||||
@@ -130,9 +127,6 @@ final class FrenchInflector implements InflectorInterface
|
||||
return [$plural];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function pluralize(string $singular): array
|
||||
{
|
||||
if ($this->isInflectedWord($singular)) {
|
||||
|
||||
Reference in New Issue
Block a user