Class 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.
    • Constructor Detail

      • ARFFAnalyzer

        public ARFFAnalyzer()
    • 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 using Paths.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 file
        ParseException - 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 analyze
        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 file
        ParseException - 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 analyze
        encoding - a specification of the character set encoding of the file
        client - 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 file
        ParseException - 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 file
        ParseException - if the file cannot be parsed as ARFF or is otherwise malformed