Implementing auto-capitalization for conjugation, fixes #16

This commit is contained in:
Jean Viscogliosi-Pate 2024-12-27 07:12:39 -08:00
parent af6c3b8efa
commit dec8ea8c74
1 changed files with 2 additions and 1 deletions

View File

@ -234,7 +234,7 @@ function verbMethod(node, regexp, options) {
let match = node.nodeValue.match(regexp); let match = node.nodeValue.match(regexp);
if (match == null) { return; } if (match == null) { return; }
const verb = match[1]; const verb = match[1];
const tense = match[2]; const tense = match[2].toUpperCase().replaceAll(" ", "_");
const replace_value = verbsHelper.getConjugation(null, verb, tense, getPovIndex(options)); const replace_value = verbsHelper.getConjugation(null, verb, tense, getPovIndex(options));
node.nodeValue = node.nodeValue.replace(regexp, replace_value); node.nodeValue = node.nodeValue.replace(regexp, replace_value);
verbMethod(node, regexp, options); verbMethod(node, regexp, options);
@ -254,6 +254,7 @@ function pluralThirdVerbMethod(node, regexp, options) {
verb = match[5]; verb = match[5];
tense = match[6]; tense = match[6];
} }
tense = tense.toUpperCase().replaceAll(" ", "_");
const replace_verb = verbsHelper.getConjugation(null, verb, tense, 2); const replace_verb = verbsHelper.getConjugation(null, verb, tense, 2);
let replace_value; let replace_value;
if (wasBefore) { if (wasBefore) {