|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectproper.core.ProperObject
proper.imp.Parser
public abstract class Parser
This abstract is the ancestor for several Parsers that use predicates. Handwritten parser was necessary, since JLex/CUP had problems with big files...
| Field Summary | |
|---|---|
static boolean |
RELAGGS_FIX
fixes the problem of RELAGGS with "+" and "-", by changing it to "pos" and "neg" |
| Fields inherited from interface proper.imp.ParserInterface |
|---|
CLASS_NEGATIVE, CLASS_POSITIVE |
| Fields inherited from interface proper.core.ProperInterface |
|---|
VERSION |
| Constructor Summary | |
|---|---|
Parser()
initializes the parser |
|
| Method Summary | |
|---|---|
void |
clear()
clears the currently stored predicates |
boolean |
getAddClassLabel()
returns the current status of the flag for adding class labels ('+' or '-') to the facts |
java.lang.String |
getClassLabel()
the current label for the class |
java.lang.String |
getFilename()
returns the current filename |
boolean |
getOnlyForSingles()
returns the flag, whether the class label is added only to predicates with one argument |
java.util.Vector |
getPredicates()
returns the currently stored predicates |
void |
parse(java.io.Reader reader)
uses the given reader to parse the file |
void |
parse(java.lang.String filename)
parses the given file |
void |
setAddClassLabel(boolean addClassLabel)
if this flag is set, the file is considered as without class labels and therefore facts with ":-" are labeled with '-' otherwise with '+' |
void |
setClassLabel(java.lang.String classLabel)
sets the class label to use |
void |
setFilename(java.lang.String filename)
sets the name of the file being parsed right now |
void |
setID(ID id)
sets the ID-generator |
void |
setOnlyForSingles(boolean onlyForSingles)
sets the flag, whether the class label is added only to predicates with one argument |
java.lang.String |
toString()
returns the currently stored predicates in string representation |
| Methods inherited from class proper.core.ProperObject |
|---|
addListener, addOutput, classInVerbose, debugprint, debugprint, debugprint, debugprint, debugprintln, debugprintln, debugprintln, debugprintln, debugprintln, getListeners, getRuntime, getVerbose, getVerboseLevel, getVerboseLevelForClass, getVerboseString, getVerboseStringForClass, notifyListener, notifyListeners, print, print, print, print, println, println, println, println, println, printMemory, removeListener, setOutput, setVerbose, setVerboseLevel, setVerboseString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface proper.imp.ParserInterface |
|---|
getVerbose, setVerbose |
| Field Detail |
|---|
public static final boolean RELAGGS_FIX
| Constructor Detail |
|---|
public Parser()
| Method Detail |
|---|
public void setID(ID id)
setID in interface ParserInterfacepublic java.util.Vector getPredicates()
getPredicates in interface ParserInterfacepublic void setAddClassLabel(boolean addClassLabel)
setAddClassLabel in interface ParserInterfacepublic boolean getAddClassLabel()
getAddClassLabel in interface ParserInterfacepublic void setOnlyForSingles(boolean onlyForSingles)
setOnlyForSingles in interface ParserInterfacepublic boolean getOnlyForSingles()
getOnlyForSingles in interface ParserInterfacepublic void setClassLabel(java.lang.String classLabel)
setClassLabel in interface ParserInterfaceParserInterface.setOnlyForSingles(boolean)public java.lang.String getClassLabel()
getClassLabel in interface ParserInterfacepublic void setFilename(java.lang.String filename)
setFilename in interface ParserInterfacepublic java.lang.String getFilename()
getFilename in interface ParserInterfacepublic void clear()
clear in interface ParserInterface
public void parse(java.lang.String filename)
throws java.lang.Exception
parse in interface ParserInterfacejava.lang.Exception
public void parse(java.io.Reader reader)
throws java.lang.Exception
parse in interface ParserInterfacejava.lang.Exceptionpublic java.lang.String toString()
toString in class ProperObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||