Exemple #1
0
  public StringIntPair[] getDiff(StringIntPair[] heads) {
    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;
  }