Package com.clearnlp.util.pair

Examples of com.clearnlp.util.pair.StringIntPair


  {
    int i, size = size();
    DEPNode node, head;
   
    StringIntPair[] diff = new StringIntPair[size];
    StringIntPair p;
   
    for (i=1; i<size; i++)
    {
      node = get(i);
      head = node.getHead();
      p    = heads[i];
     
      if (head != null && head.id != p.i && !node.isLabel(p.s))
        diff[i] = new StringIntPair(node.getLabel(), head.id);
      else
        diff[i] = new StringIntPair(null, DEPLib.NULL_ID);
    }
   
    return diff;
  }
View Full Code Here


  }
 
  public void appendHeads(StringIntPair[] heads)
  {
    int i, size = size();
    StringIntPair p;
   
    for (i=1; i<size; i++)
    {
      p = heads[i];
     
View Full Code Here

  {
    DEPArc head;
    int i;
   
    StringIntPair[] heads = new StringIntPair[endIndex];
    heads[0] = new StringIntPair(DEPLib.ROOT_TAG, DEPLib.NULL_ID);
   
    for (i=1; i<endIndex; i++)
    {
      head = get(i).d_head;
      heads[i] = (head.node != null) ? new StringIntPair(head.label, head.getNode().id) : new StringIntPair(null, DEPLib.NULL_ID);
    }
   
    return heads;
  }
View Full Code Here

      heads = new StringIntPair[len];
     
      for (j=0; j<len; j++)
      {
        arc = arcs.get(j);
        heads[j] = new StringIntPair(arc.label, arc.getNode().id);
      }
     
      sHeads[i] = heads;
    }
   
View Full Code Here

  /** @return [Total, LAS, UAS, LS]. */
  static public int[] getScores(DEPTree tree, StringIntPair[] gHeads)
  {
    int[] counts = new int[4];
    int i, size = tree.size();
    StringIntPair head;
    DEPNode node;
   
    counts[0] += size - 1;
   
    for (i=1; i<size; i++)
View Full Code Here

  @Override
  public void countAccuracy(DEPTree sTree, Object[] gHeads)
  {
    StringIntPair[] heads = (StringIntPair[])gHeads;
    int i, size = sTree.size();
    StringIntPair p;
    DEPNode node;
   
    n_total += size - 1;
   
    for (i=1; i<size; i++)
View Full Code Here

            continue;
         
          cNode = cTree.getNode(loc);
         
          if (!cNode.isEmptyCategoryRec())
            cNode.pbArgs.add(new StringIntPair(label, predTokenId));
        }
      }
    }
  }
View Full Code Here

      {
        list = new ArrayList<StringIntPair>();
        map.put(treeId, list);
      }
     
      list.add(new StringIntPair(sense, wordId));
    }
   
    fin.close();
    return map;
  }
View Full Code Here

      {
        list = new ArrayList<StringIntPair>();
        map.put(treeId, list);
      }
     
      list.add(new StringIntPair(vclass, wordId));
    }
   
    fin.close();
    return map;
  }
View Full Code Here

    for (i=0; i<size; i++)
    {
      tmp    = heads[i].split(DEPLib.DELIM_HEADS_KEY);
      headId = Integer.parseInt(tmp[0]);
      label  = tmp[1];
      p[i]   = new StringIntPair(label, headId);
    }
   
    return p;
  }
View Full Code Here

TOP

Related Classes of com.clearnlp.util.pair.StringIntPair

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.