opennlp.grok.expression
Class AbstractCat

java.lang.Object
  |
  +--opennlp.grok.expression.AbstractCat
All Implemented Interfaces:
opennlp.common.synsem.Category, opennlp.common.unify.Mutable, java.io.Serializable, gnu.trove.TLinkable, opennlp.common.unify.Unifiable
Direct Known Subclasses:
AtomCat, ComplexCat

public abstract class AbstractCat
extends java.lang.Object
implements opennlp.common.synsem.Category, gnu.trove.TLinkable

Abstract category adapter for CCG categories.

Version:
$Revision: 1.7 $, $Date: 2002/11/28 15:01:21 $
Author:
Gann Bierner, Jason Baldridge, Michael White
See Also:
Serialized Form

Field Summary
protected  opennlp.common.unify.FeatureStructure _featStruc
          The feature structure, which should only be used with atomic categories.
protected  opennlp.common.synsem.LF _lf
          The logical form, which should be used only with the outermost category.
protected  gnu.trove.TLinkable _next
           
protected  gnu.trove.TLinkable _previous
           
static boolean SHOW_SEMANTICS
           
 
Constructor Summary
AbstractCat()
          Default constructor.
AbstractCat(org.jdom.Element elt)
          Constructor which retrieves the LF from the XML element and flattens it to a conjunction of elementary predications (or a single one).
AbstractCat(opennlp.common.synsem.LF lf)
          Constructor which sets the LF.
 
Method Summary
abstract  opennlp.common.synsem.Category copy()
           
 void deepMap(opennlp.common.unify.ModFcn mf)
           
abstract  boolean equals(java.lang.Object c)
           
abstract  java.lang.Object fill(opennlp.common.unify.Substitution s)
           
 void forall(opennlp.common.synsem.CategoryFcn f)
           
 opennlp.common.unify.FeatureStructure getFeatureStructure()
          Gets the feature structure.
 opennlp.common.synsem.LF getLF()
          Gets the LF.
 gnu.trove.TLinkable getNext()
          Returns the linked list node after this one.
 gnu.trove.TLinkable getPrevious()
          Returns the linked list node before this one.
 java.lang.String hashString()
          Returns a unique string for this category.
abstract  java.lang.String hashString(java.util.Map varMap)
          Returns a hash string using the given map from vars to int strings.
 boolean occurs(opennlp.common.unify.Variable v)
           
protected  int prettyLength(java.lang.String s)
           
 java.lang.String prettyPrint()
           
protected  java.lang.String prettyPrint(java.lang.String pad)
           
 void setFeatureStructure(opennlp.common.unify.FeatureStructure fs)
          Sets the feature structure.
 void setLF(opennlp.common.synsem.LF lf)
          Sets the LF.
 void setNext(gnu.trove.TLinkable linkable)
          Sets the linked list node after this one.
 void setPrevious(gnu.trove.TLinkable linkable)
          Sets the linked list node before this one.
 boolean shallowEquals(java.lang.Object o)
           
static boolean showFeature()
           
static int tooLong()
           
abstract  java.lang.String toString()
           
abstract  java.lang.Object unify(java.lang.Object u, opennlp.common.unify.Substitution sub)
          NB: The LF does not participate in unification.
abstract  void unifyCheck(java.lang.Object u)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SHOW_SEMANTICS

public static boolean SHOW_SEMANTICS

_featStruc

protected opennlp.common.unify.FeatureStructure _featStruc
The feature structure, which should only be used with atomic categories.


_lf

protected opennlp.common.synsem.LF _lf
The logical form, which should be used only with the outermost category.


_previous

protected gnu.trove.TLinkable _previous

_next

protected gnu.trove.TLinkable _next
Constructor Detail

AbstractCat

public AbstractCat()
Default constructor.


AbstractCat

public AbstractCat(opennlp.common.synsem.LF lf)
Constructor which sets the LF.


AbstractCat

public AbstractCat(org.jdom.Element elt)
Constructor which retrieves the LF from the XML element and flattens it to a conjunction of elementary predications (or a single one).

