public class csvParser extends AbstractParser implements Parser
Parser.Failure
log, SUPPORTED_EXTENSIONS, SUPPORTED_MIME_TYPES
Constructor and Description |
---|
csvParser() |
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
concatRow(java.lang.String[] columns) |
private static java.util.List<java.lang.String[]> |
getTable(java.lang.String charset,
java.io.InputStream source) |
Document[] |
parse(DigestURL location,
java.lang.String mimeType,
java.lang.String charset,
VocabularyScraper scraper,
int timezoneOffset,
java.io.InputStream source)
parse an input stream
|
private static java.lang.String |
stripQuotes(java.lang.String line,
char quote,
char separator,
char replacement)
remove quotes AND separator characters within the quotes
to make it possible to split the line using the String.split method
|
equals, getName, hashCode, singleList, supportedExtensions, supportedMimeTypes
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
equals, getName, hashCode, supportedExtensions, supportedMimeTypes
public Document[] parse(DigestURL location, java.lang.String mimeType, java.lang.String charset, VocabularyScraper scraper, int timezoneOffset, java.io.InputStream source) throws Parser.Failure, java.lang.InterruptedException
Parser
parse
in interface Parser
location
- the url of the sourcemimeType
- the mime type of the source, if knowncharset
- the charset of the source, if knownscraper
- an entity scraper to detect facets from text annotation contextsource
- a input streamParser.Failure
java.lang.InterruptedException
private static java.lang.String concatRow(java.lang.String[] columns)
private static java.util.List<java.lang.String[]> getTable(java.lang.String charset, java.io.InputStream source)
private static java.lang.String stripQuotes(java.lang.String line, char quote, char separator, char replacement)
line
- quote
- separator
- replacement
-