forked from public/foundryvtt-reve-de-dragon
Séparation compétences/combat
This commit is contained in:
18
module/grammar.js
Normal file
18
module/grammar.js
Normal 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)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user