Package com.clearnlp.util.pair

Examples of com.clearnlp.util.pair.StringIntPair


  {
    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

  @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

  }
 
  /** Called by {@link #getGoldLabel()}. */
  private DEPLabel getGoldLabelArc()
  {
    StringIntPair head = g_labels[i_lambda];
   
    if (head.i == i_beta)
      return new DEPLabel(LB_LEFT, head.s);
   
    head = g_labels[i_beta];
View Full Code Here

    return Collections.max(l_branches);
  }
 
  public void setGoldScoresToBranches()
  {
    StringIntPair   gHead, sHead;
    StringIntPair[] sHeads;
    int i, c;
   
    for (ObjectsDoubleTriple<List<StringInstance>,StringIntPair[]> branch : l_branches)
    {
View Full Code Here

  }
 
  /** Called by {@link #getGoldLabel()}. */
  private DEPLabel getGoldLabelArc()
  {
    StringIntPair head = g_labels[i_lambda];
   
    if (head.i == i_beta)
      return new DEPLabel(LB_LEFT, head.s);
   
    head = g_labels[i_beta];
View Full Code Here

    return Collections.max(l_branches);
  }
 
  public void setGoldScoresToBranches()
  {
    StringIntPair   gHead, sHead;
    StringIntPair[] sHeads;
    int i, c;
   
    for (ObjectsDoubleTriple<List<StringInstance>,StringIntPair[]> branch : l_branches)
    {
View Full Code Here

    DEPCountArc a;
   
    StringIntPair[] t = lHeads.get(0);
     
    for (i=1; i<size; i++)
      H[i] = new StringIntPair(t[i].s, t[i].i);
     
    T.add(DEPLib.ROOT_ID);
    F.addAll(getArcs(lHeads, T));
     
    while (!F.isEmpty())
View Full Code Here

  {
    Map<String,DEPCountArc> map = new HashMap<String,DEPCountArc>();
    int i, depId, len = size(), size = lHeads.size();
    DEPCountArc val;
    StringIntPair[] heads;
    StringIntPair head;
    String key;
   
    for (i=0; i<size; i++)
    {
      heads = lHeads.get(i);
View Full Code Here

  }
 
  public void resetHeads(StringIntPair[] heads)
  {
    int i, size = size(), len = heads.length;
    StringIntPair head;
    DEPNode node;
   
    for (i=1; i<len && i<size; i++)
    {
      node = get(i);
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.