//System.out.println("//s[@sid='" + sentid + "']");
Elements sentenceChildren = sentenceElement.getChildElements();
for(int j = 0; j < sentenceChildren.size(); j++) {
//System.out.println(sentenceChildren.get(j));
}
ParentNode parent = sentenceElement.getParent();
int childIndex = parent.indexOf(sentenceElement);
sentenceElement.detach();
//Elements sentenceContent = sentenceElement.getChildElements();
//System.out.println("content of sentence: " + sentenceContent);
ArrayList<Attribute> attArray = new ArrayList<Attribute>();
attArray.add(new Attribute("atype", "GSC"));
if(!ctype.equals("None")) {
///System.out.println("ctype is not None: " + ctype);
attArray.add(new Attribute("type", ctype.substring(0, 3)));
} else {
//System.out.println("ctype is None:" + ctype);
attArray.add(new Attribute("type", ctype));
}
attArray.add(new Attribute("conceptID", ctype));
attArray.add(new Attribute("novelty", novelty));
attArray.add(new Attribute("advantage", advantage));
Element annotationElement = new Element("annotationART");
for (Attribute a: attArray) {
annotationElement.addAttribute(a);
}
//System.out.println(annotationElement);
//annotationElement.appendChild("<dummy tag='this'>hello</dummy>");
//Text textNode = new Text(untaggedSentence);
annotationElement.appendChild(unchevronned);
/*for(int i = 0; i <sentenceContent.size();i++) {
sentenceElement.removeChild(sentenceContent.get(i));
annotationElement.appendChild(sentenceContent.get(i));
System.out.println("child:" + sentenceContent.get(i).toString());
}*/
//sentenceElement.removeChildren();
Element newSentence = new Element("s");
parent.insertChild(newSentence, childIndex);
Attribute sidAttr = new Attribute("sid", sentid);
newSentence.addAttribute(sidAttr);
newSentence.appendChild(annotationElement);
//System.out.println(newSentence.toString());
}