((NobleCoderTerminology)nc.getTerminology()).setSelectBestCandidate(true);
for(File file : new File("/home/tseytlin/Data/DeepPhe/"+domain+"/sample/deid/").listFiles()){
if(file.getName().endsWith(".txt")){
System.out.print("processing\t"+file.getName()+"\t..\t");
Document doc = nc.process(file);
PrintStream out = new PrintStream(new File(file.getParentFile(),file.getName()+".processed"));
out.println(doc.getTitle());
out.println("---------------------------------------");
for(Object prop : doc.getProperties().keySet()){
out.println(prop+"\t->\t"+doc.getProperties().get(prop));
}
out.println("---------------------------------------");
for(Sentence s: doc.getSentences()){
String sec = s.getSection() != null?s.getSection().getTitle():"none";
String tm = s.getProperties().containsKey("time")?s.getProperties().get("time"):"";
out.println("sentence:\t|"+s.getOffset()+"|\t"+s.getSentenceType()+"|\t"+sec+"|\t"+s+"\t|"+tm);
//System.out.println("extracted:\t"+doc.getText().substring(s.getStartPosition(),s.getEndPosition()));
for(Mention m: s.getMentions()){