HashMap<Integer,DPState> allDPStates = null;
if(stateComputers!=null){
for(StateComputer stateComputer : stateComputers){
DPState dpState = stateComputer.computeState(rule, antNodes, i, j, srcPath);
if(allDPStates==null)
allDPStates = new HashMap<Integer,DPState>();
allDPStates.put(stateComputer.getStateID(), dpState);
}
}
//=== compute feature logPs
double transitionLogPSum = 0.0;
double futureLogPEstimation = 0.0;
for (FeatureFunction ff : featureFunctions) {
transitionLogPSum +=
ff.getWeight() * ff.transitionLogP(rule, antNodes, i, j, srcPath, sentID);
DPState dpState = null;
if(allDPStates!=null)
dpState = allDPStates.get(ff.getStateID());
futureLogPEstimation +=
ff.getWeight() * ff.estimateFutureLogP(rule, dpState, sentID);