private void buildDocumentQuotesList() { this.quotes = QuoteAnnotator.gatherQuotes(this.annotationDocument).stream(). map(coreMapQuote -> new CoreQuote(this, coreMapQuote)).collect(Collectors.toList()); }
public static List<CoreMap> gatherQuotes(CoreMap curr) { List<CoreMap> embedded = curr.get(CoreAnnotations.QuotationsAnnotation.class); if (embedded != null) { List<CoreMap> extended = Generics.newArrayList(); for (CoreMap quote : embedded) { extended.addAll(gatherQuotes(quote)); } extended.addAll(embedded); return extended; } else { return Generics.newArrayList(); } }
/** complete the wrapping process post annotation by a pipeline **/ public void wrapAnnotations() { // wrap all of the sentences if (this.annotationDocument.get(CoreAnnotations.SentencesAnnotation.class) != null) { wrapSentences(); // if there are entity mentions, build a document wide list if ( ! sentences.isEmpty() && sentences.get(0).entityMentions() != null) { buildDocumentEntityMentionsList(); } // if there are quotes, build a document wide list if (QuoteAnnotator.gatherQuotes(this.annotationDocument) != null) buildDocumentQuotesList(); } }
pw.println(); pw.println("Extracted quotes: "); List<CoreMap> allQuotes = QuoteAnnotator.gatherQuotes(annotation); for (CoreMap quote : allQuotes) { String speakerString;
for (CoreMap quote : QuoteAnnotator.gatherQuotes(annotation)) { Integer firstSpeakerTokenIndex = quote.get(MentionBeginAnnotation.class); if (firstSpeakerTokenIndex != null) {
List<CoreMap> quotes = QuoteAnnotator.gatherQuotes(doc); l1.set("quotes", quotes.stream().map(quote -> (Consumer<Writer>) (Writer l2) -> { l2.set("id", quote.get(CoreAnnotations.QuotationIndexAnnotation.class));
private void buildDocumentQuotesList() { this.quotes = QuoteAnnotator.gatherQuotes(this.annotationDocument).stream(). map(coreMapQuote -> new CoreQuote(this, coreMapQuote)).collect(Collectors.toList()); }
public static List<CoreMap> gatherQuotes(CoreMap curr) { List<CoreMap> embedded = curr.get(CoreAnnotations.QuotationsAnnotation.class); if (embedded != null) { List<CoreMap> extended = Generics.newArrayList(); for (CoreMap quote : embedded) { extended.addAll(gatherQuotes(quote)); } extended.addAll(embedded); return extended; } else { return Generics.newArrayList(); } }
/** complete the wrapping process post annotation by a pipeline **/ public void wrapAnnotations() { // wrap all of the sentences if (this.annotationDocument.get(CoreAnnotations.SentencesAnnotation.class) != null) { wrapSentences(); // if there are entity mentions, build a document wide list if ( ! sentences.isEmpty() && sentences.get(0).entityMentions() != null) { buildDocumentEntityMentionsList(); } // if there are quotes, build a document wide list if (QuoteAnnotator.gatherQuotes(this.annotationDocument) != null) buildDocumentQuotesList(); } }
pw.println(); pw.println("Extracted quotes: "); List<CoreMap> allQuotes = QuoteAnnotator.gatherQuotes(annotation); for (CoreMap quote : allQuotes) { String speakerString;
for (CoreMap quote : QuoteAnnotator.gatherQuotes(annotation)) { Integer firstSpeakerTokenIndex = quote.get(MentionBeginAnnotation.class); if (firstSpeakerTokenIndex != null) {
List<CoreMap> quotes = QuoteAnnotator.gatherQuotes(doc); l1.set("quotes", quotes.stream().map(quote -> (Consumer<Writer>) (Writer l2) -> { l2.set("id", quote.get(CoreAnnotations.QuotationIndexAnnotation.class));