opennlp.grok.knowledge
Class DM

java.lang.Object
  |
  +--java.util.AbstractMap
        |
        +--java.util.HashMap
              |
              +--opennlp.grok.knowledge.DM
All Implemented Interfaces:
java.lang.Cloneable, opennlp.common.structure.KB, java.util.Map, ModuleListener, java.io.Serializable

public class DM
extends java.util.HashMap
implements opennlp.common.structure.KB, ModuleListener

The DM is an object which keeps track of the model of the discourse. It is a hashmap containing FC (filecard) objects. It also contains an ISA heirarchy that is constantly updated as new ISA links are created during the discourse.

Version:
$Revision: 1.1.1.1 $, $Date: 2001/10/23 15:17:51 $
Author:
Jason Baldridge
See Also:
Serialized Form

Inner classes inherited from class java.util.Map
java.util.Map.Entry
 
Constructor Summary
DM()
          class constructor: create empty DM
DM(java.lang.String file)
          class constructor: create DM with info supplied by XML file
 
Method Summary
 void addFC(opennlp.common.discourse.FC fc)
          Adds a new FC to the DM, hashed by its id number.
 void addProposition(opennlp.common.synsem.Denoter cat)
          Adds a proposition to the list of propositions that the Brain has evaluated.
 void addRestriction(opennlp.common.unify.Variable v, opennlp.common.synsem.Abstraction p)
           
 void clearRestrictions()
           
 opennlp.common.structure.Category describe(opennlp.common.structure.Category c)
          Take a semantic form and describe it (if it is not already).
 opennlp.common.discourse.FC getFC(opennlp.common.synsem.Denoter c)
          Returns the FC which the resolver thinks best matches the category c.
 opennlp.common.discourse.FC getFC(opennlp.common.synsem.Denoter c, opennlp.common.discourse.AccommodatePolicy ap)
          Returns the FC which the resolver thinks best matches c given the accomodation policy.
 opennlp.common.discourse.FC getFC(GrokSet gs)
          Returns the FC which contains the same GrokSet.
 opennlp.common.structure.Hierarchy getISA()
          Returns the isa heirarchy for this DM
 opennlp.common.discourse.Kind getNode(opennlp.common.synsem.Abstraction c)
          Returns the node which the resolver thinks best matches the category c.
 opennlp.common.discourse.Kind getNode(opennlp.common.synsem.Abstraction c, opennlp.common.discourse.AccommodatePolicy ap)
           
 java.util.ArrayList getPropList()
          Access method for the proposition list.
 opennlp.common.discourse.SalienceList getSalList()
          Access method for the salience list.
 boolean isConsistent(opennlp.common.unify.Variable v, opennlp.common.discourse.Referable r)
           
 java.util.Iterator iterator()
          Provides an iterator through the keySet of this DM.
 void loadXmlFile(java.lang.String file)
          Loads an XML file and uses the information which it contains to fill in information in the DM.
 void merge(opennlp.common.discourse.FC a, opennlp.common.discourse.FC b, boolean polarity)
          Merge two file cards into one (because they are the same thing)
 void ModuleChanged(java.lang.String module, java.lang.String instance)
          Listen for changes in modules
 java.lang.String printISA()
          Prints the ISA heiarchy.
 void removeFC(opennlp.common.discourse.FC fc)
          removes a FC from the dm as well as the ISA
 void setHigherKnowledge(opennlp.common.structure.KB hk)
          Sets hk as the instance of HigherKnowledge
 void setSalList(opennlp.common.discourse.SalienceList s)
           
 java.lang.String toString()
          Prints the FCs which this DM contains.
 void updateSalience(opennlp.common.synsem.Denoter cat)
           
 void updateSalience(opennlp.common.discourse.Referable ref, int utt, int pos)
          update the salience model based on the category
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

DM

public DM()
class constructor: create empty DM

DM

public DM(java.lang.String file)
   throws opennlp.common.structure.CatParseException
class constructor: create DM with info supplied by XML file
Parameters:
file - The name of the XML file to load.
Throws:
opennlp.common.structure.CatParseException - Cannot parse semantics in rule of lex file
Method Detail

addRestriction

public void addRestriction(opennlp.common.unify.Variable v,
                           opennlp.common.synsem.Abstraction p)
Specified by:
addRestriction in interface opennlp.common.structure.KB

clearRestrictions

public void clearRestrictions()
Specified by:
clearRestrictions in interface opennlp.common.structure.KB

isConsistent

public boolean isConsistent(opennlp.common.unify.Variable v,
                            opennlp.common.discourse.Referable r)
Specified by:
isConsistent in interface opennlp.common.structure.KB

loadXmlFile

