Ejemplo n.º 1
0
int
tree_ruleHead_third(TreeHist* treeh)
{
    InputTree* specTree = NULL;
    if(Feature::isLM) specTree = tree_ruleTree(treeh, 2);
    if(specTree) return headFromParTree(treeh->tree);
    InputTree* trdtree = tree_ruleTree(treeh,3);
    if(!trdtree) return nullWordInt;
    else return headFromTree(trdtree);
}
Ejemplo n.º 2
0
int
tree_ruleHead_third(FullHist* treeh)
{
  Val* specTree = NULL;
  if(Feature::isLM) specTree = tree_ruleTree(treeh, 2);
  if(specTree)
    {
      FullHist* pt = treeh->back;
      if(!pt) return nullWordInt;
      int ans = pt->hd->toInt();
      return ans;
    }
  Val* trdtree = tree_ruleTree(treeh,3);
  if(!trdtree) return nullWordInt;
  else return trdtree->wrd();
}
Ejemplo n.º 3
0
int
tree_parent_head(TreeHist* treeh)
{
    InputTree* specTree = NULL;
    if(Feature::isLM) specTree = tree_ruleTree(treeh,2);
    if(specTree) return headFromTree(specTree);
    else return headFromParTree(treeh->tree);
}
Ejemplo n.º 4
0
int
fh_parent_head(FullHist* tree)
{
  Val* spectree = NULL;
  if(Feature::isLM) spectree = tree_ruleTree(tree, 2);
  if(spectree)
    {
      //cerr << "found  st " << endl;
      return spectree->wrd();
    }
  FullHist* pt = tree->back;
  if(!pt) return nullWordInt;
  int ans = pt->hd->toInt();
  assert(ans >= -1);
  return ans;
}