UNPKG

scure

Version:

Script Creation Utilities for Conversational Adventures (as Ric Escape)

48 lines (45 loc) 655 B
const STOPWORDS = [ 'a', 'about', 'at', 'for', 'from', 'fucking', 'his', 'in', 'is', 'of', 'on', 'the', 'that', 'through', 'your', 'al', 'de', 'desde', 'el', 'en', 'entre', 'hacia', 'la', 'los', 'las', 'maldita', 'mi', 'para', 'por', 'puta', 'que', 'sobre', 'su', 'tu', 'un', 'una', 'esa', 'esta', 'ese', ]; const byNotStopword = word => STOPWORDS.indexOf(word) === -1; const isStopword = word => STOPWORDS.indexOf(word) > -1; const removeStopwords = str => (isStopword(str) ? str : str.split(' ').filter(byNotStopword).join(' ')); exports.removeStopwords = removeStopwords;