/*
* Copyright 2016
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* First created by JCasGen Fri Jun 17 19:10:16 CEST 2016 */
package de.tudarmstadt.ukp.dkpro.core.api.segmentation.type;
import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.JCasRegistry;
import org.apache.uima.cas.impl.CASImpl;
import org.apache.uima.cas.impl.FSGenerator;
import org.apache.uima.cas.FeatureStructure;
import org.apache.uima.cas.impl.TypeImpl;
import org.apache.uima.cas.Type;
import org.apache.uima.cas.impl.FeatureImpl;
import org.apache.uima.cas.Feature;
import org.apache.uima.jcas.tcas.Annotation_Type;
/** This annotation can be used to indicate an alternate surface form. E.g. some corpora consider a normalized form of the text with resolved contractions as the canonical form and only maintain the original surface form as a secondary information. One example is the Conll-U format.
* Updated by JCasGen Fri Jun 17 19:10:16 CEST 2016
* @generated */
public class SurfaceForm_Type extends Annotation_Type {
/** @generated
* @return the generator for this type
*/
@Override
protected FSGenerator getFSGenerator() {return fsGenerator;}
/** @generated */
private final FSGenerator fsGenerator =
new FSGenerator() {
@Override
public FeatureStructure createFS(int addr, CASImpl cas) {
if (SurfaceForm_Type.this.useExistingInstance) {
// Return eq fs instance if already created
FeatureStructure fs = SurfaceForm_Type.this.jcas.getJfsFromCaddr(addr);
if (null == fs) {
fs = new SurfaceForm(addr, SurfaceForm_Type.this);
SurfaceForm_Type.this.jcas.putJfsFromCaddr(addr, fs);
return fs;
}
return fs;
}
else {
return new SurfaceForm(addr, SurfaceForm_Type.this);
}
}
};
/** @generated */
@SuppressWarnings ("hiding")
public final static int typeIndexID = SurfaceForm.typeIndexID;
/** @generated
@modifiable */
@SuppressWarnings ("hiding")
public final static boolean featOkTst = JCasRegistry.getFeatOkTst("de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.SurfaceForm");
/** @generated */
final Feature casFeat_value;
/** @generated */
final int casFeatCode_value;
/** @generated
* @param addr low level Feature Structure reference
* @return the feature value
*/
public String getValue(int addr) {
if (featOkTst && casFeat_value == null) {
jcas.throwFeatMissing("value", "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.SurfaceForm");
}
return ll_cas.ll_getStringValue(addr, casFeatCode_value);
}
/** @generated
* @param addr low level Feature Structure reference
* @param v value to set
*/
public void setValue(int addr, String v) {
if (featOkTst && casFeat_value == null) {
jcas.throwFeatMissing("value", "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.SurfaceForm");
}
ll_cas.ll_setStringValue(addr, casFeatCode_value, v);}
/** initialize variables to correspond with Cas Type and Features
* @generated
* @param jcas JCas
* @param casType Type
*/
public SurfaceForm_Type(JCas jcas, Type casType) {
super(jcas, casType);
casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());
casFeat_value = jcas.getRequiredFeatureDE(casType, "value", "uima.cas.String", featOkTst);
casFeatCode_value = (null == casFeat_value) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_value).getCode();
}
}