本文整理了Java中org.apache.uima.cas.CAS.createFeaturePath()
方法的一些代码示例,展示了CAS.createFeaturePath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CAS.createFeaturePath()
方法的具体详情如下:
包路径:org.apache.uima.cas.CAS
类名称:CAS
方法名:createFeaturePath
[英]Create a feature path. This is mainly useful for creating org.apache.uima.cas.FSMatchConstraint.
[中]创建要素路径。这主要用于创建组织。阿帕奇。尤马。中科院。FSMatchConstraint。
代码示例来源:origin: org.apache.lucene/lucene-analyzers-uima
@Override
protected void initializeIterator() throws IOException {
try {
analyzeInput();
} catch (AnalysisEngineProcessException | ResourceInitializationException e) {
throw new IOException(e);
}
featurePath = cas.createFeaturePath();
try {
featurePath.initialize(typeAttributeFeaturePath);
} catch (CASException e) {
featurePath = null;
throw new IOException(e);
}
finalOffset = correctOffset(cas.getDocumentText().length());
Type tokenType = cas.getTypeSystem().getType(tokenTypeString);
iterator = cas.getAnnotationIndex(tokenType).iterator();
}
代码示例来源:origin: org.apache.uima/textmarker-core
private FSMatchConstraint createWindowConstraint(AnnotationFS windowAnnotation, CAS cas) {
if (windowAnnotation == null)
return null;
FeaturePath beginFP = cas.createFeaturePath();
Type type = windowAnnotation.getType();
beginFP.addFeature(type.getFeatureByBaseName("begin"));
FSIntConstraint intConstraint = cf.createIntConstraint();
intConstraint.geq(windowAnnotation.getBegin());
FSMatchConstraint beginConstraint = cf.embedConstraint(beginFP, intConstraint);
FeaturePath endFP = cas.createFeaturePath();
endFP.addFeature(type.getFeatureByBaseName("end"));
intConstraint = cf.createIntConstraint();
intConstraint.leq(windowAnnotation.getEnd());
FSMatchConstraint endConstraint = cf.embedConstraint(endFP, intConstraint);
FSMatchConstraint windowConstraint = cf.and(beginConstraint, endConstraint);
return windowConstraint;
}
代码示例来源:origin: org.apache.uima/ruta-core
private FSMatchConstraint createWindowConstraint(AnnotationFS windowAnnotation, CAS cas) {
if (windowAnnotation == null)
return null;
FeaturePath beginFP = cas.createFeaturePath();
Type type = windowAnnotation.getType();
beginFP.addFeature(type.getFeatureByBaseName("begin"));
FSIntConstraint intConstraint = cf.createIntConstraint();
intConstraint.geq(windowAnnotation.getBegin());
FSMatchConstraint beginConstraint = cf.embedConstraint(beginFP, intConstraint);
FeaturePath endFP = cas.createFeaturePath();
endFP.addFeature(type.getFeatureByBaseName("end"));
intConstraint = cf.createIntConstraint();
intConstraint.leq(windowAnnotation.getEnd());
FSMatchConstraint endConstraint = cf.embedConstraint(endFP, intConstraint);
FSMatchConstraint windowConstraint = cf.and(beginConstraint, endConstraint);
return windowConstraint;
}
代码示例来源:origin: org.apache.uima/uimaj-ep-cas-editor
FeaturePath beginPath = cas.createFeaturePath();
beginPath.addFeature(annotationType.getFeatureByBaseName("begin"));
FSIntConstraint beginConstraint = cf.createIntConstraint();
FeaturePath endPath = cas.createFeaturePath();
endPath.addFeature(annotationType.getFeatureByBaseName("end"));
FSIntConstraint endConstraint = cf.createIntConstraint();
内容来源于网络,如有侵权,请联系作者删除!