Fix /astro avec ou sans accents

This commit is contained in:
Vincent Vandemeulebrouck
2021-01-26 19:47:18 +01:00
parent 99183be4cb
commit 8db6313574
4 changed files with 20 additions and 7 deletions

View File

@ -12,7 +12,12 @@ export class Grammar {
}
return article + ' ' + word;
}
static startsWithVoyel(word) {
return word.match(/^[aeiouy]/i)
}
static toLowerCaseNoAccent(words) {
return words?.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "") ?? words;
}
}