protected Feature getFeature(JCas jCas) { String name = this.featureFullName; return name == null ? null : jCas.getTypeSystem().getFeatureByFullName(name); }
public static void copyAttributes(Element element, Annotation annotation, JCas jCas) { for (NamePair names : timemlAttributeLists.get(element.getName().toUpperCase())) { String featureValue = element.getAttributeValue(names.timemlName); if (featureValue != null) { String className = annotation.getClass().getName(); String uimaName = String.format("%s:%s", className, names.uimaName); Feature feature = jCas.getTypeSystem().getFeatureByFullName(uimaName); annotation.setFeatureValueFromString(feature, featureValue); } } }
public static void copyAttributes(Element element, Annotation annotation, JCas jCas) { for (NamePair names : timemlAttributeLists.get(element.getName().toUpperCase())) { String featureValue = element.getAttributeValue(names.timemlName); if (featureValue != null) { String className = annotation.getClass().getName(); String uimaName = String.format("%s:%s", className, names.uimaName); Feature feature = jCas.getTypeSystem().getFeatureByFullName(uimaName); annotation.setFeatureValueFromString(feature, featureValue); } } }
public DefaultAnnotationComparator(CASImpl cas) { super(); this.cas = cas; this.startCode = ((FeatureImpl) cas.getTypeSystem().getFeatureByFullName( CAS.FEATURE_BASE_NAME_BEGIN)).getCode(); this.endCode = ((FeatureImpl) cas.getTypeSystem().getFeatureByFullName( CAS.FEATURE_BASE_NAME_END)).getCode(); }
/** * @see org.apache.uima.cas.ArrayFS#size() This method is duplicated in * org.apache.uima.jcas.cas.Sofa. Any changes should be made in both places. */ public String getLocalStringData() { final Feature stringFeat = this.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFASTRING); return this.getStringValue(stringFeat); }
/** * @see org.apache.uima.cas.SofaFS#getLocalStringData() This method is duplicated in SofaFSImpl. * Any changes should be made in both places. */ public String getLocalStringData() { final Feature stringFeat = jcasType.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFASTRING); return this.getStringValue(stringFeat); }
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); } } }
/** * @see org.apache.uima.cas.SofaFS#getSofaID() This method is duplicated in * org.apache.uima.jcas.cas.Sofa. Any changes should be made in both places. */ public String getSofaID() { final Feature sofaIDFeat = this.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFAID); return this.getStringValue(sofaIDFeat); } }
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 Feature getFeature(AnnotationFS annotation) { if(f==null) { /* * TODO Ensure that the Feature will be reset for a new TypeSystem */ f = annotation.getCAS().getTypeSystem().getFeatureByFullName(feature); } return f; }
/** * @see org.apache.uima.cas.ArrayFS#size() This method is duplicated in * org.apache.uima.jcas.cas.Sofa. Any changes should be made in both places. */ public FeatureStructure getLocalFSData() { final Feature arrayFeat = this.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFAARRAY); return this.getFeatureValue(arrayFeat); }
/** * @see org.apache.uima.cas.SofaFS#getLocalFSData() This method is duplicated in SofaFSImpl. Any * changes should be made in both places. */ public FeatureStructure getLocalFSData() { final Feature arrayFeat = jcasType.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFAARRAY); return this.getFeatureValue(arrayFeat); }
private boolean isSofaDataSet() { final Feature uriFeat = this.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFAURI); final Feature arrayFeat = this.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFAARRAY); final Feature stringFeat = this.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFASTRING); if (null != this.getStringValue(uriFeat) || null != this.getFeatureValue(arrayFeat) || null != this.getStringValue(stringFeat)) { return true; } return false; }
public String getSofaURI() { final Feature uriFeat = jcasType.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFAURI); return jcasType.casImpl.getLowLevelCAS().ll_getStringValue(super.addr, ((FeatureImpl) uriFeat).getCode()); }
public int getSofaRef() { final Feature numFeat = jcasType.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFANUM); return jcasType.casImpl.getLowLevelCAS().ll_getIntValue(super.addr, ((FeatureImpl) numFeat).getCode()); }
public String getSofaMime() { final Feature mimeFeat = this.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFAMIME); return this.casImpl.getLowLevelCAS().ll_getStringValue(super.addr, ((FeatureImpl) mimeFeat).getCode()); }
public String getSofaURI() { final Feature uriFeat = this.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFAURI); return this.casImpl.getLowLevelCAS().ll_getStringValue(super.addr, ((FeatureImpl) uriFeat).getCode()); }
public int getSofaRef() { final Feature numFeat = this.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFANUM); return this.casImpl.getLowLevelCAS().ll_getIntValue(super.addr, ((FeatureImpl) numFeat).getCode()); }
public String getSofaMime() { final Feature mimeFeat = jcasType.casImpl.getTypeSystem().getFeatureByFullName( CAS.FEATURE_FULL_NAME_SOFAMIME); return jcasType.casImpl.getLowLevelCAS().ll_getStringValue(super.addr, ((FeatureImpl) mimeFeat).getCode()); }
void setDocTextFromDeserializtion(String text) { if (mySofaIsValid()) { final int SofaStringCode = ll_getTypeSystem().ll_getCodeForFeature( this.getTypeSystem().getFeatureByFullName(CAS.FEATURE_FULL_NAME_SOFASTRING)); ll_setStringValue(this.getSofaRef(), SofaStringCode, text); } }