Skip to content
Extraits de code Groupes Projets
Valider 90112d8c rédigé par Adrien NUNES's avatar Adrien NUNES
Parcourir les fichiers

<want> small fix

parent 72ae69c7
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -14,17 +14,12 @@ class InformeMoi{
fillAllRandomObject(sentence, regularExpr, randomMethode){
const matches = sentence.matchAll(regularExpr);
const size = matches.length;
let objectString = "";
let newSentence = sentence;
for(let match of matches){
objectString = randomMethode();
newSentence = newSentence.replace(match, objectString);
}
if(size === 1 && regularExpr === this.actorRE){
const want = objectString.startsWith("Les ") ? "veulent" : "veut";
newSentence = newSentence.remplace(match, want );
}
return newSentence;
}
......@@ -37,7 +32,7 @@ class InformeMoi{
sentence = this.fillAllRandomObject(sentence, this.reasonRE, complotDB.getRandomReason.bind(complotDB));
sentence = this.fillAllRandomObject(sentence, this.sourceRE, complotDB.getRandomSource.bind(complotDB));
sentence.replaceAll(this.wantRE, 'veut'); /**Todo, change */
sentence = sentence.replaceAll(this.wantRE, 'veut'); /**Todo, change */
return sentence;
}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter