opennlp.maxent
Class MutableContext

java.lang.Object
  extended by opennlp.maxent.Context
      extended by opennlp.maxent.MutableContext

public class MutableContext
extends Context

Class used to store parameters or expected values associated with this context which can be updated or assigned.

Author:
Tom Morton

Field Summary
 
Fields inherited from class opennlp.maxent.Context
outcomes, parameters
 
Constructor Summary
MutableContext(int[] outcomePattern, double[] parameters)
          Creates a new parametes object with the specifed parameters associated with the specified outcome pattern.
 
Method Summary
 boolean contains(int outcome)
           
 void setParameter(int outcomeIndex, double value)
          Assigns the parameter or expected value at the specified outcomeIndex the specified value.
 void updateParameter(int outcomeIndex, double value)
          Updated the parameter or expected value at the specified outcomeIndex by adding the specified value to its current value.
 
Methods inherited from class opennlp.maxent.Context
getOutcomes, getParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutableContext

public MutableContext(int[] outcomePattern,
                      double[] parameters)
Creates a new parametes object with the specifed parameters associated with the specified outcome pattern.

Parameters:
outcomePattern - Array of outcomes for which parameters exists for this context.
parameters - Paramaters for the outcomes specified.
Method Detail

setParameter

public void setParameter(int outcomeIndex,
                         double value)
Assigns the parameter or expected value at the specified outcomeIndex the specified value.

Parameters:
outcomeIndex - The index of the parameter or expected value to be updated.
value - The value to be assigned.

updateParameter

public void updateParameter(int outcomeIndex,
                            double value)
Updated the parameter or expected value at the specified outcomeIndex by adding the specified value to its current value.

Parameters:
outcomeIndex - The index of the parameter or expected value to be updated.
value - The value to be added.

contains

public boolean contains(int outcome)


Copyright © 2005 Jason Baldridge, Gann Bierner, and Thomas Morton. All Rights Reserved.