function text2words(text) {
const words = text
.split(/[\s.]+/g)
.map((w) => w.replace(/^[“‘"\-—()\[\]{}]+/g, ""))
.map((w) => w.replace(/[;:.!?()\[\]{},"'’”\-—]+$/g, ""))
.map((w) => w.replace(/['’]s$/g, ""))
.map((w) => w.substring(0, 30))
.map((w) => w.toLowerCase())
.filter((w) => w && !stopwords.has(w));
return words;
}