diff --git a/scripts/add_course_images.js b/scripts/add_course_images.js index 9914c7e..f5f7acb 100644 --- a/scripts/add_course_images.js +++ b/scripts/add_course_images.js @@ -226,15 +226,23 @@ function extractKeywords(moduleName) { // remove banned words const bannedWords = [ - "Semester", "Full", "Year", + "semester", "full", "year", "and", "or", "the", "of", "in", "to", "for", "with", "on", "at", "from", - "First", "Second", "Third", "Fourth", "Fifth", - "I", "II", "III", "IV", "V", + "first", "second", "third", "fourth", "fifth", + "i", "ii", "iii", "iv", "v", + "-", "‐", "‒", "–", "—", "―", "−", ]; words = words.filter((word) => !bannedWords.includes(word)); + if (words.length > 2) { + const bannedWords = [ + "introduction", "foundations", "principles", "understanding", + ]; + words = words.filter((word) => !bannedWords.includes(word)); + } + // limit to the first 4 words - words = words.slice(0, 4); + words = words.slice(0, 2); return words.join(" "); }