protected DEPTree getDEPTree(List<String[]> lines)
{
String form, lemma, pos, feats, nament;
int id, i, size = lines.size();
DEPTree tree = new DEPTree();
DEPNode node;
String[] tmp;
// initialize place holders
for (i=0; i<size; i++)
tree.add(new DEPNode());
if (i_xheads >= 0)
tree.get(0).setXHeads(new ArrayList<DEPArc>());
if (i_sheads >= 0)
tree.get(0).setXHeads(new ArrayList<DEPArc>());
for (i=0; i<size; i++)
{
tmp = lines.get(i);
form = tmp[i_form];
id = (i_id < 0) ? i+1 : Integer.parseInt(tmp[i_id]);
lemma = (i_lemma < 0) ? null : tmp[i_lemma];
pos = (i_pos < 0) ? null : tmp[i_pos];
feats = (i_feats < 0) ? AbstractColumnReader.BLANK_COLUMN : tmp[i_feats];
nament = (i_nament < 0) ? null : tmp[i_nament];
node = tree.get(id);
node.init(id, form, lemma, pos, new DEPFeat(feats));
node.nament = nament;
if (i_headId >= 0 && !tmp[i_headId].equals(AbstractColumnReader.BLANK_COLUMN))
node.setHead(tree.get(Integer.parseInt(tmp[i_headId])), tmp[i_deprel]);
if (i_xheads >= 0)
node.setXHeads(getXHeads(tree, tmp[i_xheads]));
if (i_sheads >= 0)
node.setSHeads(getSHeads(tree, tmp[i_sheads]));
if (i_gpos >= 0)
node.addFeat(DEPLib.FEAT_GPOS, tmp[i_gpos]);
}
if (i_coref >= 0) tree.setMentions(getMentions(lines));
return tree;
}