weka.core.converters
Class ClassTreeArffFileParser

java.lang.Object
  extended byweka.core.converters.AbstractClassHierarchyParser
      extended byweka.core.converters.ClassTreeParser
          extended byweka.core.converters.ClassTreeFileParser
              extended byweka.core.converters.ClassTreeArffFileParser
All Implemented Interfaces:
ClassHierarchyParser, java.io.Serializable

public class ClassTreeArffFileParser
extends ClassTreeFileParser

Works as a ClassTreeFileParser, but expects the file to be of arff-format and to contain a comment-line providing as keyword "@hierarchy" followed by a hierarchy-string suitable for ClassTreeParser.setEncodedHierarchy(String encodedHierarchy). Thus the line should present three space separated tokens: the comment-symbol, the key-word, the encoded hierarchy.

Author:
Arthur Zimek
See Also:
Serialized Form

Field Summary
static java.lang.String HIERARCHY
           
static java.util.regex.Pattern SPACE
           
 
Fields inherited from class weka.core.converters.ClassTreeFileParser
 
Fields inherited from class weka.core.converters.ClassTreeParser
ILLEGAL_ARGUMENT, LEFT, RIGHT, SEPARATOR
 
Constructor Summary
ClassTreeArffFileParser()
           
 
Method Summary
protected  java.lang.String parseFile(java.io.File file)
          Expects the given file to be of arff-format and to contain a comment-line providing as keyword @hierarchy followed by a hierarchy-string suitable for ClassTreeParser.setEncodedHierarchy(String encodedHierarchy).
 
Methods inherited from class weka.core.converters.ClassTreeFileParser
getEncodedHierarchy, setEncodedHierarchy
 
Methods inherited from class weka.core.converters.ClassTreeParser
getClassHierarchy, init, main, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPACE

public static final java.util.regex.Pattern SPACE

HIERARCHY

public static final java.lang.String HIERARCHY
See Also:
Constant Field Values
Constructor Detail

ClassTreeArffFileParser

public ClassTreeArffFileParser()
Method Detail

parseFile

protected java.lang.String parseFile(java.io.File file)
Expects the given file to be of arff-format and to contain a comment-line providing as keyword @hierarchy followed by a hierarchy-string suitable for ClassTreeParser.setEncodedHierarchy(String encodedHierarchy). Thus the line should present three space separated tokens: the comment-symbol, the key-word, the encoded hierarchy.

Overrides:
parseFile in class ClassTreeFileParser
Parameters:
file - a file containing as first line an encoded hierarchy
Returns:
String ht eencodedHierarchy as provided by the given file
See Also:
ClassTreeFileParser.parseFile(java.io.File)