public void add(VArc aArc) { if (arcs.containsKey(aArc.getVid()) || spans.containsKey(aArc.getVid())) { throw new IllegalStateException("Annotation [" + aArc.getVid() + "] already exists."); } arcs.put(aArc.getVid(), aArc); annotationLayers.put(aArc.getLayer().getId(), aArc.getLayer()); arcsByLayer.put(aArc.getLayer().getId(), aArc); }
if (varc.getLabelHint() == null) { bratLabelText = TypeUtil.getUiLabelText(typeAdapter, varc.getFeatures()); bratLabelText = varc.getLabelHint(); if (varc.getColorHint() == null) { color = getColor(varc, coloringStrategy, bratLabelText); } else { color = varc.getColorHint(); aResponse.addRelation(new Relation(varc.getVid(), varc.getType(), getArgument(varc.getSource(), varc.getTarget()), bratLabelText, color));
if (varc.getLabelHint() == null) { labelText = TypeUtil.getUiLabelText(typeAdapter, varc.getFeatures()); labelText = varc.getLabelHint(); if (varc.getColorHint() == null) { color = getColor(varc, coloringStrategy, labelText); } else { color = varc.getColorHint(); new Relation(varc.getSource().toString(), varc.getTarget().toString(), color));
@Override public void onRender(TypeAdapter aAdapter, VDocument aResponse, Map<AnnotationFS, VArc> aAnnoToArcIdx) { if (aAdapter.getLayer().isCrossSentence()) { return; } try { for (Entry<AnnotationFS, VArc> e : aAnnoToArcIdx.entrySet()) { JCas jcas = e.getKey().getCAS().getJCas(); if (!isBeginInSameSentence(jcas, selectByAddr(jcas, e.getValue().getSource().getId()).getBegin(), selectByAddr(jcas, e.getValue().getTarget().getId()).getBegin())) { aResponse.add(new VComment(new VID(e.getKey()), ERROR, "Crossing sentence bounardies is not permitted.")); } } } catch (CASException e) { throw new IllegalStateException("Unable to obtain JCas"); } }
VArc arc = new VArc(typeAdapter.getLayer(), fs, bratTypeName, governorFs, dependentFs, features);
if (varc.getLabelHint() == null) { bratLabelText = TypeUtil.getUiLabelText(typeAdapter, varc.getFeatures()); bratLabelText = varc.getLabelHint(); if (varc.getColorHint() == null) { color = getColor(varc, coloringStrategy, bratLabelText); } else { color = varc.getColorHint(); aResponse.addRelation(new Relation(varc.getVid(), varc.getType(), getArgument(varc.getSource(), varc.getTarget()), bratLabelText, color));
if (varc.getLabelHint() == null) { labelText = TypeUtil.getUiLabelText(typeAdapter, varc.getFeatures()); labelText = varc.getLabelHint(); if (varc.getColorHint() == null) { color = getColor(varc, coloringStrategy, labelText); } else { color = varc.getColorHint(); new Relation(varc.getSource().getId(), varc.getTarget().getId(), color));
@Override public void onRender(TypeAdapter aAdapter, VDocument aResponse, Map<AnnotationFS, VArc> aAnnoToArcIdx) { if (aAdapter.getLayer().isCrossSentence()) { return; } try { for (Entry<AnnotationFS, VArc> e : aAnnoToArcIdx.entrySet()) { JCas jcas = e.getKey().getCAS().getJCas(); if (!isBeginInSameSentence(jcas, selectByAddr(jcas, e.getValue().getSource().getId()).getBegin(), selectByAddr(jcas, e.getValue().getTarget().getId()).getBegin())) { aResponse.add(new VComment(new VID(e.getKey()), ERROR, "Crossing sentence bounardies is not permitted.")); } } } catch (CASException e) { throw new IllegalStateException("Unable to obtain JCas"); } }
VArc arc = new VArc(typeAdapter.getLayer(), fs, bratTypeName, governorFs, dependentFs, features);
public void add(VArc aArc) { if (arcs.containsKey(aArc.getVid()) || spans.containsKey(aArc.getVid())) { throw new IllegalStateException("Annotation [" + aArc.getVid() + "] already exists."); } arcs.put(aArc.getVid(), aArc); annotationLayers.put(aArc.getLayer().getId(), aArc.getLayer()); arcsByLayer.put(aArc.getLayer().getId(), aArc); }
aResponse.add(new VArc(typeAdapter.getLayer(), new VID(prevLinkFs, 1, VID.NONE, VID.NONE), bratTypeName, prevLinkFs, linkFs, colorIndex, singletonMap("label", bratLabelText)));
aResponse.add(new VArc(typeAdapter.getLayer(), new VID(prevLinkFs, 1, VID.NONE, VID.NONE), bratTypeName, prevLinkFs, linkFs, colorIndex, singletonMap("label", bratLabelText)));
LinkWithRoleModel link = links.get(li); FeatureStructure targetFS = selectByAddr(fs.getCAS(), link.targetAddr); aResponse.add(new VArc(typeAdapter.getLayer(), new VID(fs, fi, li), bratTypeName, fs, targetFS, link.role, features));
LinkWithRoleModel link = links.get(li); FeatureStructure targetFS = selectByAddr(fs.getCAS(), link.targetAddr); aResponse.add(new VArc(typeAdapter.getLayer(), new VID(fs, fi, li), bratTypeName, fs, targetFS, link.role, features));