/** return the canonical entity mention for this entity mention **/ public Optional<CoreEntityMention> canonicalEntityMention() { CoreDocument myDocument = sentence.document(); Optional<Integer> canonicalEntityMentionIndex = Optional.ofNullable(coreMap().get(CoreAnnotations.CanonicalEntityMentionIndexAnnotation.class)); return canonicalEntityMentionIndex.isPresent() ? Optional.of(sentence.document().entityMentions().get(canonicalEntityMentionIndex.get())) : Optional.empty(); }
speakerTokens.get().size() - 1).get(CoreAnnotations.CharacterOffsetEndAnnotation.class); this.speakerCharOffsets = Optional.of(new Pair<>(speakerCharOffsetBegin, speakerCharOffsetEnd)); for (CoreEntityMention candidateEntityMention : this.document.entityMentions()) { Pair<Integer,Integer> entityMentionOffsets = candidateEntityMention.charOffsets(); if (entityMentionOffsets.equals(this.speakerCharOffsets.get())) { canonicalSpeakerTokens.get().size() - 1).get(CoreAnnotations.CharacterOffsetEndAnnotation.class); this.canonicalSpeakerCharOffsets = Optional.of(new Pair<>(canonicalSpeakerCharOffsetBegin, canonicalSpeakerCharOffsetEnd)); for (CoreEntityMention candidateEntityMention : this.document.entityMentions()) { Pair<Integer,Integer> entityMentionOffsets = candidateEntityMention.charOffsets(); if (entityMentionOffsets.equals(this.canonicalSpeakerCharOffsets.get())) {
/** return the canonical entity mention for this entity mention **/ public Optional<CoreEntityMention> canonicalEntityMention() { CoreDocument myDocument = sentence.document(); Optional<Integer> canonicalEntityMentionIndex = Optional.ofNullable(coreMap().get(CoreAnnotations.CanonicalEntityMentionIndexAnnotation.class)); return canonicalEntityMentionIndex.isPresent() ? Optional.of(sentence.document().entityMentions().get(canonicalEntityMentionIndex.get())) : Optional.empty(); }
speakerTokens.get().size() - 1).get(CoreAnnotations.CharacterOffsetEndAnnotation.class); this.speakerCharOffsets = Optional.of(new Pair<>(speakerCharOffsetBegin, speakerCharOffsetEnd)); for (CoreEntityMention candidateEntityMention : this.document.entityMentions()) { Pair<Integer,Integer> entityMentionOffsets = candidateEntityMention.charOffsets(); if (entityMentionOffsets.equals(this.speakerCharOffsets.get())) { canonicalSpeakerTokens.get().size() - 1).get(CoreAnnotations.CharacterOffsetEndAnnotation.class); this.canonicalSpeakerCharOffsets = Optional.of(new Pair<>(canonicalSpeakerCharOffsetBegin, canonicalSpeakerCharOffsetEnd)); for (CoreEntityMention candidateEntityMention : this.document.entityMentions()) { Pair<Integer,Integer> entityMentionOffsets = candidateEntityMention.charOffsets(); if (entityMentionOffsets.equals(this.canonicalSpeakerCharOffsets.get())) {