metadata.add(CTAKES_META_PREFIX + annotation.getType().getShortName(), annotationBuilder.toString());
@Override public String toString() { return this.type.getShortName(); } }
@Override public int compare(Type o1, Type o2) { return o1.getShortName().compareTo(o2.getShortName()); } });
@Override public String getText(Object element) { Type type = (Type) element; Character key = typeShortcutMap.get(type); if (key != null) { return "[" + key + "] " + type.getShortName(); } else { return type.getShortName(); } }
@Override public int compare(Object o1, Object o2) { Type t1 = (Type) o1; Type t2 = (Type) o2; return t1.getShortName().compareTo(t2.getShortName()); } });
private static boolean getIfThereIsDependency(Collection<AnnotationFS> col) { for (AnnotationFS annotationFS : col) { Type type = annotationFS.getType(); String typeShortName = type.getShortName(); if(typeShortName.equals("Dependency")) return true; } return false; }
public String verbalizeType(Type type) { if (type.getName().equals("uima.tcas.DocumentAnnotation")) { return "Document"; } else { return type.getShortName(); } }
@Override public void print(StringBuilder out, FST value) { out.append("type=").append(value.getType().getShortName()); } }
private void fillTypeNameMap(Map<String, String> typeNameMap, TypeSystem typeSystem) { Iterator<Type> typeIterator = typeSystem.getTypeIterator(); while (typeIterator.hasNext()) { Type type = typeIterator.next(); String shortName = type.getShortName(); String name = type.getName(); typeNameMap.put(shortName, name); } }
public CompositeMatcher<AnnotationFS> createTargetMatcher(Type targetType) { String matcherId = targetType.getShortName(); AnnotationMatcherBuilder builder = (AnnotationMatcherBuilder) getBuilder( matcherId, targetType); return builder.build(); }
@Override public void modeChanged(Type newMode) { IAction actionToExecute = new ChangeModeAction(newMode, newMode.getShortName(), AnnotationEditor.this); actionToExecute.run(); }});
void traceFSfs(FeatureStructureImpl fs) { StringBuilder b = svd.traceFScreationSb; svd.traceFSid = fs.getAddress(); b.append("c:").append(String.format("%-3d", getCasId())); String viewName = fs.getCAS().getViewName(); if (null == viewName) { viewName = "base"; } b.append(" v:").append(MiscImpl.elide(viewName, 8)); b.append(" i:").append(String.format("%-5s", fs.getAddress())); b.append(" t:").append(MiscImpl.elide(fs.getType().getShortName(), 10)); }
private Type getType(String annotationType) { for(Type type:Lists.newArrayList(actual.getTypeSystem().getTypeIterator())) { if(type.getName().equals(annotationType)) return type; else if(type.getShortName().equals(annotationType)) return type; } throw new IllegalArgumentException("No such type found: " + annotationType); }
public List<Feature> extract(JCas view, T focusAnnotation) throws CleartkExtractorException { List<Feature> flist = new LinkedList<Feature>(); for (Annotation anno : JCasUtil.select(view, goalClass)) { Feature f = new Feature(); f.setName("subtype"); f.setValue(anno.getType().getShortName()); flist.add(f); } return flist; }
private static String createStrRepr(final Annotation source) { return String.format("[%d, %d, %s]", source.getBegin(), source.getEnd(), source.getType().getShortName()); }
@Override public String getTypeName() { if (getItem() == null) { return "Root"; } else { return getItem().getType().getShortName(); } }
/** * Formats argument unit to string with type, position, and text content * * @param argumentUnit argument unit * @return string */ public static String argumentUnitToString(ArgumentUnit argumentUnit) { return String.format("%s [%d, %d] \"%s\"", argumentUnit.getType().getShortName(), argumentUnit.getBegin(), argumentUnit.getEnd(), argumentUnit.getCoveredText()); }
@Override public String getTypeName() { if (getItem() == null) { return "Root"; } else { return getItem().getType().getShortName(); } }
private static int getAnnotationId(final Annotation source, final Sparse3DObjectMatrix<String, ImmutableSpanTextLabel> spanAnnotationMatrix, final Object2IntMap<ImmutableSpanTextLabel> spanAnnotationIds) { final int begin = source.getBegin(); final int end = source.getEnd(); final String label = source.getType().getShortName(); final SpanTextLabel spanAnnotation = spanAnnotationMatrix.get3DValue(begin, end, label); return spanAnnotation == null ? -1 : spanAnnotationIds.getInt(spanAnnotation); }
@Override public ImmutableSpanTextLabel apply(final Annotation annotation) { final ImmutableSpan span = new ImmutableSpan(annotation.getBegin(), annotation.getEnd()); final ImmutableSpanText spanText = new ImmutableSpanText(span, annotation.getCoveredText()); final Map<Attribute, Object> attrs = createAttrMap(annotation); return new ImmutableSpanTextLabel(spanText, annotation.getType().getShortName(), attrs); }