686687688689690691692693694695696697698699700701702703704705706
{ 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; }
706707708709710711712713714715716
} public void appendHeads(StringIntPair[] heads) { int i, size = size(); StringIntPair p; for (i=1; i<size; i++) { p = heads[i];
750751752753754755756757758759760761762763764
{ 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; }
807808809810811812813814815816817
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; }
93949596979899100101102103
/** @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++)
7273747576777879808182
@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++)
299300301302303304305306307308
continue; cNode = cTree.getNode(loc); if (!cNode.isEmptyCategoryRec()) cNode.pbArgs.add(new StringIntPair(label, predTokenId)); } } } }
391392393394395396397398399400401
{ list = new ArrayList<StringIntPair>(); map.put(treeId, list); } list.add(new StringIntPair(sense, wordId)); } fin.close(); return map; }
423424425426427428429430431432433
{ list = new ArrayList<StringIntPair>(); map.put(treeId, list); } list.add(new StringIntPair(vclass, wordId)); } fin.close(); return map; }
114115116117118119120121122123
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; }