Séparation compétences/combat

This commit is contained in:
2020-12-08 03:04:00 +01:00
parent 399a7b2d30
commit 468c699f70
7 changed files with 114 additions and 29 deletions

18
module/grammar.js Normal file
View File

@ -0,0 +1,18 @@
const articlesApostrophes = {
'de' : 'd\'',
'le' : 'l\'',
'la' : 'l\''
}
export class Grammar {
static apostrophe(article, word) {
if (articlesApostrophes[article] && Grammar.startsWithVoyel(word)) {
return articlesApostrophes[article] + word
}
return article + ' ' + word;
}
static startsWithVoyel(word) {
return word.match(/^[aeiouy]/i)
}
}