|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinpro.nlu.AVM
public class AVM
Class representing an AVM with methods for equality, unification and setting attributes.
Field Summary | |
---|---|
private java.util.HashMap<java.lang.String,java.lang.Object> |
attributes
|
private boolean |
monotonic
|
private java.lang.String |
type
|
Constructor Summary | |
---|---|
protected |
AVM(AVM avm)
Copy constructor. |
|
AVM(java.lang.String type,
boolean monotonic,
java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> avmStructures)
String type, boolean monotonic, HashMap avmStructures constructor. |
|
AVM(java.lang.String type,
java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> avmStructures)
String type, HashMap avmStructures constructor. |
Method Summary | |
---|---|
void |
clearValues()
Clears values of all AVPairs in this AVM. |
boolean |
equals(java.lang.Object o)
Convenience method checking equality of two AVMs. |
java.util.HashMap<java.lang.String,java.lang.Object> |
getAttributes()
Returns the attributes of this AVM. |
java.util.ArrayList<AVPair> |
getAVPairs()
Gets an ArrayList of all AVPairs attributed to this AVM, including null ones. |
java.util.ArrayList<AVPair> |
getDeepAVPairs()
Gets an ArrayList of all AVPairs attributed to this AVM, including null ones. |
AVPair |
getSalientAVPair()
Returns a salient AVPair for this AVM. |
java.lang.String |
getType()
Returns the type of this AVM. |
int |
hashCode()
hashCode method for use by Collections. |
boolean |
isEmpty()
Returns the type of this AVM. |
boolean |
setAttribute(AVPair avp)
Attempts setting an attribute to this AVM. |
java.lang.String |
toLongString()
Builds a complete string representation of the AVM with nested brackets. |
java.lang.String |
toPrettyString()
Builds a pretty string representation of the AVM containing only its type and non-empty AVPairs. |
java.lang.String |
toShortString()
Builds a short string representation of the AVM containing only its type. |
java.lang.String |
toString()
Builds a string representation of the AVM with nested brackets. |
boolean |
unifies(AVM avm)
Checks if unification is possible for two AVMs. |
AVM |
unify(AVM avm)
Attempts unifying AVM with the input to this method. |
private java.util.HashMap<java.lang.String,java.lang.Object> |
unpackStructures(java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> avmStructures,
java.lang.String type)
Builds attribute map from flat string map (read from file by AVMStructureUtil). |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final java.lang.String type
private java.util.HashMap<java.lang.String,java.lang.Object> attributes
private boolean monotonic
Constructor Detail |
---|
public AVM(java.lang.String type, java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> avmStructures)
public AVM(java.lang.String type, boolean monotonic, java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> avmStructures)
protected AVM(AVM avm)
avm
- - the AVM to copy.Method Detail |
---|
private java.util.HashMap<java.lang.String,java.lang.Object> unpackStructures(java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> avmStructures, java.lang.String type)
avmStructures
- HashMaptype
- of the AVMpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
avm
- - an AVM to compare this AVM with.
public int hashCode()
hashCode
in class java.lang.Object
public AVM unify(AVM avm)
avm
- - the AVM to unify with this AVM.
public boolean unifies(AVM avm)
avm
- - an AVM to check against whether unification would be successful.
public boolean setAttribute(AVPair avp)
avp
- - an AVPair to attempt setting against this AVM or its children.
public void clearValues()
public java.util.ArrayList<AVPair> getAVPairs()
public java.util.ArrayList<AVPair> getDeepAVPairs()
public java.lang.String getType()
public java.util.HashMap<java.lang.String,java.lang.Object> getAttributes()
public AVPair getSalientAVPair()
public boolean isEmpty()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toShortString()
public java.lang.String toLongString()
public java.lang.String toPrettyString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |