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) {
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue