Parsing Engine

danbikel.parser
Class CKYItem.MappedPrevModBaseNPAware

java.lang.Object
  extended by danbikel.parser.Item
      extended by danbikel.parser.CKYItem
          extended by danbikel.parser.CKYItem.MappedPrevModBaseNPAware
All Implemented Interfaces:
SexpConvertible, Serializable, Comparable
Direct Known Subclasses:
CKYItem.KBestHack, EMItem
Enclosing class:
CKYItem

public static class CKYItem.MappedPrevModBaseNPAware
extends CKYItem

Overrides equals and hashCode methods to compare the last previous modifier on each side of each chart item's head child with respect to their respective equivalence classes, as determined by the mapping provided by NTMapper.map(Symbol).

See Also:
mappedPrevModsEqual(CKYItem), NonterminalMapper, NTMapper, Settings.prevModMapperClass, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class danbikel.parser.CKYItem
CKYItem.BaseNPAware, CKYItem.KBestHack, CKYItem.MappedPrevModBaseNPAware, CKYItem.PrevModIsStart
 
Field Summary
 
Fields inherited from class danbikel.parser.CKYItem
baseNPsCannotContainVerbs, constraint, containsVerb, containsVerbFalse, containsVerbTrue, containsVerbUndefined, end, garbage, headChild, headWord, label, leftChildren, leftPrevMods, leftSubcat, leftVerb, logPrior, logTreeProb, nonTreebankDelimiter, nonTreebankLeftBracket, nonTreebankRightBracket, numParses, numPrevMods, numPrevWords, outputInsideProbs, outputLexLabels, rightChildren, rightPrevMods, rightSubcat, rightVerb, start, stop, stopWord, topSym
 
Fields inherited from class danbikel.parser.Item
logProb
 
Constructor Summary
CKYItem.MappedPrevModBaseNPAware()
           
 
Method Summary
 boolean equals(Object obj)
          Returns true if and only if the specified object is also an instance of a CKYItem and all elements of this CKYItem are equal to those of the specified CKYItem, except their left and right children lists and their log probability values.
 int hashCode()
          Computes the hash code based on all elements used by the equals(java.lang.Object) method.
protected  boolean mappedPrevModsEqual(CKYItem other)
          Returns true if the most recvent previous modifiers on both the left and right sides of the head child are equivalent to the respective left and right previous modifiers of the specified chart item.
 
Methods inherited from class danbikel.parser.CKYItem
children, clear, containsVerb, containsVerbRecursive, edgeIndex, end, garbage, getConstraint, getLabel, hasAntecedent, hasEquivalentItem, headChild, headLabel, headWord, headWordIdx, isPreterminal, label, leftChildren, leftPrevMods, leftSubcat, leftVerb, logPrior, logProb, logTreeProb, numLeftChildren, numParses, numRightChildren, prevMods, prevWordsEqual, prevWordsEqual, rightChildren, rightPrevMods, rightSubcat, rightVerb, set, setChildren, setConstraint, setDataFrom, setEdgeIndex, setGarbage, setLabel, setLeftSubcat, setLogPrior, setLogProb, setLogTreeProb, setPrevMods, setRightSubcat, setSideInfo, setSubcat, setVerb, shortBool, shortContainsVerb, start, stop, subcat, toSexp, toSexpInternal, toString, verb
 
Methods inherited from class danbikel.parser.Item
compareTo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CKYItem.MappedPrevModBaseNPAware

public CKYItem.MappedPrevModBaseNPAware()
Method Detail

equals

public boolean equals(Object obj)
Returns true if and only if the specified object is also an instance of a CKYItem and all elements of this CKYItem are equal to those of the specified CKYItem, except their left and right children lists and their log probability values. Unlike this method in the superclass, there are special cases when Furthermore, only the most recent previous modifiers are compared, and they are mapped to equivalence classes before being compared. Mapping and comparison are performed by the mappedPrevModsEqual(CKYItem) method.

Overrides:
equals in class CKYItem
Parameters:
obj - the object to compare to this object
Returns:
whether this object is equal or equivalent to the specified object

mappedPrevModsEqual

protected boolean mappedPrevModsEqual(CKYItem other)
Returns true if the most recvent previous modifiers on both the left and right sides of the head child are equivalent to the respective left and right previous modifiers of the specified chart item. Two previous modifiers are considered equivalent if their equivalence classes are equal. Mapping of a modifier to an equivlanece class is performed by the NTMapper.map(Symbol) method.

Parameters:
other - the other chart item whose most recent previous modifiers are to be compared to those of this item
Returns:
whether the most recent previous modifiers of this item are equivalent to those of the specified item
See Also:
NonterminalMapper, NTMapper, Settings.prevModMapperClass

hashCode

public int hashCode()
Computes the hash code based on all elements used by the equals(java.lang.Object) method.

Overrides:
hashCode in class CKYItem

Parsing Engine

Author: Dan Bikel.