Package com.clearnlp.util.pair

Examples of com.clearnlp.util.pair.StringIntPair


    StringIntPair[] ps = new StringIntPair[map.size()-1];
   
    for (ObjectCursor<String> cur : map.keys())
    {
      if (!(value = cur.value).equals(TOTAL))
        ps[i++] = new StringIntPair(value, map.get(value));
    }
   
    return ps;
  }
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

  {
    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

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.