public class DelimitedTextParser extends Object
| Constructor and Description |
|---|
DelimitedTextParser()
Constructor with default delimiter of white space, comment line
starting with '%', missing value placeholder "?", no column names,
no row names.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getCommentStartWith()
Returns the character/string that starts a comment line.
|
String |
getDelimiter()
Returns the delimiter character/string.
|
String |
getMissingValuePlaceholder()
Returns the missing value placeholder.
|
boolean |
hasColumnNames()
Returns if the dataset has column namesS (at row 0).
|
boolean |
hasRowNames()
Returns if the dataset has row names (at column 0).
|
AttributeDataset |
parse(File file)
Parse a dataset from given file.
|
AttributeDataset |
parse(String path)
Parse a dataset from given file.
|
AttributeDataset |
parse(String name,
Attribute[] attributes,
File file)
Parse a dataset from given file.
|
AttributeDataset |
parse(String name,
Attribute[] attributes,
String path)
Parse a dataset from given file.
|
AttributeDataset |
parse(String name,
Attribute[] attributes,
URI uri)
Parse a dataset from given URI.
|
AttributeDataset |
parse(String name,
InputStream stream)
Parse a dataset from an input stream.
|
AttributeDataset |
parse(URI uri)
Parse a dataset from given URI.
|
void |
setColumnNames(boolean hasColNames)
Set if the dataset has column names (at row 0).
|
void |
setCommentStartWith(String comment)
Set the character/string that starts a comment line.
|
void |
setDelimiter(String delimiter)
Set the delimiter character/string.
|
void |
setMissingValuePlaceholder(String missing)
Set the missing value placeholder.
|
void |
setResponseIndex(Attribute response,
int index)
Sets the attribute and column index (starting at 0) of dependent/response variable.
|
void |
setRowNames(boolean hasRowNames)
Set if the dataset has row names (at column 0).
|
public DelimitedTextParser()
public String getDelimiter()
public void setDelimiter(String delimiter)
public String getCommentStartWith()
public void setCommentStartWith(String comment)
public String getMissingValuePlaceholder()
public void setMissingValuePlaceholder(String missing)
public void setResponseIndex(Attribute response, int index)
public boolean hasRowNames()
public void setRowNames(boolean hasRowNames)
public boolean hasColumnNames()
public void setColumnNames(boolean hasColNames)
public AttributeDataset parse(URI uri) throws FileNotFoundException, IOException, ParseException
public AttributeDataset parse(String name, Attribute[] attributes, URI uri) throws FileNotFoundException, IOException, ParseException
uri - the URI of data source.attributes - the list attributes of data in proper order.FileNotFoundExceptionIOExceptionParseExceptionpublic AttributeDataset parse(String path) throws FileNotFoundException, IOException, ParseException
path - the file path of data source.FileNotFoundExceptionIOExceptionParseExceptionpublic AttributeDataset parse(String name, Attribute[] attributes, String path) throws FileNotFoundException, IOException, ParseException
path - the file path of data source.attributes - the list attributes of data in proper order.FileNotFoundExceptionIOExceptionParseExceptionpublic AttributeDataset parse(File file) throws FileNotFoundException, IOException, ParseException
file - the file of data source.FileNotFoundExceptionIOExceptionParseExceptionpublic AttributeDataset parse(String name, Attribute[] attributes, File file) throws FileNotFoundException, IOException, ParseException
file - the file of data source.attributes - the list attributes of data in proper order.FileNotFoundExceptionIOExceptionParseExceptionpublic AttributeDataset parse(String name, InputStream stream) throws IOException, ParseException
name - the name of dataset.stream - the input stream of data.FileNotFoundExceptionIOExceptionParseExceptionCopyright © 2015. All rights reserved.