public class KIF extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
count |
HashMap<String,Formula> |
formulaMap
A HashMap of String keys representing the formula, and Formula values.
|
HashMap<String,ArrayList<String>> |
formulas
A HashMap of ArrayLists of Formulas.
|
static int |
NORMAL_PARSE_MODE
A numeric constant denoting normal parse mode, in which syntax
constraints are enforced.
|
static int |
RELAXED_PARSE_MODE
A numeric constant denoting relaxed parse mode, in which fewer
syntax constraints are enforced than in NORMAL_PARSE_MODE.
|
TreeSet<String> |
terms
The set of all terms in the knowledge base.
|
TreeSet<String> |
warningSet
warnings generated during parsing
|
| Constructor and Description |
|---|
KIF() |
| Modifier and Type | Method and Description |
|---|---|
int |
getParseMode()
public String getFilename() {
return this.filename;
}
/** ***************************************************************
public void setFilename(String canonicalPath) {
this.filename = canonicalPath;
return;
}
/** ***************************************************************
|
static void |
main(String[] args)
Test method for this class.
|
protected TreeSet<String> |
parse(Reader r)
This method has the side effect of setting the contents of
formulaMap and formulas as it parses the file.
|
String |
parseStatement(String formula)
Parse a single formula.
|
void |
readFile(String fname)
Read a KIF file.
|
void |
setParseMode(int mode)
Sets the current parse mode to the input value mode.
|
static void |
setupStreamTokenizer(StreamTokenizer_s st)
This routine sets up the StreamTokenizer_s so that it parses SUO-KIF.
|
static void |
tptpOutputTest(String filename)
Writes the TPTP output to a file.
|
void |
writeFile(String fname)
Write a KIF file.
|
public static final int NORMAL_PARSE_MODE
public static int count
public static final int RELAXED_PARSE_MODE
public TreeSet<String> terms
public HashMap<String,ArrayList<String>> formulas
for key format.public HashMap<String,Formula> formulaMap
public int getParseMode()
public void setParseMode(int mode)
mode - An integer value denoting a parsing mode.public static void setupStreamTokenizer(StreamTokenizer_s st)
protected TreeSet<String> parse(Reader r)
public void readFile(String fname) throws Exception
fname - - the full pathname of the file.Exceptionpublic void writeFile(String fname)
fname - - the name of the file to write, including full path.public static void tptpOutputTest(String filename) throws IOException
IOExceptionpublic static void main(String[] args) throws IOException
IOExceptionCopyright © 2015. All rights reserved.