Parsing Engine

danbikel.parser.ms
Class SubcatModelStructure2

java.lang.Object
  extended by danbikel.parser.ProbabilityStructure
      extended by danbikel.parser.ms.SubcatModelStructure2
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
LeftSubcatModelStructure2, RightSubcatModelStructure2

public abstract class SubcatModelStructure2
extends ProbabilityStructure

Representation of the complete back-off structure of the subcat-generation model for either side of the head child.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class danbikel.parser.ProbabilityStructure
additionalData, defaultModelClassName, defaultModelConstructor, doPruning, estimates, futureList, futures, futuresWithSubcats, histories, historiesWithSubcats, historyList, lambdas, prevHistCount, topLevelCacheSize, transitions
 
Constructor Summary
protected SubcatModelStructure2()
           
 
Method Summary
 Event getHistory(TrainerEvent trainerEvent, int backOffLevel)
          Extracts the history context for the specified back-off level from the specified trainer event.
 double lambdaFudge(int backOffLevel)
          Returns the "fudge factor" for the lambda computation for backOffLevel.
 double lambdaFudgeTerm(int backOffLevel)
          Returns the "fudge term" for the lambda computation for backOffLevel.
 int maxEventComponents()
          Allows subclasses to specify the maximum number of event components, so that the constructor of this class may pre-allocate space in its internal, reusable MutableEvent objects (used for efficient event construction).
 int numLevels()
          Returns the number of back-off levels.
 
Methods inherited from class danbikel.parser.ProbabilityStructure
cacheSize, copy, defaultSmoothingParamsFilename, doCleanup, dontAddNewParameters, doPruning, getAdditionalData, getFuture, getTopLevelCacheSize, getTransition, jointModel, lambdaPenalty, newModel, priorLevel, removeFuture, removeHistory, removeTransition, saveSmoothingParameters, setAdditionalData, smoothingParametersFile, useSmoothingParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubcatModelStructure2

protected SubcatModelStructure2()
Method Detail

maxEventComponents

public int maxEventComponents()
Description copied from class: ProbabilityStructure
Allows subclasses to specify the maximum number of event components, so that the constructor of this class may pre-allocate space in its internal, reusable MutableEvent objects (used for efficient event construction). The default implementation simply returns 1.

Overrides:
maxEventComponents in class ProbabilityStructure
Returns:
1 (subclasses should override this method)
See Also:
MutableEvent.ensureCapacity(int)

numLevels

public int numLevels()
Description copied from class: ProbabilityStructure
Returns the number of back-off levels.

Specified by:
numLevels in class ProbabilityStructure

lambdaFudge

public double lambdaFudge(int backOffLevel)
Description copied from class: ProbabilityStructure
Returns the "fudge factor" for the lambda computation for backOffLevel. The default implementation returns 5.0.

Overrides:
lambdaFudge in class ProbabilityStructure
Parameters:
backOffLevel - the back-off level for which to return a "fudge factor"

lambdaFudgeTerm

public double lambdaFudgeTerm(int backOffLevel)
Description copied from class: ProbabilityStructure
Returns the "fudge term" for the lambda computation for backOffLevel. The default implementation returns 0.0.

Overrides:
lambdaFudgeTerm in class ProbabilityStructure

getHistory

public Event getHistory(TrainerEvent trainerEvent,
                        int backOffLevel)
Description copied from class: ProbabilityStructure
Extracts the history context for the specified back-off level from the specified trainer event.

Specified by:
getHistory in class ProbabilityStructure
Parameters:
trainerEvent - the event for which a history context is desired for the specified back-off level
backOffLevel - the back-off level for which to get a history context from the specified trainer event
Returns:
an Event object that represents the history context for the specified back-off level

Parsing Engine

Author: Dan Bikel.