* @param examples
* @return
* @throws Exception
*/
protected Filter getSpellingFilter(ExampleSet examples) throws Exception {
SpellingRegexFilter filter = new SpellingRegexFilter(ExampleSet.MESSAGE_ATTR_NAME);
filter.setCountRegexLengths(COUNT_REGEX_LENGTHS);
filter.setInputFormat(examples.getInstances());
Instances filtered = Filter.useFilter(examples.getInstances(), filter);
examples.setInstances(filtered);
return filter;
}