- java.lang.Object
-
- com.pervasive.datarush.operators.io.textfile.ARFFAnalyzer
-
public class ARFFAnalyzer extends Object
An analyzer for ARFF files. The file is read up to the first data record to provide information about the contents. The following information is provided as a result of analyzing a file:- The relation described in the file.
- Any comments prior to the data section of the file.
- The schema of data records contained in the file and their representation mode.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ARFFAnalyzer.Analysis
Contains the results of analyzing an ARFF file.
-
Constructor Summary
Constructors Constructor Description ARFFAnalyzer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ARFFAnalyzer.Analysis
analyze(Path file, CharsetEncoding encoding)
Analyze the specified ARFF file expecting the described character set encoding.ARFFAnalyzer.Analysis
analyze(Path file, CharsetEncoding encoding, FileClient client)
Analyze the specified ARFF file expecting the described character set encoding.ARFFAnalyzer.Analysis
analyze(Reader input)
Analyze the given character stream as ARFF data.ARFFAnalyzer.Analysis
analyze(String file, CharsetEncoding encoding)
Analyze the specified ARFF file expecting the described character set encoding.
-
-
-
Method Detail
-
analyze
public ARFFAnalyzer.Analysis analyze(String file, CharsetEncoding encoding) throws IOException, ParseException
Analyze the specified ARFF file expecting the described character set encoding.- Parameters:
file
- the file to analyze. This value will be interpreted usingPaths.asPath(String)
.encoding
- a specification of the character set encoding of the file- Returns:
- the resulting analysis
- Throws:
IOException
- if any I/O errors occur while reading the source fileParseException
- if the file cannot be parsed as ARFF or is otherwise malformed
-
analyze
public ARFFAnalyzer.Analysis analyze(Path file, CharsetEncoding encoding) throws IOException, ParseException
Analyze the specified ARFF file expecting the described character set encoding.- Parameters:
file
- the file to analyzeencoding
- a specification of the character set encoding of the file- Returns:
- the resulting analysis
- Throws:
IOException
- if any I/O errors occur while reading the source fileParseException
- if the file cannot be parsed as ARFF or is otherwise malformed
-
analyze
public ARFFAnalyzer.Analysis analyze(Path file, CharsetEncoding encoding, FileClient client) throws IOException, ParseException
Analyze the specified ARFF file expecting the described character set encoding.- Parameters:
file
- the file to analyzeencoding
- a specification of the character set encoding of the fileclient
- the authorization context to use for accessing the file- Returns:
- the resulting analysis
- Throws:
IOException
- if any I/O errors occur while reading the source fileParseException
- if the file cannot be parsed as ARFF or is otherwise malformed
-
analyze
public ARFFAnalyzer.Analysis analyze(Reader input) throws IOException, ParseException
Analyze the given character stream as ARFF data.- Parameters:
input
- the data stream to analyze- Returns:
- the resulting analysis of the input
- Throws:
IOException
- if any I/O errors occur while reading the source fileParseException
- if the file cannot be parsed as ARFF or is otherwise malformed
-
-