I used the most voted option and created a function that would clean one array of words using another array of unwanted words:
function cleanArrayOfSpecificTerms(array,unwantedTermsArray) {
$.each(unwantedTermsArray, function( index, value ) {
var index = array.indexOf(value);
if (index > -1) {
array.splice(index, 1);
}
});
return array;
}
To use, do the following:
var notInclude = ['Not','No','First','Last','Prior','Next', 'dogs','cats'];
var splitTerms = ["call", "log", "dogs", "cats", "topic", "change", "pricing"];
cleanArrayOfSpecificTerms(splitTerms,notInclude)