// coref_idx = labels[0]==1 ? 0 : 1;
// Load stop words list
try {
stopwords = new HashSet<String>();
FileResource r = (FileResource) uc.getResourceObject("stopWords");
Scanner scanner = new Scanner(r.getFile());
String l;
while (scanner.hasNextLine()) {
l = scanner.nextLine().trim();
if (l.length()==0) continue;
int i = l.indexOf('|');
if (i > 0)
stopwords.add(l.substring(0,i).trim());
else if (i < 0)
stopwords.add(l.trim());
}
vecCreator = new org.apache.ctakes.coreference.util.SvmVectorCreator(stopwords, mod_anaphoricity);
treeFrags = new ArrayList<String>();
r = (FileResource) uc.getResourceObject("frags");
if(r != null){
scanner = new Scanner(r.getFile());
while(scanner.hasNextLine()){
String line = scanner.nextLine();
treeFrags.add(line.split(" ")[1]);
}
vecCreator.setFrags(treeFrags);
}
logger.info("Stop words list loaded: " + r.getFile().getAbsolutePath());
} catch (Exception e) {
e.printStackTrace();
logger.error("Error loading stop words list");
}
}