private void actionGotoPage(AjaxRequestTarget aTarget, Form<?> aForm) throws Exception { AnnotatorState state = getModelObject(); JCas editorCas = getEditorCas(); List<Sentence> sentences = new ArrayList<>(select(editorCas, Sentence.class)); int selectedSentence = gotoPageTextField.getModelObject(); selectedSentence = Math.min(selectedSentence, sentences.size()); gotoPageTextField.setModelObject(selectedSentence); state.setFirstVisibleUnit(sentences.get(selectedSentence - 1)); state.setFocusUnitIndex(selectedSentence); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); setCurationSegmentBeginEnd(editorCas); curationContainer.setBratAnnotatorModel(state); update(aTarget); aTarget.add(gotoPageTextField); annotationEditor.requestRender(aTarget); }
jCases = listJcasesforCorrection(randomAnnotationDocument, sourceDocument, aBModel.getMode()); mergeJCas = getMergeCas(aBModel, sourceDocument, jCases, randomAnnotationDocument, false); String username = jCases.keySet().iterator().next(); updateSegment(aBModel, segmentBeginEnd, segmentNumber, segmentAdress, jCases.get(username), username, aBModel.getWindowBeginOffset(), aBModel.getWindowEndOffset()); jCases = listJcasesforCuration(finishedAnnotationDocuments, randomAnnotationDocument, aBModel.getMode()); mergeJCas = getMergeCas(aBModel, sourceDocument, jCases, randomAnnotationDocument, false); updateSegment(aBModel, segmentBeginEnd, segmentNumber, segmentAdress, mergeJCas, WebAnnoConst.CURATION_USER, WebAnnoCasUtil.getFirstSentence(mergeJCas).getBegin(), entryTypes = getEntryTypes(mergeJCas, aBModel.getAnnotationLayers(), annotationService); long start = System.currentTimeMillis(); log.debug("Updating cross sentence annotation list..."); updateCrossSentAnnoList(segmentBeginEnd, segmentNumber, jCases, entryTypes); firstload = false; log.debug("Cross sentence annotation list complete in {}ms",
Sentence s = getSentenceByAnnoEnd(idxSentences.get(c), fs.getEnd()); int thatSent = idxSentences.get(c).indexOf(s) + 1; crossSents.add(thatSent); Sentence s = getSentenceByAnnoEnd(idxSentences.get(c), fs.getEnd()); aSegmentBeginEnd.put(sentBegin, s.getEnd());
SuggestionBuilder cb = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); upgradeCasAndSave(ad.getDocument(), ad.getUser()); Map<String, JCas> jCases = cb.listJcasesforCuration(finishedAnnotationDocuments, randomAnnotationDocument, state.getMode()); JCas mergeJCas = cb.getMergeCas(state, state.getDocument(), jCases, randomAnnotationDocument, true); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); curationContainer.setBratAnnotatorModel(state); curationPanel.getEditor().reset(aTarget);
if (aState.getMode().equals(Mode.AUTOMATION) || aState.getMode().equals(Mode.CORRECTION)) { mergeJCas = createCorrectionCas(mergeJCas, aState, randomAnnotationDocument); updateDocumentTimestampAfterWrite(aState, correctionDocumentService mergeJCas = createCurationCas(aState.getProject(), randomAnnotationDocument, jCases, aState.getAnnotationLayers());
List<Type> entryTypes = SuggestionBuilder.getEntryTypes(annotatorCas, state.getAnnotationLayers(), annotationService);
SuggestionBuilder cb = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); upgradeCasAndSave(ad.getDocument(), ad.getUser()); Map<String, JCas> jCases = cb.listJcasesforCuration(finishedAnnotationDocuments, randomAnnotationDocument, state.getMode()); JCas mergeJCas = cb.getMergeCas(state, state.getDocument(), jCases, randomAnnotationDocument, true); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); curationContainer.setBratAnnotatorModel(state); curationPanel.getEditor().reset(aTarget);
if (aState.getMode().equals(Mode.AUTOMATION) || aState.getMode().equals(Mode.CORRECTION)) { mergeJCas = createCorrectionCas(mergeJCas, aState, randomAnnotationDocument); updateDocumentTimestampAfterWrite(aState, correctionDocumentService mergeJCas = createCurationCas(aState.getProject(), randomAnnotationDocument, jCases, aState.getAnnotationLayers());
List<Type> entryTypes = getEntryTypes(mergeJCas, aAnnotationLayers, annotationService);
private void actionGotoPage(AjaxRequestTarget aTarget, Form<?> aForm) throws Exception { AnnotatorState state = getModelObject(); JCas editorCas = getEditorCas(); List<Sentence> sentences = new ArrayList<>(select(editorCas, Sentence.class)); int selectedSentence = gotoPageTextField.getModelObject(); selectedSentence = Math.min(selectedSentence, sentences.size()); gotoPageTextField.setModelObject(selectedSentence); state.setFirstVisibleUnit(sentences.get(selectedSentence - 1)); state.setFocusUnitIndex(selectedSentence); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); setCurationSegmentBeginEnd(editorCas); curationContainer.setBratAnnotatorModel(state); update(aTarget); aTarget.add(gotoPageTextField); annotationEditor.requestRender(aTarget); }
jCases = listJcasesforCorrection(randomAnnotationDocument, sourceDocument, aBModel.getMode()); mergeJCas = getMergeCas(aBModel, sourceDocument, jCases, randomAnnotationDocument, false); String username = jCases.keySet().iterator().next(); updateSegment(aBModel, segmentBeginEnd, segmentNumber, segmentAdress, jCases.get(username), username, aBModel.getWindowBeginOffset(), aBModel.getWindowEndOffset()); jCases = listJcasesforCuration(finishedAnnotationDocuments, randomAnnotationDocument, aBModel.getMode()); mergeJCas = getMergeCas(aBModel, sourceDocument, jCases, randomAnnotationDocument, false); updateSegment(aBModel, segmentBeginEnd, segmentNumber, segmentAdress, mergeJCas, WebAnnoConst.CURATION_USER, WebAnnoCasUtil.getFirstSentence(mergeJCas).getBegin(), entryTypes = getEntryTypes(mergeJCas, aBModel.getAnnotationLayers(), annotationService); long start = System.currentTimeMillis(); log.debug("Updating cross sentence annotation list..."); updateCrossSentAnnoList(segmentBeginEnd, segmentNumber, jCases, entryTypes); firstload = false; log.debug("Cross sentence annotation list complete in {}ms",
List<Type> entryTypes = SuggestionBuilder.getEntryTypes(annotatorCas, state.getAnnotationLayers(), annotationService);
Sentence s = getSentenceByAnnoEnd(idxSentences.get(c), fs.getEnd()); int thatSent = idxSentences.get(c).indexOf(s) + 1; crossSents.add(thatSent); Sentence s = getSentenceByAnnoEnd(idxSentences.get(c), fs.getEnd()); aSegmentBeginEnd.put(sentBegin, s.getEnd());
private void actionGotoPage(AjaxRequestTarget aTarget, Form<?> aForm) throws Exception { AnnotatorState state = getModelObject(); JCas editorCas = getEditorCas(); List<Sentence> sentences = new ArrayList<>(select(editorCas, Sentence.class)); int selectedSentence = gotoPageTextField.getModelObject(); selectedSentence = Math.min(selectedSentence, sentences.size()); gotoPageTextField.setModelObject(selectedSentence); state.setFirstVisibleUnit(sentences.get(selectedSentence - 1)); state.setFocusUnitIndex(selectedSentence); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); setCurationSegmentBeginEnd(editorCas); curationContainer.setBratAnnotatorModel(state); update(aTarget); aTarget.add(gotoPageTextField); annotationEditor.requestRender(aTarget); }
List<Type> entryTypes = getEntryTypes(mergeJCas, aAnnotationLayers, annotationService);
@Override protected void actionRefreshDocument(AjaxRequestTarget aTarget) { try { AnnotatorState state = getModelObject(); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); setCurationSegmentBeginEnd(getEditorCas()); curationContainer.setBratAnnotatorModel(state); update(aTarget); annotationEditor.requestRender(aTarget); } catch (Exception e) { handleException(aTarget, e); } } }
@Override protected void actionRefreshDocument(AjaxRequestTarget aTarget) { try { AnnotatorState state = getModelObject(); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); setCurationSegmentBeginEnd(getEditorCas()); curationContainer.setBratAnnotatorModel(state); update(aTarget); annotationEditor.requestRender(aTarget); } catch (Exception e) { handleException(aTarget, e); } } }
@Override protected void actionRefreshDocument(AjaxRequestTarget aTarget) { try { AnnotatorState state = getModelObject(); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); setCurationSegmentBeginEnd(getEditorCas()); curationContainer.setBratAnnotatorModel(state); update(aTarget); annotationEditor.requestRender(aTarget); } catch (Exception e) { handleException(aTarget, e); } } }
@Override protected void onChange(AjaxRequestTarget aTarget) { aTarget.addChildren(getPage(), IFeedback.class); aTarget.add(getOrCreatePositionInfoLabel()); try { AnnotatorState state = getModelObject(); JCas editorCas = getEditorCas(); //JCas correctionCas = repository.readCorrectionCas(state.getDocument()); annotationEditor.requestRender(aTarget); // info(bratAnnotatorModel.getMessage()); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); setCurationSegmentBeginEnd(editorCas); curationContainer.setBratAnnotatorModel(state); update(aTarget); } catch (Exception e) { handleException(this, aTarget, e); } }
SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); setCurationSegmentBeginEnd(getEditorCas()); curationContainer.setBratAnnotatorModel(state);