use of com.joliciel.talismane.parser.output.ParseConfigurationOutput in project talismane by joliciel-informatique.
the class StandoffWriter method onNextParseConfiguration.
@Override
public void onNextParseConfiguration(ParseConfiguration parseConfiguration) throws IOException {
Map<String, Object> model = new HashMap<String, Object>();
ParseConfigurationOutput output = new ParseConfigurationOutput(parseConfiguration);
model.put("sentence", output);
model.put("configuration", parseConfiguration);
model.put("tokenCount", tokenCount);
model.put("relationCount", relationCount);
model.put("sentenceCount", sentenceCount);
model.put("characterCount", characterCount);
model.put("LOG", LOG);
List<DependencyArc> dependencies = new ArrayList<DependencyArc>();
for (DependencyArc dependencyArc : parseConfiguration.getRealDependencies()) {
if (!dependencyArc.getLabel().equals(punctuationDepLabel)) {
dependencies.add(dependencyArc);
}
}
model.put("dependencies", dependencies);
this.process(model, writer);
tokenCount += parseConfiguration.getPosTagSequence().size();
relationCount += dependencies.size();
characterCount += parseConfiguration.getSentence().getText().length();
sentenceCount += 1;
}
Aggregations