Beispiel #1
0
float
Bchart::
meEdgeProb(const Term* trm, Edge* edge, int whichInt)
{
  FullHist fh(edge);
  float ans =  meFHProb(trm, fh, whichInt);
  return ans;
}
void
Bchart::
assignRProb(Edge* edge)
{
  LeftRightGotIter lrgi(edge);
  globalGi = &lrgi;
  int sz = lrgi.size();
  int i;
  int hp = edge->headPos();
  double ans = 1;
  cerr << "ARP " << *edge << endl;
  for(i = 0 ; i < sz ; i++)
    {
      lrgi.pos() = i;
      int whichInt = i < hp ? LCALC : i == hp ? MCALC : RCALC;
      FullHist fh(edge);
      fh.pos = i;
      double p = meFHProb(lrgi.index(i)->term(),fh, whichInt);
      //cerr << "p" << whichInt << "(" << *lrgi.index(i) << ")= " << p << endl;
      ans *= p;
    }
  //if(ans == 0) cerr << "Assigned zero prob to " << *edge << endl;
  edge->prob() = ans;
}