-
Notifications
You must be signed in to change notification settings - Fork 0
/
Names.php
207 lines (188 loc) · 4.63 KB
/
Names.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<?php
/*
*/
namespace Tag;
use ArrayObject;
use SplFixedArray;
use SplObjectStorage;
class Name
{
private String $I; // Indentifying
private SplFixedArray $P; // Pairing
private String $K; // Key
private String $W; // Word
private String $V; // Value
private SplFixedArray $S; // Spacing From Left (Head), To P., Right (Body); to a breadth lower than crossing from a breadth more to cross above.
private String $T; // Tag
private String $N; // Name
private String $C; // Content
private SplObjectStorage $ObjectStorage;
public function __construct()
{
}
public function __destruct()
{
}
public function __get(String $Name): mixed
{
}
public function __set(String $Name, Mixed $Value): void
{
}
/*
* strip_tags
* echo strip_tags("Hello <b><i>GeeksforGeeks!</i></b>", "<b>");
* Hello <b>GeeksforGeeks!</b>
*
* string chop($string, $character)
*/
public function Format(bool $prepend = false, bool $append = false)
{
}
/*
* https://www.discogs.com/release/219802-Olex-Doubledouble-Esquilax
* https://music.youtube.com/watch?v=x8f8tbtMW84
* https://www.newsandmoods.com/
* Esquilax (lensquex lesquex)
*
* $AName, $QualifiedName
*/
public function Esquilax(String $AN, ArrayObject $QN, Int $TH = 1, String $UX = Null)
{
$NS = self::Expand($AN, $TH, $UX);
$XN = $NS->getIterator();
$XQ = $QN->getIterator();
$XN->rewind();
do {
list($Tag, $Word) = [$XN->key(), $XN->current()];
do {
list($Key, $Name) = [$XQ->key(), $XQ->current()];
echo "(`{$Tag}`,`{$Word}`) ";
echo "(`{$Key}`,`{$Name}`)\n";
} while ($XQ->next() || $XQ->valid());
$XQ->rewind();
} while ($XN->next() || $XN->valid());
}
public function Reverse(String $A, String $UX = Null)
{
$AUX = mb_strlen($A, $UX);
if ($AUX > 1) {
$A = mb_str_split($A, 1, $UX);
if ($A) {
$A = array_reverse($A);
return join('', $A);
}
}
return false;
}
public static function Factorial(Int $X): Int
{
return $X > 1 ? self::Factorial($X - 1) * $X : $X;
}
/*
* https://music.youtube.com/watch?v=9mMhWUM0KHE
*
* $AName, $TagHeight, $UnionAcross
*/
public function Edify(String $A, Int $TH = 1, String $UX = Null): ArrayObject
{
$AUTHXN = mb_str_split($A, $TH, $UX);
$ANXT = mb_strlen($A, $UX);
$L = $AUTHXN;
$NS = [$A => null];
for ($a = self::Factorial($ANXT), $b = count($NS), $e = $f = 0; $a > $b; $f++) {
for ($d = $ANXT - 1, $c = 0; $c < $d && $d > $c; $c++, $d--) {
do {
$c = rand(0, $ANXT - 1);
$M = max(range($c, 0), range($c, $ANXT - 1));
$d = rand($c, $M[rand(0, count($M) - 1)]);
} while (strcmp($AUTHXN[$d], $AUTHXN[$c]) === 0);
$L = array_replace($L, [
$c => $L[$d],
$d => $L[$c]
]);
$N = join('', $L);
if ($e++) {
$L = array_reverse($L);
$A = join('', $L);
if (!isset($NS[$N])) {
$NS[$N] = $b++;
$e = 0;
break;
}
if (!isset($NS[$A])) {
$NS[$A] = $b++;
}
}
}
if ($a == $b || $e > 1) {
$b = count($NS);
}
}
return new ArrayObject($NS);
}
public static function YieldIs(String $A, Int $TH = 1, String $UX = Null): \Generator
{
$AUTHXN = mb_str_split($A, $TH, $UX);
$ANXT = mb_strlen($A, $UX);
$Count = -1;
foreach ($AUTHXN as $X => $AN) {
yield $AN;
}
//return $AUTHXN;
}
public function Vowels(String $A)
{
foreach (self::YieldIs($A, 1) as $Literal) {
// Return Vowels?
}
}
/*
* Entropic Diffusion of Charset Ranges,
* Into and From a Name;
* Bearing Initialized Titlesets.
* Which shall be Sprouted from Arrays of Semi-Final Esquilax Chain.
*
*/
public function Diffuse(string $A, String $UX = Null, array ...$Range): ArrayObject
{
$Limit = false;
$Ports = [''];
$Ranges = array_merge(range('a', 'z'), range('A', 'Z'), ...$Range);
foreach (self::YieldIs($A, 1, $UX) as $Key => $Literal) {
if (in_array($Literal, $Ranges)) {
$Ports[Count($Ports) - 1] .= $Literal;
} else {
if (is_bool($Limit) == false) {
$Limit = (strcmp($Limit, $Literal) === 0) ? $Literal : true;
} else if ($Limit === false) {
$Limit = $Literal;
}
$Ports[] = $Literal;
$Ports[] = '';
}
}
if (is_bool($Limit) === false) {
$Ports = ["$Limit" => array_diff($Ports, [$Limit])];
}
$Ports = array_map(function ($Element) {
if (!is_array($Element)) {
$Element = [$Element];
}
foreach ($Element as &$A) {
if (ctype_upper($A) || ctype_lower($A)) {
$A = mb_convert_case($A, MB_CASE_TITLE);
}
}
return join('', $Element);
}, $Ports);
return new ArrayObject($Ports);
}
/*
* Here we use objects of an array as a comparitor for roots, prefixes, and suffixes.
*
*/
public function Sprout()
{
}
}