List of usage examples for weka.core Stopwords elements
public Enumeration<String> elements()
From source file:etc.aloe.filters.WordFeaturesExtractor.java
License:Open Source License
private HashSet<String> prepareStopwords() { // initialize stopwords Stopwords stops = new Stopwords(); if (getStopList() != null) { try {//from w w w . ja v a 2s . c o m if (getStopList().exists() && !getStopList().isDirectory()) { stops.read(getStopList()); } } catch (Exception e) { e.printStackTrace(); } } HashSet<String> result = new HashSet<String>(); Enumeration<String> words = (Enumeration<String>) stops.elements(); while (words.hasMoreElements()) { result.add(words.nextElement()); } return result; }