
org.deeplearning4j.stopwords.StopWords Maven / Gradle / Ivy
The newest version!
package org.deeplearning4j.stopwords;
import java.io.IOException;
import java.util.List;
import org.apache.commons.io.IOUtils;
import org.springframework.core.io.ClassPathResource;
/**
* Loads stop words from the class path
* @author Adam Gibson
*
*/
public class StopWords {
private static List stopWords;
@SuppressWarnings("unchecked")
public static List getStopWords() {
try {
if(stopWords == null)
stopWords = IOUtils.readLines(new ClassPathResource("/stopwords").getInputStream());
} catch (IOException e) {
throw new RuntimeException(e);
}
return stopWords;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy