public class TextUtils extends Object
Constructor and Description |
---|
TextUtils() |
Modifier and Type | Method and Description |
---|---|
static Set<String> |
readStopwordsFile(File file,
boolean lowercase)
Read a file containing stopwords (one per line).
|
static Set<String> |
readStopwordsFile(String location,
boolean lowercase)
Read a file containing stopwords (one per line).
|
static Set<String> |
readStopwordsInputStream(InputStream inputStream,
boolean lowercase)
Read an
InputStream containing stopwords (one per line). |
static Set<String> |
readStopwordsPath(Path path,
boolean lowercase)
Read a file containing stopwords (one per line).
|
static Set<String> |
readStopwordsURL(URL url,
boolean lowercase) |
public static Set<String> readStopwordsFile(File file, boolean lowercase) throws IOException
Empty lines and lines starting with ("#") are filtered out.
file
- input filelowercase
- if true, lowercase everythingIOException
- if the file cannot be readpublic static Set<String> readStopwordsFile(String location, boolean lowercase) throws IOException
Empty lines and lines starting with ("#") are filtered out.
location
- input file locationlowercase
- if true, lowercase everythingIOException
- if the file cannot be readpublic static Set<String> readStopwordsInputStream(InputStream inputStream, boolean lowercase)
InputStream
containing stopwords (one per line).
Empty lines and lines starting with ("#") are filtered out.
inputStream
- input streamlowercase
- if true, lowercase everythingpublic static Set<String> readStopwordsPath(Path path, boolean lowercase) throws IOException
Empty lines and lines starting with ("#") are filtered out.
path
- input file Path
lowercase
- if true, lowercase everythingIOException
- if the file cannot be readpublic static Set<String> readStopwordsURL(URL url, boolean lowercase) throws IOException
IOException
Copyright © 2007–2018 Ubiquitous Knowledge Processing (UKP) Lab, Technische Universität Darmstadt. All rights reserved.