@Deprecated public Offset getOffset() { return new Offset(begin, end); }
@Deprecated public int getBeginCharacter() { return getBegin(); }
public ExtendedId(String userName, long projectId, String documentName, long layerId, Offset offset, long recommenderId, int annotationId, int sentenceId) { super(); this.userName = userName; this.projectId = projectId; this.documentName = documentName; this.layerId = layerId; this.annotationId = annotationId; this.sentenceId = sentenceId; this.recommenderId = recommenderId; this.begin = offset.getBeginCharacter(); this.end = offset.getEndCharacter(); }
public boolean overlaps(final Offset i) { // Cases: // // start end // | | // 1 ####### | // 2 | ####### // 3 #################################### // 4 | ####### | // | | return (((i.getStart() <= getStart()) && (getStart() < i.getEnd())) || // Case 1-3 ((i.getStart() < getEnd()) && (getEnd() <= i.getEnd())) || // Case 1-3 ((getStart() <= i.getStart()) && (i.getEnd() <= getEnd()))); // Case 4 } @Override
private static void printAnnotationObject(StringBuilder sb, AnnotationObject ao, String delimiter) { if (ao == null) { return; } Offset offset = ao.getOffset(); sb.append(offset.getBeginCharacter()).append("..").append(offset.getEndCharacter()); sb.append(delimiter); sb.append(offset.getBeginToken()).append("..").append(offset.getEndToken()); sb.append(delimiter); sb.append(ao.getLabel()); sb.append(delimiter); sb.append(ao.getCoveredText()); }
private List<AnnotationSuggestion> getMatchingSuggestion(List<SuggestionGroup> aSuggestions, String aDocumentName, long aLayerId, String aFeature, int aBegin, int aEnd, String aLabel) { return aSuggestions.stream() .filter(group -> aDocumentName.equals(group.getDocumentName()) && aLayerId == group.getLayerId() && (aFeature == null || aFeature == group.getFeature()) && (aBegin == -1 || aBegin == group.getOffset().getBegin()) && (aEnd == -1 || aEnd == group.getOffset().getEnd())) .flatMap(group -> group.stream()) .filter(suggestion -> aLabel == null || aLabel.equals(suggestion.getLabel())) .collect(toList()); }
@Deprecated public int getEndCharacter() { return getEnd(); }
Offset offsetExpected = aoExpected.getOffset(); Offset offsetGenerated = aoGenerated.getOffset(); if (offsetExpected.getBeginCharacter() < offsetGenerated.getBeginCharacter()) { printAnnotationObjectComparison(sb, aoExpected, null, EXCEL_DELIMITER); if (itExpected.hasNext()) { else if (offsetExpected.getBeginCharacter() > offsetGenerated.getBeginCharacter()) { printAnnotationObjectComparison(sb, null, aoGenerated, EXCEL_DELIMITER); if (itGenerated.hasNext()) {
AnnotationSuggestion suggestion = alState.getSuggestion().get(); if ( acceptedSuggestion.getOffset().equals(suggestion.getOffset()) && vid.getLayerId() == suggestion.getLayerId() && acceptedSuggestion.getFeature().equals(suggestion.getFeature())
private List<AnnotationSuggestion> getMatchingSuggestion(List<SuggestionGroup> aSuggestions, String aDocumentName, long aLayerId, String aFeature, int aBegin, int aEnd, String aLabel) { return aSuggestions.stream() .filter(group -> aDocumentName.equals(group.getDocumentName()) && aLayerId == group.getLayerId() && (aFeature == null || aFeature == group.getFeature()) && (aBegin == -1 || aBegin == group.getOffset().getBegin()) && (aEnd == -1 || aEnd == group.getOffset().getEnd())) .flatMap(group -> group.stream()) .filter(suggestion -> aLabel == null || aLabel.equals(suggestion.getLabel())) .collect(toList()); }
private static void printAnnotationObjectInverted(StringBuilder sb, AnnotationObject ao, String delimiter) { if (ao == null) { return; } Offset offset = ao.getOffset(); sb.append(ao.getCoveredText()); sb.append(delimiter); sb.append(ao.getLabel()); sb.append(delimiter); sb.append(offset.getBeginToken()).append("..").append(offset.getEndToken()); sb.append(delimiter); sb.append(offset.getBeginCharacter()).append("..").append(offset.getEndCharacter()); } }
AnnotationSuggestion suggestion = alState.getSuggestion().get(); if ( acceptedSuggestion.getOffset().equals(suggestion.getOffset()) && vid.getLayerId() == suggestion.getLayerId() && acceptedSuggestion.getFeature().equals(suggestion.getFeature())
private void stepB() { _stepCount++; _nb = _ib.nextIndex(); _curb = _ib.next(); if (_log.isTraceEnabled()) { _log.trace(" -> B: " + _nb + "/" + _maxb + " " + _curb); } if (_curb.getBeginCharacter() < _cura.getEndCharacter()) { // Rewind A to the point where it was when we last stepped // up B. rewindA(); } else { _last_b_step_na = _na; } }
/** * @deprecated Better use {@link #getBegin()} and {@link #getEnd()} */ @Deprecated public Offset getOffset() { return new Offset(begin, end); }
@Deprecated public int getStart() { return getBegin(); }
while ((_na > _last_b_step_na) && (_cura.getEndCharacter() > _curb.getBeginCharacter())) { stepBackA(); steppedBack = true;
private void setHighlight(AnnotationSuggestion aSuggestion) { if (protectHighlight) { LOG.trace("Active learning sidebar not updating protected highlights"); protectHighlight = false; return; } LOG.trace("Active learning sidebar set highlight suggestion: {}", aSuggestion); highlightVID = aSuggestion.getVID(); highlightSpan = new Offset(aSuggestion.getBegin(), aSuggestion.getEnd()); highlightDocumentName = aSuggestion.getDocumentName(); }