org.jscience.linguistics.kif
Class KIF
java.lang.Object
org.jscience.linguistics.kif.KIF
public class KIF
- extends java.lang.Object
****************************************************************
A class designed to read a file in SUO-KIF format into memory.
See for a language specification.
readFile() and writeFile() and the only public methods.
|
Field Summary |
java.util.ArrayList |
formulaList
A "raw" ArrayList of Strings which are the formulas from the file without
any further processing, in the order which they appear in the file. |
java.util.HashMap |
formulas
A HashMap of ArrayLists of Formulas. |
java.util.LinkedHashSet |
formulaSet
A "raw" HashSet of unique Strings which are the formulas from the file without
any further processing, in the order which they appear in the file. |
java.util.TreeSet |
terms
The set of all terms in the knowledge base. |
|
Constructor Summary |
KIF()
|
|
Method Summary |
static void |
main(java.lang.String[] args)
**************************************************************
Test method for this class. |
java.lang.String |
parseStatement(java.lang.String formula,
java.lang.String f)
**************************************************************
Parse a single formula. |
void |
readFile(java.lang.String fname)
**************************************************************
Read a KIF file. |
void |
writeFile(java.lang.String fname)
**************************************************************
Write a KIF file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
terms
public java.util.TreeSet terms
- The set of all terms in the knowledge base. This is a set of Strings.
formulas
public java.util.HashMap formulas
- A HashMap of ArrayLists of Formulas. @see KIF.createKey for key format.
formulaSet
public java.util.LinkedHashSet formulaSet
- A "raw" HashSet of unique Strings which are the formulas from the file without
any further processing, in the order which they appear in the file.
formulaList
public java.util.ArrayList formulaList
- A "raw" ArrayList of Strings which are the formulas from the file without
any further processing, in the order which they appear in the file.
KIF
public KIF()
readFile
public void readFile(java.lang.String fname)
throws java.io.IOException,
java.text.ParseException
- **************************************************************
Read a KIF file.
- Parameters:
fname - - the full pathname of the file.
- Throws:
java.io.IOException
java.text.ParseException
writeFile
public void writeFile(java.lang.String fname)
throws java.io.IOException
- **************************************************************
Write a KIF file.
- Parameters:
fname - - the name of the file to write, including full path.
- Throws:
java.io.IOException
parseStatement
public java.lang.String parseStatement(java.lang.String formula,
java.lang.String f)
- **************************************************************
Parse a single formula.
main
public static void main(java.lang.String[] args)
- **************************************************************
Test method for this class.