本文整理汇总了Java中org.apache.uima.cas.impl.CASImpl类的典型用法代码示例。如果您正苦于以下问题:Java CASImpl类的具体用法?Java CASImpl怎么用?Java CASImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CASImpl类属于org.apache.uima.cas.impl包,在下文中一共展示了CASImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: forceSetFeatureValue
import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
private static void forceSetFeatureValue(FeatureStructure aFS, String aFeatureName,
String aValue)
{
CASImpl casImpl = (CASImpl) aFS.getCAS().getLowLevelCAS();
TypeSystemImpl ts = (TypeSystemImpl) aFS.getCAS().getTypeSystem();
Feature feat = aFS.getType().getFeatureByBaseName(aFeatureName);
int featCode = ((FeatureImpl) feat).getCode();
int thisType = ((TypeImpl) aFS.getType()).getCode();
if (!ts.isApprop(thisType, featCode)) {
throw new IllegalArgumentException("Feature structure does not have that feature");
}
if (!ts.subsumes(ts.getType(CAS.TYPE_NAME_STRING), feat.getRange())) {
throw new IllegalArgumentException("Not a string feature!");
}
casImpl.ll_setStringValue(casImpl.ll_getFSRef(aFS), featCode, aValue);
}
示例2: createFS
import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
if (GoldAspectTarget_Type.this.useExistingInstance) {
// Return eq fs instance if already created
FeatureStructure fs = GoldAspectTarget_Type.this.jcas.getJfsFromCaddr(addr);
if (null == fs) {
fs = new GoldAspectTarget(addr, GoldAspectTarget_Type.this);
GoldAspectTarget_Type.this.jcas.putJfsFromCaddr(addr, fs);
return fs;
}
return fs;
} else return new GoldAspectTarget(addr, GoldAspectTarget_Type.this);
}
示例3: createFS
import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
if (AspectTarget_Type.this.useExistingInstance) {
// Return eq fs instance if already created
FeatureStructure fs = AspectTarget_Type.this.jcas.getJfsFromCaddr(addr);
if (null == fs) {
fs = new AspectTarget(addr, AspectTarget_Type.this);
AspectTarget_Type.this.jcas.putJfsFromCaddr(addr, fs);
return fs;
}
return fs;
} else return new AspectTarget(addr, AspectTarget_Type.this);
}
示例4: createFS
import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
if (CC_Type.this.useExistingInstance) {
// Return eq fs instance if already created
FeatureStructure fs = CC_Type.this.jcas.getJfsFromCaddr(addr);
if (null == fs) {
fs = new CC(addr, CC_Type.this);
CC_Type.this.jcas.putJfsFromCaddr(addr, fs);
return fs;
}
return fs;
} else return new CC(addr, CC_Type.this);
}
示例5: createFS
import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
if (QuestionCategoryAnnotation_Type.this.useExistingInstance) {
// Return eq fs instance if already created
FeatureStructure fs = QuestionCategoryAnnotation_Type.this.jcas.getJfsFromCaddr(addr);
if (null == fs) {
fs = new QuestionCategoryAnnotation(addr, QuestionCategoryAnnotation_Type.this);
QuestionCategoryAnnotation_Type.this.jcas.putJfsFromCaddr(addr, fs);
return fs;
}
return fs;
} else return new QuestionCategoryAnnotation(addr, QuestionCategoryAnnotation_Type.this);
}
示例6: SystemIndexing
import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
@Inject
SystemIndexing(CasProcessorFactory casProcessorFactory,
SystemIndexCasProcessingDelegate.Factory casViewProcessorDelegateFactory,
Provider<SystemIndexFSProcessorDelegate> systemIndexFSProcessorDelegateProvider,
@Assisted SystemIndexingSettings systemIndexingSettings,
@Assisted TypeSystemDescription typeSystemDescription) throws NlpTabException {
this.casProcessorFactory = casProcessorFactory;
this.systemIndexFSProcessorDelegateProvider = systemIndexFSProcessorDelegateProvider;
this.systemIndexingSettings = systemIndexingSettings;
tuningProperties = new Properties();
tuningProperties.setProperty(UIMAFramework.JCAS_CACHE_ENABLED, "false");
resourceManager = UIMAFramework.newDefaultResourceManager();
CASMgr casMgr = CASFactory.createCAS(CASImpl.DEFAULT_INITIAL_HEAP_SIZE, false);
try {
CasCreationUtils.setupTypeSystem(casMgr, typeSystemDescription);
} catch (ResourceInitializationException e) {
throw new NlpTabException(e);
}
((CASImpl) casMgr).commitTypeSystem();
typeSystem = ((CASImpl) casMgr).getTypeSystem();
TypeFilterLists typeFilterLists = TypeFilterLists.create(TYPE_WHITELIST, new String[]{});
ImmutableSet<String> typeFilter = TypeFilterBuilder.newBuilder()
.withTypeSystem(typeSystem)
.withTypeFilterLists(typeFilterLists)
.createTypeFilter();
typeSystemInfo = new TypeSystemInfo(typeSystem, typeFilter);
InstanceIndexes instanceIndexes = systemIndexingSettings.getInstanceIndexes();
String systemIndex = systemIndexingSettings.getIndex();
systemIndexCasViewProcessorDelegate = casViewProcessorDelegateFactory.create(instanceIndexes, systemIndex);
}
示例7: createFS
import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
if (SwanLink_Type.this.useExistingInstance) {
// Return eq fs instance if already created
FeatureStructure fs = SwanLink_Type.this.jcas.getJfsFromCaddr(addr);
if (null == fs) {
fs = new SwanLink(addr, SwanLink_Type.this);
SwanLink_Type.this.jcas.putJfsFromCaddr(addr, fs);
return fs;
}
return fs;
} else return new SwanLink(addr, SwanLink_Type.this);
}
示例8: createFS
import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
if (SwanLabel_Type.this.useExistingInstance) {
// Return eq fs instance if already created
FeatureStructure fs = SwanLabel_Type.this.jcas.getJfsFromCaddr(addr);
if (null == fs) {
fs = new SwanLabel(addr, SwanLabel_Type.this);
SwanLabel_Type.this.jcas.putJfsFromCaddr(addr, fs);
return fs;
}
return fs;
} else return new SwanLabel(addr, SwanLabel_Type.this);
}
示例9: createFS
import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
if (SwanAnnotation_Type.this.useExistingInstance) {
// Return eq fs instance if already created
FeatureStructure fs = SwanAnnotation_Type.this.jcas.getJfsFromCaddr(addr);
if (null == fs) {
fs = new SwanAnnotation(addr, SwanAnnotation_Type.this);
SwanAnnotation_Type.this.jcas.putJfsFromCaddr(addr, fs);
return fs;
}
return fs;
} else return new SwanAnnotation(addr, SwanAnnotation_Type.this);
}
示例10: createFS
import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
if (VerbFeatures_Type.this.useExistingInstance) {
// Return eq fs instance if already created
FeatureStructure fs = VerbFeatures_Type.this.jcas.getJfsFromCaddr(addr);
if (null == fs) {
fs = new VerbFeatures(addr, VerbFeatures_Type.this);
VerbFeatures_Type.this.jcas.putJfsFromCaddr(addr, fs);
return fs;
}
return fs;
} else return new VerbFeatures(addr, VerbFeatures_Type.this);
}
示例11: createFS
import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
if (SEFeature_Type.this.useExistingInstance) {
// Return eq fs instance if already created
FeatureStructure fs = SEFeature_Type.this.jcas.getJfsFromCaddr(addr);
if (null == fs) {
fs = new SEFeature(addr, SEFeature_Type.this);
SEFeature_Type.this.jcas.putJfsFromCaddr(addr, fs);
return fs;
}
return fs;
} else return new SEFeature(addr, SEFeature_Type.this);
}
示例12: createFS
import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
if (Passage_Type.this.useExistingInstance) {
// Return eq fs instance if already created
FeatureStructure fs = Passage_Type.this.jcas.getJfsFromCaddr(addr);
if (null == fs) {
fs = new Passage(addr, Passage_Type.this);
Passage_Type.this.jcas.putJfsFromCaddr(addr, fs);
return fs;
}
return fs;
} else return new Passage(addr, Passage_Type.this);
}
示例13: createFS
import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
if (Segment_Type.this.useExistingInstance) {
// Return eq fs instance if already created
FeatureStructure fs = Segment_Type.this.jcas.getJfsFromCaddr(addr);
if (null == fs) {
fs = new Segment(addr, Segment_Type.this);
Segment_Type.this.jcas.putJfsFromCaddr(addr, fs);
return fs;
}
return fs;
} else return new Segment(addr, Segment_Type.this);
}
示例14: createFS
import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
if (ClassificationAnnotation_Type.this.useExistingInstance) {
// Return eq fs instance if already created
FeatureStructure fs = ClassificationAnnotation_Type.this.jcas.getJfsFromCaddr(addr);
if (null == fs) {
fs = new ClassificationAnnotation(addr, ClassificationAnnotation_Type.this);
ClassificationAnnotation_Type.this.jcas.putJfsFromCaddr(addr, fs);
return fs;
}
return fs;
} else return new ClassificationAnnotation(addr, ClassificationAnnotation_Type.this);
}
示例15: createFS
import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
if (Situation_Type.this.useExistingInstance) {
// Return eq fs instance if already created
FeatureStructure fs = Situation_Type.this.jcas.getJfsFromCaddr(addr);
if (null == fs) {
fs = new Situation(addr, Situation_Type.this);
Situation_Type.this.jcas.putJfsFromCaddr(addr, fs);
return fs;
}
return fs;
} else return new Situation(addr, Situation_Type.this);
}