/** * Returns the first prediction that matches recommendationId and recommenderId * in the given document. */ public Optional<AnnotationSuggestion> getPredictionByVID(SourceDocument aDocument, VID aVID) { return predictions.values().stream() .filter(f -> f.getDocumentName().equals(aDocument.getName())) .filter(f -> f.getId() == aVID.getSubId()) .filter(f -> f.getRecommenderId() == aVID.getId()) .findFirst(); }
@Override public void indexDocument(SourceDocument aDocument, JCas aJCas) throws IOException { indexDocument(aDocument.getName(), aDocument.getId(), -1, "", aJCas); };
@Override public File getSourceDocumentFile(SourceDocument aDocument) { Validate.notNull(aDocument, "Source document must be specified"); File documentUri = new File(repositoryProperties.getPath().getAbsolutePath() + "/" + PROJECT_FOLDER + "/" + aDocument.getProject().getId() + "/" + DOCUMENT_FOLDER + "/" + aDocument.getId() + "/" + SOURCE_FOLDER); return new File(documentUri, aDocument.getName()); }
@Override public File getSourceDocumentFile(SourceDocument aDocument) { Validate.notNull(aDocument, "Source document must be specified"); File documentUri = new File(repositoryProperties.getPath().getAbsolutePath() + "/" + PROJECT_FOLDER + "/" + aDocument.getProject().getId() + "/" + DOCUMENT_FOLDER + "/" + aDocument.getId() + "/" + SOURCE_FOLDER); return new File(documentUri, aDocument.getName()); }
@Override public void analyzeAndRepair(SourceDocument aDocument, String aUsername, CAS aCas) { analyzeAndRepair(aDocument.getProject(), aDocument.getName(), aDocument.getId(), aUsername, aCas); }
public RDocument(SourceDocument aDocument) { id = aDocument.getId(); name = aDocument.getName(); state = AeroRemoteApiController.sourceDocumentStateToString(aDocument.getState()); }
public RDocument(SourceDocument aDocument) { id = aDocument.getId(); name = aDocument.getName(); state = AeroRemoteApiController.sourceDocumentStateToString(aDocument.getState()); }
@Override public void analyzeAndRepair(SourceDocument aDocument, String aUsername, CAS aCas) { analyzeAndRepair(aDocument.getProject(), aDocument.getName(), aDocument.getId(), aUsername, aCas); }
private void setHighlight(SourceDocument aDocument, AnnotationFS aAnnotation) { LOG.trace("Active learning sidebar set highlight annotation: {}", aAnnotation); highlightVID = new VID(WebAnnoCasUtil.getAddr(aAnnotation)); highlightSpan = new Offset(aAnnotation.getBegin(), aAnnotation.getEnd()); highlightDocumentName = aDocument.getName(); protectHighlight = false; }
@Override public void onRequest() { SourceDocument doc = aModel.getObject().getDocument(); File pdfFile = documentService.getSourceDocumentFile(doc); getRequestCycle().scheduleRequestHandlerAfterCurrent( new ResourceStreamRequestHandler(new FileResourceStream(pdfFile), doc.getName())); } });
@Override public void onRequest() { SourceDocument doc = aModel.getObject().getDocument(); File pdfFile = documentService.getSourceDocumentFile(doc); getRequestCycle().scheduleRequestHandlerAfterCurrent( new ResourceStreamRequestHandler(new FileResourceStream(pdfFile), doc.getName())); } });
@Override protected void onConfigure() { super.onConfigure(); setEnabled(state.getDocument() != null && !documentService .getSourceDocument(state.getDocument().getProject(), state.getDocument().getName()) .getState().equals(SourceDocumentState.CURATION_FINISHED)); }
private List<AnnotationSuggestion> getMatchingSuggestion(List<SuggestionGroup> aSuggestions, LearningRecord aRecord) { return getMatchingSuggestion(aSuggestions, aRecord.getSourceDocument().getName(), aRecord.getLayer().getId(), aRecord.getAnnotationFeature().getName(), aRecord.getOffsetCharacterBegin(), aRecord.getOffsetCharacterEnd(), aRecord.getAnnotation()); }
@Override protected void onConfigure() { super.onConfigure(); setEnabled(state.getDocument() != null && !documentService .getSourceDocument(state.getDocument().getProject(), state.getDocument().getName()) .getState().equals(SourceDocumentState.CURATION_FINISHED)); }
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = CurationPage.this.getModelObject(); setEnabled(state.getProject() != null && state.getDocument() != null && !documentService .getSourceDocument(state.getDocument().getProject(), state.getDocument().getName()) .getState().equals(SourceDocumentState.CURATION_FINISHED)); } });
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = CurationPage.this.getModelObject(); setEnabled(state.getProject() != null && state.getDocument() != null && !documentService .getSourceDocument(state.getDocument().getProject(), state.getDocument().getName()) .getState().equals(SourceDocumentState.CURATION_FINISHED)); } });
public DocumentStateChangeMessage(DocumentStateChangedEvent aEvent) { projectId = aEvent.getDocument().getProject().getId(); projectName = aEvent.getDocument().getProject().getName(); documentId = aEvent.getDocument().getId(); documentName = aEvent.getDocument().getName(); documentState = AeroRemoteApiController.sourceDocumentStateToString(aEvent.getNewState()); documentPreviousState = AeroRemoteApiController .sourceDocumentStateToString(aEvent.getPreviousState()); }
public DocumentStateChangeMessage(DocumentStateChangedEvent aEvent) { projectId = aEvent.getDocument().getProject().getId(); projectName = aEvent.getDocument().getProject().getName(); documentId = aEvent.getDocument().getId(); documentName = aEvent.getDocument().getName(); documentState = AeroRemoteApiController.sourceDocumentStateToString(aEvent.getNewState()); documentPreviousState = AeroRemoteApiController .sourceDocumentStateToString(aEvent.getPreviousState()); }
public AnnotationStateChangeMessage(AnnotationStateChangeEvent aEvent) { projectId = aEvent.getDocument().getProject().getId(); projectName = aEvent.getDocument().getProject().getName(); documentId = aEvent.getDocument().getId(); documentName = aEvent.getDocument().getName(); annotationUser = aEvent.getAnnotationDocument().getUser(); annotationState = AeroRemoteApiController .annotationDocumentStateToString(aEvent.getNewState()); annotationPreviousState = AeroRemoteApiController .annotationDocumentStateToString(aEvent.getPreviousState()); }
public AnnotationStateChangeMessage(AnnotationStateChangeEvent aEvent) { projectId = aEvent.getDocument().getProject().getId(); projectName = aEvent.getDocument().getProject().getName(); documentId = aEvent.getDocument().getId(); documentName = aEvent.getDocument().getName(); annotationUser = aEvent.getAnnotationDocument().getUser(); annotationState = AeroRemoteApiController .annotationDocumentStateToString(aEvent.getNewState()); annotationPreviousState = AeroRemoteApiController .annotationDocumentStateToString(aEvent.getPreviousState()); }