Skip to content

Commit f7d2a25

Browse files
committed
Add a functionality to remove regular verb conjugation forms information
1 parent 8af648c commit f7d2a25

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

main.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ const endingCharacter = "\n";
44
const hidingWordsFromDefinition = true;
55
const blank = "______";
66
const removingDotInformation = true; // Dot information: definitions starting with "•" symbol in dictionary.
7-
const removingComparativeAndSuperlativeInformation = true;
7+
const removingRegularVerbConjugationFormsInformation = true;
8+
const removingComparativeAndSuperlativeFormsInformation = true;
89
const removingPluralFormInformation = true;
910
const htmlFormatting = true; // Italicize and change font color of example sentences.
1011
const exampleSentencesFontColor = "darkgrey"; // Put desired html color name here.
@@ -78,8 +79,11 @@ const pruneText = (word, text) => {
7879
if (removingDotInformation === true) {
7980
text = removeDotInformation(text);
8081
}
81-
if (removingComparativeAndSuperlativeInformation === true) {
82-
text = removeComparativeAndSuperlativeInformation(word, text);
82+
if (removingRegularVerbConjugationFormsInformation === true) {
83+
text = removeRegularVerbConjugationFormsInformation(word, text)
84+
}
85+
if (removingComparativeAndSuperlativeFormsInformation === true) {
86+
text = removeComparativeAndSuperlativeFormsInformation(word, text);
8387
}
8488
if (removingPluralFormInformation === true) {
8589
text = removePluralFormInformation(word, text);
@@ -121,7 +125,14 @@ const removeDotInformation = (text) => {
121125
return text;
122126
}
123127

124-
const removeComparativeAndSuperlativeInformation = (word, text) => {
128+
const removeRegularVerbConjugationFormsInformation = (word, text) => {
129+
const lastCharacterRemovedWord = word.substring(0, word.length - 1);
130+
const target = " (" + lastCharacterRemovedWord + "ies, " + word + "ing, " + lastCharacterRemovedWord + "ied)"
131+
text = text.replace(target, "")
132+
return text
133+
}
134+
135+
const removeComparativeAndSuperlativeFormsInformation = (word, text) => {
125136
const lastCharacterRemovedWord = word.substring(0, word.length - 1);
126137
const target1 = " (" + word + "r, " + word + "st)"
127138
const target2 = " (" + word + "er, " + word + "est)"

0 commit comments

Comments
 (0)