ParsingRenderer(final Appendable out, final KAFDocument document, final int sentence) { this.out = out; this.document = document; this.sentence = sentence; this.terms = document.getTermsBySent(sentence); this.deps = Lists.newArrayListWithCapacity(this.terms.size()); this.indexes = Maps.newIdentityHashMap(); for (int index = 0; index < this.terms.size(); ++index) { final Term term = this.terms.get(index); this.deps.add(document.getDepToTerm(term)); this.indexes.put(term, index); } }
public void renderParsing(final Appendable out, final KAFDocument document, @Nullable final Model model, final int sentence) throws IOException { NafRenderUtils.renderParsing(out, document, sentence, true, true, extractMarkables(document.getTermsBySent(sentence), model, this.colorMap)); }
private <T extends Appendable> T renderParsing(final T out, final KAFDocument document, @Nullable final QuadModel model, final int sentence) throws IOException { NafRenderUtils.renderParsing(out, document, sentence, true, true, extractMarkables(document.getTermsBySent(sentence), model, this.colorMap)); return out; }
sm.put("id", i); sm.put("markup", (Callable<String>) () -> { return renderText(new StringBuilder(), doc, doc.getTermsBySent(sentenceID), model) .toString(); });
if (this.type == SENTENCE_TEXT) { renderText(builder, this.document, this.document.getTermsBySent(this.sentenceID), this.model); } else if (this.type == SENTENCE_PARSING) { renderParsing(builder, this.document, this.model, this.sentenceID);