热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.uima.analysis_engine.AnalysisEngineDescription.isPrimitive()方法的使用及代码示例

本文整理了Java中org.apache.uima.analysis_engine.AnalysisEngineDescription.isPrimitive()方法的

本文整理了Java中org.apache.uima.analysis_engine.AnalysisEngineDescription.isPrimitive()方法的一些代码示例,展示了AnalysisEngineDescription.isPrimitive()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AnalysisEngineDescription.isPrimitive()方法的具体详情如下:
包路径:org.apache.uima.analysis_engine.AnalysisEngineDescription
类名称:AnalysisEngineDescription
方法名:isPrimitive

AnalysisEngineDescription.isPrimitive介绍

[英]Retrieves whether the AnalysisEngine is primitive (consisting of one annotator), as opposed to aggregate (containing multiple delegate AnalysisEngines).

Some of the methods on this class apply only to one type of AnalysisEngine:
#getAnnotatorImplementationName() - primitive AnalysisEngine only
#getDelegateAnalysisEngineSpecifiers() - aggregate AnalysisEngine only
#getFlowControllerDeclaration() - aggregate AnalysisEngine only
[中]检索AnalysisEngine是否为基元(由一个注释器组成),而不是聚合(包含多个委托AnalysisEngine)。
此类中的某些方法仅适用于一种类型的AnalysisEngine:
#getAnnotatorImplementationName()-仅原语分析引擎
#getDelegateAnalysisEngineSpecifiers()-仅聚合AnalysisEngine
#GetFlowControllerDeparation()-仅聚合分析引擎

代码示例

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

/**
* Checks if is primitive.
*
* @return true, if is primitive
*/
protected boolean isPrimitive() {
return editor.getAeDescription().isPrimitive();
}

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

/**
* Checks if is aggregate.
*
* @return true, if is aggregate
*/
public boolean isAggregate() {
return isAeDescriptor() && (!aeDescription.isPrimitive());
}

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

/**
* Checks if is primitive.
*
* @return true, if is primitive
*/
public boolean isPrimitive() {
return isLocalProcessingDescriptor() && aeDescription.isPrimitive();
}

代码示例来源:origin: org.dkpro.tc/dkpro-tc-ml

