|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinpro.nlu.AVMUtil
public class AVMUtil
General AVM Utility for composition and resolution via unification.
Field Summary | |
---|---|
private static java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> |
avmStructures
Variable for storing AVM structures. |
private java.util.ArrayList<AVM> |
composeList
List of underspecified AVMs representing possible input (available to composition). |
private org.apache.log4j.Logger |
logger
Logger for AVMUtil |
private java.util.ArrayList<AVM> |
resolvedList
List of AVMs that resolved (a subset of worldList). |
private java.util.ArrayList<AVM> |
worldList
List of fully specified AVMs representing world objects (available to resolution). |
Constructor Summary | |
---|---|
AVMUtil()
Creates AVMUtil with a list of prototypes (avmStructures) of different typed AVMs and a local list of composed AVMs (composeList). |
|
AVMUtil(AVMUtil c)
|
|
AVMUtil(java.lang.String structureFile)
Creates AVMUtil with a list of prototypes (avmStructures) of different typed AVMs and a local list of composed AVMs (composeList). |
|
AVMUtil(java.lang.String worldFile,
java.lang.String structureFile)
Creates AVMUtil with a list of prototypes (avmStructures) of different typed AVMs and a local list of composed AVMs (composeList). |
Method Summary | |
---|---|
void |
allowAVMsByType(java.lang.String type)
Allows only one type of AVM during composition. |
java.util.ArrayList<AVM> |
compose(AVPair avp)
Method to call when a new AVPair becomes known. |
java.util.ArrayList<AVM> |
composeAll(java.util.List<AVPair> avPairs)
Calls compose() for the list of AVPairs. |
java.lang.String |
composeListToString()
Builds and returns a readable string representation of this AVMUtil's compose list. |
java.util.ArrayList<AVM> |
getAVMStructures()
Returns a list of known AVM structures. |
(package private) static void |
interactiveTest()
Command line test utility. |
static void |
main(java.lang.String[] args)
Main method mostly for local testing. |
private void |
printComposeList()
Prints out all known AVM prototypes. |
void |
resetAVMs()
Resets AVMs used during composition. |
java.util.ArrayList<AVM> |
resolve()
Tries to unify composed AVMs in composeList with known AVMs in worldList. |
java.lang.String |
resolveListToString()
Builds and returns a readable string representation of this AVMUtil's resolve list. |
void |
setComposeList(java.util.ArrayList<AVM> avmList)
Sets the list of AVMs available for composition. |
void |
setWorldList(java.util.ArrayList<AVM> avmList)
Sets the list of AVMs available for resolution. |
java.lang.String |
toString()
Builds and returns a string representation of this AVMUtil. |
java.util.ArrayList<AVM> |
uniquelyResolve()
Resolves AVMs, returns a list of AVMs that resolved uniquely (i.e. there were no others of the same type that resolved). |
void |
unsetAVMs(java.lang.String type)
Disallows AVM of a given type during composition. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> avmStructures
private java.util.ArrayList<AVM> worldList
private java.util.ArrayList<AVM> composeList
private java.util.ArrayList<AVM> resolvedList
private org.apache.log4j.Logger logger
Constructor Detail |
---|
public AVMUtil() throws java.net.MalformedURLException
java.net.MalformedURLException
public AVMUtil(java.lang.String structureFile) throws java.net.MalformedURLException
structureFile
- with list of AVM structures.
java.net.MalformedURLException
public AVMUtil(java.lang.String worldFile, java.lang.String structureFile) throws java.net.MalformedURLException
structureFile
- with list of AVMstuctureworldFile
- with list of AVMs in the world
java.net.MalformedURLException
public AVMUtil(AVMUtil c)
Method Detail |
---|
public java.util.ArrayList<AVM> compose(AVPair avp)
avp
- the AVPair to compose with
public java.util.ArrayList<AVM> composeAll(java.util.List<AVPair> avPairs)
avPairs
- list of AVPairs to be composed
public java.util.ArrayList<AVM> resolve()
public java.util.ArrayList<AVM> uniquelyResolve()
public java.util.ArrayList<AVM> getAVMStructures()
public void resetAVMs()
public void allowAVMsByType(java.lang.String type)
type
- The type of AVM to allowpublic void unsetAVMs(java.lang.String type)
type
- The type of AVM to disallowpublic void setComposeList(java.util.ArrayList<AVM> avmList)
avmList
- the avmList to setpublic void setWorldList(java.util.ArrayList<AVM> avmList)
avmList
- the list of AVMs in the world to set toprivate void printComposeList()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String composeListToString()
public java.lang.String resolveListToString()
static void interactiveTest() throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] args) throws java.io.IOException
args
-
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |