filter.setDoNotOperateOnPerClassBasis(true);
filter.setWordsToKeep(3000);
filter.setLowerCaseTokens(true);
//use stemming and remove "nonsense"
filter.setStemmer(new NoNonsenseStemmer(true));
filter.setTFTransform(true);
filter.setIDFTransform(true);
filter.setNormalizeDocLength(new SelectedTag(StringToWordVector.FILTER_NORMALIZE_ALL, StringToWordVector.TAGS_FILTER));