&& !((AnalysisEngineDescription) aDesc).isPrimitive()) {
throw new IllegalArgumentException(
"Only primitive meta collectors currently supported.");

代码示例来源:origin: dkpro/dkpro-tc

&& !((AnalysisEngineDescription) aDesc).isPrimitive()) {
throw new IllegalArgumentException(
"Only primitive meta collectors currently supported.");

代码示例来源:origin: dkpro/dkpro-tc

if (!((AnalysisEngineDescription) aDesc).isPrimitive()) {
throw new IllegalArgumentException(
"Only primitive meta collectors currently supported.");

代码示例来源:origin: org.dkpro.tc/dkpro-tc-core

if (!((AnalysisEngineDescription) aDesc).isPrimitive()) {
throw new IllegalArgumentException(
"Only primitive meta collectors currently supported.");

代码示例来源:origin: org.apache.uima/uimafit-core

/**
* This method simply calls {@link #add(String, AnalysisEngineDescription, String...)} using the
* result of {@link AnalysisEngineDescription#getAnnotatorImplementationName()} for the component
* name
*
* @param aed
* an analysis engine description to add to the aggregate analysis engine
* @param viewNames
* pairs of view names corresponding to a componentSofaName followed by the
* aggregateSofaName that it is mapped to. An even number of names must be passed in or
* else an IllegalArgumentException will be thrown. See
* {@link SofaMappingFactory#createSofaMapping(String, String, String)}
*
* @return the name of the component generated for the {@link AnalysisEngineDescription}
*/
public String add(AnalysisEngineDescription aed, String... viewNames) {
String compOnentName= aed.getAnalysisEngineMetaData().getName();
if (compOnentName== null || componentName.equals("")) {
if (aed.isPrimitive()) {
compOnentName= aed.getAnnotatorImplementationName();
} else {
compOnentName= "aggregate";
}
}
if (componentNames.contains(componentName)) {
compOnentName= componentName + "." + (componentNames.size() + 1);
}
add(componentName, aed, viewNames);
return componentName;
}

代码示例来源:origin: CLLKazan/UIMA-Ext

Map delegateParameterNames) {
AnalysisEngineMetaData aggrMeta = aggrDesc.getAnalysisEngineMetaData();
if (aggrDesc.isPrimitive()) {
throw new IllegalArgumentException(String.format(
"The provided AE descriptor (name=%s) is primitive",

代码示例来源:origin: org.apache.uima/uimafit-core

/**
* Scan the given resource specifier for external resource dependencies and whenever a dependency
* a compatible type is found, the given resource is bound to it.
*
* @param aDesc
* a description.
* @param aResDesc
* the resource description.
*/
private static void bind(AnalysisEngineDescription aDesc, ExternalResourceDescription aResDesc)
throws InvalidXMLException, ClassNotFoundException {
// Recursively address delegates
if (!aDesc.isPrimitive()) {
for (Object delegate : aDesc.getDelegateAnalysisEngineSpecifiers().values()) {
bindResource((ResourceSpecifier) delegate, aResDesc);
}
}
// Bind if necessary
Class resClass = Class.forName(getImplementationName(aResDesc));
for (ExternalResourceDependency dep : aDesc.getExternalResourceDependencies()) {
Class apiClass = Class.forName(dep.getInterfaceName());
// Never bind fields of type Object. See also ExternalResourceInitializer#getApi()
if (apiClass.equals(Object.class)) {
continue;
}
if (apiClass.isAssignableFrom(resClass)) {
bindExternalResource(aDesc, dep.getKey(), aResDesc);
}
}
}

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

/**
* Adds the delegate to GUI.
*
* @param keys the keys
* @param newKey the new key
* @param o the o
*/
private void addDelegateToGUI(String keys, String newKey, ResourceSpecifier o) {
if (o instanceof AnalysisEngineDescription) {
AnalysisEngineDescription aeDescription = (AnalysisEngineDescription) o;
if (aeDescription.isPrimitive())
addPrimitiveToGUI(keys + newKey + "/", aeDescription);
else {
for (Iterator it = editor.getDelegateAEdescriptions(aeDescription).entrySet().iterator(); it
.hasNext();) {
Map.Entry item = (Map.Entry) it.next();
addDelegateToGUI(keys + newKey + "/", (String) item.getKey(), (ResourceSpecifier) item
.getValue());
}
FlowControllerDeclaration fcd = getFlowControllerDeclaration();
if (null != fcd) {
addPrimitiveToGUI(keys + fcd.getKey() + "/", ((ResourceCreationSpecifier) editor
.getResolvedFlowControllerDeclaration().getSpecifier()));
}
}
}
}

代码示例来源:origin: org.apache.uima/uimafit-core

/**
* Scan the given resource specifier for external resource dependencies and whenever a dependency
* with the given key is encountered, the given resource is bound to it.
*
* @param aDesc
* a description.
* @param aKey
* the key to bind to.
* @param aResDesc
* the resource description.
*/
private static void bind(AnalysisEngineDescription aDesc, String aKey,
ExternalResourceDescription aResDesc) throws InvalidXMLException {
// Recursively address delegates
if (!aDesc.isPrimitive()) {
for (Object delegate : aDesc.getDelegateAnalysisEngineSpecifiers().values()) {
bindResource((ResourceSpecifier) delegate, aKey, aResDesc);
}
}
// Bind if necessary
for (ExternalResourceDependency dep : aDesc.getExternalResourceDependencies()) {
if (aKey.equals(dep.getKey())) {
bindExternalResource(aDesc, aKey, aResDesc);
}
}
}

代码示例来源:origin: apache/uima-uimaj

} else if (frameworkImpl.startsWith(Constants.JAVA_FRAMEWORK_NAME)) {
if (spec instanceof AnalysisEngineDescription
&& !((AnalysisEngineDescription) spec).isPrimitive()) {
resource = new AggregateAnalysisEngine_impl();
} else {

代码示例来源:origin: org.apache.uima/uimaj-as-core

/**
* Forces initialization of a Cas Pool if this is a Cas Multiplier delegate collocated with an
* aggregate. The parent aggregate calls this method when all type systems have been merged.
*/
public synchronized void onInitialize() {
// Component's Cas Pool is registered lazily, when the process() is called for
// the first time. For monitoring purposes, we need the comoponent's Cas Pool
// MBeans to register during initialization of the service. For a Cas Multiplier
// force creation of the Cas Pool and registration of a Cas Pool with the JMX Server.
// Just get the CAS and release it back to the component's Cas Pool.
if (isCasMultiplier() && !isTopLevelComponent() ) {
boolean isUimaAggregate = false;
if ( !(resourceSpecifier instanceof CollectionReaderDescription) ) {
// determine if this AE is a UIMA aggregate
isUimaAggregate = ((AnalysisEngineDescription) resourceSpecifier).isPrimitive() == false ? true : false;
}
if ( !isUimaAggregate ) { // !uima core aggregate CM
CAS cas = (CAS) getUimaContext().getEmptyCas(CAS.class);
cas.release();
}
}
}

代码示例来源:origin: apache/uima-uimaj

(! ((AnalysisEngineDescription)mDescription).isPrimitive())) {
((AnalysisEngineDescription)mDescription).isPrimitive()) {
try {
md.resolveImports();

代码示例来源:origin: org.apache.uima/uimafit-core

private static void consolidateAggregate(AnalysisEngineDescription aDesc, ResourceManager aResMgr)
throws ResourceInitializationException, InvalidXMLException {
if (aDesc.isPrimitive() || aDesc.getDelegateAnalysisEngineSpecifiers().isEmpty()) {
return;

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

resolvedFlowCOntrollerDeclaration= aeDescription.getFlowControllerDeclaration();
setTypeSystemDescription(aeDescription.isPrimitive() ? md.getTypeSystem() : null);

代码示例来源:origin: apache/uima-uimaj

&& !((AnalysisEngineDescription) aSpecifier).isPrimitive()) {
return false;

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

/**
* Validate.
*
* @throws ResourceInitializationException the resource initialization exception
*/
public void validate() throws ResourceInitializationException {
AnalysisEngineDescription ae = (AnalysisEngineDescription) modelRoot.getAeDescription().clone();
// speedup = replace typeSystem with resolved imports version
if (ae.isPrimitive()) {
TypeSystemDescription tsd = modelRoot.getMergedTypeSystemDescription();
if (null != tsd)
tsd = (TypeSystemDescription) tsd.clone();
ae.getAnalysisEngineMetaData().setTypeSystem(tsd);
}
ae.getAnalysisEngineMetaData().setFsIndexCollection(modelRoot.getMergedFsIndexCollection());
ae.getAnalysisEngineMetaData().setTypePriorities(modelRoot.getMergedTypePriorities());
try {
// long time = System.currentTimeMillis();
// System.out.println("Creating TCas model");
cachedResult = modelRoot.createCas(ae, casCreateProperties, modelRoot.createResourceManager());
// System.out.println("Finished Creating TCas model; time= " +
// (System.currentTimeMillis() - time));
if (null == cachedResult)
throw new InternalErrorCDE("null result from createTCas");
} catch (CASAdminException e) {
throw new ResourceInitializationException(e);
}
dirty = false;
modelRoot.allTypes.dirty = true;
}

代码示例来源:origin: org.dkpro.lab/dkpro-lab-uima-engine-simple

if (analysisDesc.isPrimitive()) {
engine = new PrimitiveAnalysisEngine_impl();

推荐阅读
author-avatar
112473228
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有