Improve spacing algorithm
This commit is contained in:
parent
be44da10a6
commit
4281ff7a2f
1 changed files with 2 additions and 4 deletions
|
|
@ -34,12 +34,10 @@ export function anonymizePhrase(phrase: string) {
|
||||||
export function spacePhrase(phrase: string) {
|
export function spacePhrase(phrase: string) {
|
||||||
let spaced = ``;
|
let spaced = ``;
|
||||||
for (const letter of phrase) {
|
for (const letter of phrase) {
|
||||||
if (letter.match(/[A-Za-z]/)) {
|
if (letter == ` `) {
|
||||||
spaced += `${letter} `;
|
|
||||||
} else if (letter == ` `) {
|
|
||||||
spaced += `█ `;
|
spaced += `█ `;
|
||||||
} else {
|
} else {
|
||||||
spaced += letter;
|
spaced += `${letter} `;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
return spaced;
|
return spaced;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue