Package com.clearnlp.util.list

Examples of com.clearnlp.util.list.SortedIntArrayList


    SortedIntArrayList[] lhs = new SortedIntArrayList[size];
    SortedIntArrayList[] rhs = new SortedIntArrayList[size];
   
    for (i=0; i<size; i++)
    {
      lhs[i] = new SortedIntArrayList(false);
      rhs[i] = new SortedIntArrayList(false);
    }
   
    for (i=1; i<size; i++)
    {
      curr = d_tree.get(i);
View Full Code Here


   * Joins concatenated locations by replacing them with higher nodes.
   * PRE: {@link PBInstance#sortArgs()} is called.
   */
  private void joinConcatenations(PBInstance instance)
  {
    SortedIntArrayList ids = new SortedIntArrayList();
    CTTree tree = instance.getTree();
    int terminalId, height;
    CTNode node, parent;
    List<PBLoc> lNew;
   
    for (PBArg arg : instance.getArgs())
    {
      if (arg.isLabel(PBLib.PB_REL))  continue;
      ids.clear();
     
      for (PBLoc loc : arg.getLocs())
      {
        if (!loc.isType("") && !loc.isType(","))  return;
        if (loc.height > 0)              return;
        ids.add(loc.terminalId);
      }
     
      lNew = new ArrayList<PBLoc>();
     
      while (!ids.isEmpty())
      {
        terminalId = ids.get(0);
        height     = 0;
        node       = tree.getNode(terminalId, height);
       
        while ((parent = node.getParent()) != null && !parent.isPTag(CTLib.PTAG_TOP) && UTHppc.isSubset(ids, parent.getSubTerminalIdSet()))
        {
          node = parent;
          height++;
        }
       
        lNew.add(new PBLoc(terminalId, height, ","));
        ids.removeAll(node.getSubTerminalIdSet());
      }
     
      if (lNew.size() < arg.getLocSize())
      {
        lNew.get(0).type = "";
View Full Code Here

TOP

Related Classes of com.clearnlp.util.list.SortedIntArrayList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.