}
void countLR(String inputFile)
{
// DEPReader reader = new DEPReader(0, 1, 2, 3, 5, 6, 7);
DEPReader reader = new DEPReader(0, 1, 2, 4, 6, 8, 10);
reader.open(UTInput.createBufferedFileReader(inputFile));
int i, size, left = 0, right = 0, l, r, prevId, depId;
DEPTree tree;
DEPNode node;
while ((tree = reader.next()) != null)
{
tree.setDependents();
size = tree.size();
for (i=1; i<size; i++)
{
node = tree.get(i);
prevId = -1;
l = r = 0;
for (DEPArc arc : node.getDependents())
{
depId = arc.getNode().id;
if (depId - prevId == 1)
{
if (depId < node.id) l++;
else r++;
}
prevId = depId;
}
if (l > 1) left++;
else if (r > 1) right++;
}
}
reader.close();
System.out.printf("Left: %d, Right: %d\n", left, right);
}