0
0
Fork 0

Improve spacing algorithm

This commit is contained in:
Oliver-Akins 2023-01-19 12:47:56 -06:00
parent be44da10a6
commit 4281ff7a2f

View file

@ -34,12 +34,10 @@ export function anonymizePhrase(phrase: string) {
export function spacePhrase(phrase: string) {
let spaced = ``;
for (const letter of phrase) {
if (letter.match(/[A-Za-z]/)) {
spaced += `${letter} `;
} else if (letter == ` `) {
if (letter == ` `) {
spaced += ``;
} else {
spaced += letter;
spaced += `${letter} `;
};
};
return spaced;