protected String getOutcomeSuffix(CHUNK_TYPE chunk, Feature feature) { return feature == null ? "" : "-" + chunk.getFeatureValueAsString(feature); }
public static void removeInconsistentAttributes(Element element, Annotation annotation, JCas jCas) { for (NamePair names : timemlAttributeLists.get(element.getName().toUpperCase())) { String newValue = element.getAttributeValue(names.timemlName); String className = annotation.getClass().getName(); String uimaName = String.format("%s:%s", className, names.uimaName); Feature feature = jCas.getTypeSystem().getFeatureByFullName(uimaName); String oldValue = annotation.getFeatureValueAsString(feature); if (oldValue != null && !oldValue.equals(newValue)) { annotation.setFeatureValueFromString(feature, null); } } }
public static void removeInconsistentAttributes(Element element, Annotation annotation, JCas jCas) { for (NamePair names : timemlAttributeLists.get(element.getName().toUpperCase())) { String newValue = element.getAttributeValue(names.timemlName); String className = annotation.getClass().getName(); String uimaName = String.format("%s:%s", className, names.uimaName); Feature feature = jCas.getTypeSystem().getFeatureByFullName(uimaName); String oldValue = annotation.getFeatureValueAsString(feature); if (oldValue != null && !oldValue.equals(newValue)) { annotation.setFeatureValueFromString(feature, null); } } }
public String getMarkdownString(JCas jcas) { Feature feat = jcas.getTypeSystem().getType(type).getFeatureByBaseName(featureName); SortedSet<Insertion> insertions = new TreeSet<Insertion>(); for (Annotation a : JCasUtil.select(jcas, clazz)) { insertions.add(new Insertion(beginMark, a.getBegin())); insertions.add(new Insertion(endMark + "~" + a.getFeatureValueAsString(feat) + "~", a.getEnd())); } StringBuilder exportString = new StringBuilder(jcas.getDocumentText()); for (Insertion ins : insertions) { exportString.insert(ins.position, ins.content); } if (doubleNewline) return exportString.toString().replaceAll("\n", "\n\n"); else return exportString.toString().replaceAll("\n", " \n"); }
if (currentValue == null) continue; String mergedValue = mergedAnno.getFeatureValueAsString(feature); if (!featureValuesPriorities.containsKey(feature)) { logger.info("featureValuesPriorities doesn't have feature: " + feature);
if (feature.getDomain().equals(type)) { if (feature.getRange().getName().equals("uima.cas.String")) { if (anno == null || anno.getFeatureValueAsString(feature) == null) { p.print(null); } else p.print(anno.getFeatureValueAsString(feature)); } else if (feature.getRange().getName().equals("uima.cas.Integer")) { p.print(anno.getIntValue(feature));