Method Detail

getFeatureStructure

public opennlp.common.unify.FeatureStructure getFeatureStructure()
Gets the feature structure.

Specified by:
getFeatureStructure in interface opennlp.common.synsem.Category

setFeatureStructure

public void setFeatureStructure(opennlp.common.unify.FeatureStructure fs)
Sets the feature structure.

Specified by:
setFeatureStructure in interface opennlp.common.synsem.Category

getLF

public opennlp.common.synsem.LF getLF()
Gets the LF.

Specified by:
getLF in interface opennlp.common.synsem.Category

setLF

public void setLF(opennlp.common.synsem.LF lf)
Sets the LF.

Specified by:
setLF in interface opennlp.common.synsem.Category

toString

public abstract java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public abstract boolean equals(java.lang.Object c)
Specified by:
equals in interface opennlp.common.unify.Unifiable
Overrides:
equals in class java.lang.Object

copy

public abstract opennlp.common.synsem.Category copy()
Specified by:
copy in interface opennlp.common.synsem.Category

fill

public abstract java.lang.Object fill(opennlp.common.unify.Substitution s)
                               throws opennlp.common.unify.UnifyFailure
Specified by:
fill in interface opennlp.common.unify.Unifiable
opennlp.common.unify.UnifyFailure

unifyCheck

public abstract void unifyCheck(java.lang.Object u)
                         throws opennlp.common.unify.UnifyFailure
Specified by:
unifyCheck in interface opennlp.common.unify.Unifiable
opennlp.common.unify.UnifyFailure

unify

public abstract java.lang.Object unify(java.lang.Object u,
                                       opennlp.common.unify.Substitution sub)
                                throws opennlp.common.unify.UnifyFailure
NB: The LF does not participate in unification.

Specified by:
unify in interface opennlp.common.unify.Unifiable
opennlp.common.unify.UnifyFailure

shallowEquals

public boolean shallowEquals(java.lang.Object o)
Specified by:
shallowEquals in interface opennlp.common.synsem.Category

deepMap

public void deepMap(opennlp.common.unify.ModFcn mf)
Specified by:
deepMap in interface opennlp.common.unify.Mutable

forall

public void forall(opennlp.common.synsem.CategoryFcn f)
Specified by:
forall in interface opennlp.common.synsem.Category

occurs

public boolean occurs(opennlp.common.unify.Variable v)
Specified by:
occurs in interface opennlp.common.unify.Unifiable

prettyPrint

public java.lang.String prettyPrint()

prettyPrint

protected java.lang.String prettyPrint(java.lang.String pad)

prettyLength

protected int prettyLength(java.lang.String s)

hashString

public java.lang.String hashString()
Returns a unique string for this category. The string should handle equivalence up to variable names as long as features and predicates are in the same order.

Specified by:
hashString in interface opennlp.common.synsem.Category

hashString

public abstract java.lang.String hashString(java.util.Map varMap)
Returns a hash string using the given map from vars to int strings.

Specified by:
hashString in interface opennlp.common.synsem.Category

showFeature

public static boolean showFeature()

tooLong

public static int tooLong()

getNext

public gnu.trove.TLinkable getNext()
Returns the linked list node after this one.

Specified by:
getNext in interface gnu.trove.TLinkable
Returns:
a TLinkable value

getPrevious

public gnu.trove.TLinkable getPrevious()
Returns the linked list node before this one.

Specified by:
getPrevious in interface gnu.trove.TLinkable
Returns:
a TLinkable value

setNext

public void setNext(gnu.trove.TLinkable linkable)
Sets the linked list node after this one.

Specified by:
setNext in interface gnu.trove.TLinkable
Parameters:
linkable - a TLinkable value

setPrevious

public void setPrevious(gnu.trove.TLinkable linkable)
Sets the linked list node before this one.

Specified by:
setPrevious in interface gnu.trove.TLinkable
Parameters:
linkable - a TLinkable value


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