Skip to content

Commit

Permalink
more accurate character replacement for wordcloud words, tested with …
Browse files Browse the repository at this point in the history
…other languages
  • Loading branch information
AlecM33 committed Nov 13, 2024
1 parent 1726a9f commit 9e9a64e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions modules/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ module.exports = {
const wordsWithOccurrences = [];
for (const quote of quotesForCloud) {
const words = quote.quotation
.replace(/[^\p{L}0-9'’\/-]/gu, ' ')
.split(' ')
.filter((word) => word.length > 0 && !STOP_WORDS.includes(word.toLowerCase()));
for (const word of words) {
Expand Down

0 comments on commit 9e9a64e

Please sign in to comment.