int partStart = 0; Import imp = UIMAFramework.getResourceSpecifierFactory().createImport(); ResourceManager rm = editor.createResourceManager();
ResourceManager aResourceManager) throws ResourceInitializationException { TypePriorities aggTypePriorities = UIMAFramework.getResourceSpecifierFactory() .createTypePriorities(); Iterator<? extends TypePriorities> it = aTypePriorities.iterator(); while (it.hasNext()) {
/** * Convert a {@link TypeSystem} to an equivalent {@link TypeSystemDescription}. * * @param aTypeSystem * type system object to convert * @return a TypeSystemDescription that is equivalent to <code>aTypeSystem</code> */ public static TypeSystemDescription typeSystem2TypeSystemDescription(TypeSystem aTypeSystem) { ResourceSpecifierFactory fact = UIMAFramework.getResourceSpecifierFactory(); TypeSystemDescription tsDesc = fact.createTypeSystemDescription(); Iterator<Type> typeIter = aTypeSystem.getTypeIterator(); ArrayList<TypeDescription> typeDescs = new ArrayList<TypeDescription>(); while (typeIter.hasNext()) { Type type = typeIter.next(); if (!type.getName().startsWith("uima.cas") && !type.getName().equals("uima.tcas.Annotation") && !type.isArray()) { typeDescs.add(type2TypeDescription(type, aTypeSystem)); } } TypeDescription[] typeDescArr = new TypeDescription[typeDescs.size()]; typeDescs.toArray(typeDescArr); tsDesc.setTypes(typeDescArr); return tsDesc; }
.createTypeSystemDescription(); Iterator<FeatureStructure> iter = aCasData.getFeatureStructures(); List<TypeDescription> typesArr = new ArrayList<TypeDescription>(); while (iter.hasNext()) { FeatureStructure casFS = iter.next(); TypeDescription newType = UIMAFramework.getResourceSpecifierFactory().createTypeDescription(); newType.setName(casFS.getType()); newType.setSupertypeName("uima.tcas.annotation");
/** * Sets the type system description. * * @param typeSystemDescription the new type system description * @throws ResourceInitializationException the resource initialization exception */ // Also called for aggregate TAEs public void setTypeSystemDescription(TypeSystemDescription typeSystemDescription) throws ResourceInitializationException { boolean doValidation = true; this.typeSystemDescription = typeSystemDescription; // This could be a tsd associated with a primitive TAE descriptor, or // it could be a tsd from a tsd if (typeSystemDescription == null) { if (!isAggregate()) { this.typeSystemDescription = UIMAFramework.getResourceSpecifierFactory() .createTypeSystemDescription(); doValidation = false; // speed up by 1/3 second } } setMergedTypeSystemDescription(); // setImportedTypeSystemDescription(); // done in above call if (aeDescription == null) aeDescription = UIMAFramework.getResourceSpecifierFactory().createAnalysisEngineDescription(); aeDescription.getAnalysisEngineMetaData().setTypeSystem(this.typeSystemDescription); if (doValidation) descriptorCAS.validate(); }
/** * Constructs and returns a <code>ProcessingResourceMetaData</code> object * that contains the type system, indexes, and type priorities definitions * for the CAS. * * @return processing resource metadata object containing the * relevant parts of the CAS definition */ public ProcessingResourceMetaData getProcessingResourceMetaData() { ProcessingResourceMetaData md = UIMAFramework.getResourceSpecifierFactory().createProcessingResourceMetaData(); md.setTypeSystem(getTypeSystemDescription()); md.setTypePriorities(getTypePriorities()); FsIndexCollection indColl = UIMAFramework.getResourceSpecifierFactory().createFsIndexCollection(); indColl.setFsIndexes(getFsIndexDescriptions()); md.setFsIndexCollection(indColl); return md; } }
aggDescription = rsFactory.createAnalysisEngineDescription(); aggDescription.setPrimitive(false); String dlgDescPath = dlgInsD.getMainComponentDesc(); Import dlgImport = rsFactory.createImport(); + ")"); FixedFlow aggFixedFlow = rsFactory.createFixedFlow(); String[] aggFlowSpecs = new String[dlgInstDescs.length]; for (int i = 0; i < dlgInstDescs.length; i++)
throws SAXException { ResourceSpecifierFactory factory = UIMAFramework.getResourceSpecifierFactory(); TypeSystemDescription tsDesc = factory.createTypeSystemDescription(); TypeDescription typeDesc = factory.createTypeDescription(); typeDesc.setName(type.getName()); typeDesc.setSupertypeName(superType.getName()); FeatureDescription featDesc = factory.createFeatureDescription(); featDesc.setName(feat.getShortName()); Type rangeType = feat.getRange(); AllowedValue[] allowedVals = new AllowedValue[strings.length]; for (int i = 0; i < strings.length; i++) { allowedVals[i] = factory.createAllowedValue(); allowedVals[i].setString(strings[i]);
.createAnalysisEngineDescription(); aggDesc.setPrimitive(false); aggDesc.getDelegateAnalysisEngineSpecifiersWithImports().put("UserAE", aeSpecifier); aggDesc.getDelegateAnalysisEngineSpecifiersWithImports().put("XmiWriter", casConsumerDesc); FixedFlow flow = UIMAFramework.getResourceSpecifierFactory().createFixedFlow(); SofaMapping sofaMapping1 = UIMAFramework.getResourceSpecifierFactory().createSofaMapping(); sofaMapping1.setComponentKey("XmlDetagger"); sofaMapping1.setComponentSofaName("xmlDocument"); SofaMapping sofaMapping2 = UIMAFramework.getResourceSpecifierFactory().createSofaMapping(); sofaMapping2.setComponentKey("UserAE"); sofaMapping2.setAggregateSofaName("plainTextDocument"); SofaMapping sofaMapping3 = UIMAFramework.getResourceSpecifierFactory().createSofaMapping(); sofaMapping3.setComponentKey("XmiWriter"); sofaMapping3.setAggregateSofaName("plainTextDocument");
/** * Creates the and link local processing descriptors to ae. * * @param d the d * @throws ResourceInitializationException the resource initialization exception */ private void createAndLinkLocalProcessingDescriptorsToAe(CasConsumerDescription d) throws ResourceInitializationException { aeDescription = UIMAFramework.getResourceSpecifierFactory().createAnalysisEngineDescription(); aeDescription.setAnnotatorImplementationName(d.getImplementationName()); aeDescription.setFrameworkImplementation(d.getFrameworkImplementation()); linkLocalProcessingDescriptorsToAe(d); }
/** * Gets the resource manager configuration. * * @return the resource manager configuration */ public ResourceManagerConfiguration getResourceManagerConfiguration() { ResourceManagerConfiguration rmc = editor.getAeDescription().getResourceManagerConfiguration(); if (null == rmc) { rmc = UIMAFramework.getResourceSpecifierFactory().createResourceManagerConfiguration(); editor.getAeDescription().setResourceManagerConfiguration(rmc); } return rmc; }
/** * Adds the capability set. * * @return the capability */ protected Capability addCapabilitySet() { Capability newCset = UIMAFramework.getResourceSpecifierFactory().createCapability(); // update the model AnalysisEngineMetaData md = getAnalysisEngineMetaData(); Capability[] c = getCapabilities(); if (c == null) md.setCapabilities(new Capability[] { newCset }); else { Capability[] newC = new Capability[c.length + 1]; System.arraycopy(c, 0, newC, 0, c.length); newC[c.length] = newCset; md.setCapabilities(newC); } return newCset; }
if (event.widget == addSetButton) { TypePriorityList typePriorityList = UIMAFramework.getResourceSpecifierFactory() .createTypePriorityList(); typePriorities = UIMAFramework.getResourceSpecifierFactory().createTypePriorities(); getAnalysisEngineMetaData().setTypePriorities(typePriorities);
.createFixedFlow(); flowConstraints.setAttributeValue("fixedFlow", stringArray0); getAnalysisEngineMetaData().setFlowConstraints(flowConstraints); .createConfigurationParameterSettings(); getAnalysisEngineMetaData().setConfigurationParameterSettings(configParmSettings);
.createFsIndexCollection(); Collection<FsIndexDescription> indexes = aggIndexes.values(); FsIndexDescription[] indexArray = new FsIndexDescription[indexes.size()];
TypeDescription typeDesc = UIMAFramework.getResourceSpecifierFactory().createTypeDescription(); typeDesc.setName(aType.getName()); Type superType = aTypeSystem.getParent(aType); AllowedValue[] avObjs = new AllowedValue[allowedValues.length]; for (int i = 0; i < allowedValues.length; i++) { AllowedValue av = UIMAFramework.getResourceSpecifierFactory().createAllowedValue(); av.setString(allowedValues[i]); avObjs[i] = av;
AllowedValue av = UIMAFramework.getResourceSpecifierFactory().createAllowedValue(); allowedValueUpdate(av, dialog); addAllowedValue(localTd, av);
/** * Constructs and returns a <code>ProcessingResourceMetaData</code> object that contains the type * system, indexes, and type priorities definitions for the CAS. * * @return processing resource metadata object containing the relevant parts of the CAS definition */ public ProcessingResourceMetaData getMetadata() throws ResourceInitializationException { CasDefinition casDefinition = casManager.getCasDefinition(); ProcessingResourceMetaData md = UIMAFramework.getResourceSpecifierFactory() .createProcessingResourceMetaData(); md.setTypeSystem(casDefinition.getTypeSystemDescription()); md.setTypePriorities(casDefinition.getTypePriorities()); FsIndexCollection indColl = UIMAFramework.getResourceSpecifierFactory() .createFsIndexCollection(); indColl.setFsIndexes(casDefinition.getFsIndexDescriptions()); md.setFsIndexCollection(indColl); return md; }