public void loadXmlFile(java.lang.String file)
                 throws opennlp.common.structure.CatParseException
Loads an XML file and uses the information which it contains to fill in information in the DM.
Parameters:
file - The name of the XML file to load.

setHigherKnowledge

public void setHigherKnowledge(opennlp.common.structure.KB hk)
Sets hk as the instance of HigherKnowledge
Specified by:
setHigherKnowledge in interface opennlp.common.structure.KB
Parameters:
hk - The knowledge base to use as HigherKnowledge

getISA

public opennlp.common.structure.Hierarchy getISA()
Returns the isa heirarchy for this DM
Specified by:
getISA in interface opennlp.common.structure.KB

getSalList

public opennlp.common.discourse.SalienceList getSalList()
Access method for the salience list.
Specified by:
getSalList in interface opennlp.common.structure.KB

setSalList

public void setSalList(opennlp.common.discourse.SalienceList s)
Specified by:
setSalList in interface opennlp.common.structure.KB

getPropList

public java.util.ArrayList getPropList()
Access method for the proposition list.
Specified by:
getPropList in interface opennlp.common.structure.KB

iterator

public java.util.Iterator iterator()
Provides an iterator through the keySet of this DM.
Specified by:
iterator in interface opennlp.common.structure.KB

updateSalience

public void updateSalience(opennlp.common.discourse.Referable ref,
                           int utt,
                           int pos)
update the salience model based on the category
Specified by:
updateSalience in interface opennlp.common.structure.KB

updateSalience

public void updateSalience(opennlp.common.synsem.Denoter cat)
Specified by:
updateSalience in interface opennlp.common.structure.KB

addProposition

public void addProposition(opennlp.common.synsem.Denoter cat)
Adds a proposition to the list of propositions that the Brain has evaluated.
Specified by:
addProposition in interface opennlp.common.structure.KB

addFC

public void addFC(opennlp.common.discourse.FC fc)
Adds a new FC to the DM, hashed by its id number.
Specified by:
addFC in interface opennlp.common.structure.KB

removeFC

public void removeFC(opennlp.common.discourse.FC fc)
removes a FC from the dm as well as the ISA
Specified by:
removeFC in interface opennlp.common.structure.KB

getFC

public opennlp.common.discourse.FC getFC(opennlp.common.synsem.Denoter c)
                                  throws opennlp.common.discourse.AccommodateException
Returns the FC which the resolver thinks best matches the category c.
Specified by:
getFC in interface opennlp.common.structure.KB
Parameters:
c - The category to use in the resolution.

getFC

public opennlp.common.discourse.FC getFC(opennlp.common.synsem.Denoter c,
                                         opennlp.common.discourse.AccommodatePolicy ap)
                                  throws opennlp.common.discourse.AccommodateException
Returns the FC which the resolver thinks best matches c given the accomodation policy. The ap will only come into effect if this is a complex lf we want to instantiate, ie \x dog(x) - \x john(x).
Specified by:
getFC in interface opennlp.common.structure.KB
Parameters:
c - The category to use in the resolution.

getFC

public opennlp.common.discourse.FC getFC(GrokSet gs)
Returns the FC which contains the same GrokSet.

getNode

public opennlp.common.discourse.Kind getNode(opennlp.common.synsem.Abstraction c)
                                      throws opennlp.common.discourse.AccommodateException
Returns the node which the resolver thinks best matches the category c.
Specified by:
getNode in interface opennlp.common.structure.KB
Parameters:
c - The category to use in the resolution.

getNode

public opennlp.common.discourse.Kind getNode(opennlp.common.synsem.Abstraction c,
                                             opennlp.common.discourse.AccommodatePolicy ap)
                                      throws opennlp.common.discourse.AccommodateException
Specified by:
getNode in interface opennlp.common.structure.KB

describe

public opennlp.common.structure.Category describe(opennlp.common.structure.Category c)
Take a semantic form and describe it (if it is not already).
Specified by:
describe in interface opennlp.common.structure.KB

merge

public void merge(opennlp.common.discourse.FC a,
                  opennlp.common.discourse.FC b,
                  boolean polarity)
Merge two file cards into one (because they are the same thing)
Specified by:
merge in interface opennlp.common.structure.KB

printISA

public java.lang.String printISA()
Prints the ISA heiarchy.

toString

public java.lang.String toString()
Prints the FCs which this DM contains.
Overrides:
toString in class java.util.AbstractMap

ModuleChanged

public void ModuleChanged(java.lang.String module,
                          java.lang.String instance)
Listen for changes in modules
Specified by:
ModuleChanged in interface ModuleListener


Copyright © 2001 Jason Baldridge and Gann Bierner. All Rights Reserved.