org.apache.uima.resource.ResourceManager.setDataPath()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(124)

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

ResourceManager.setDataPath介绍

[英]Sets the data path used to resolve relative paths. More than one directory may be specified by separating them with the System path.separator character (; on windows, : on UNIX). The elements of this path may be URLs or File paths.
[中]设置用于解析相对路径的数据路径。可以通过使用系统path.separator字符(;在windows上,:在UNIX上)分隔多个目录来指定它们。此路径的元素可以是URL或文件路径。

代码示例

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

private void handleDataPath() throws ResourceInitializationException {
 String dataPath = context.getDataPath();
 String[] singleDataPaths = dataPath.split(File.pathSeparator);
 String[] clonedDescriptorPath = null;
 if (descriptorPaths != null) {
  clonedDescriptorPath = descriptorPaths.clone();
 }
 if (!StringUtils.isBlank(dataPath)) {
  scriptPaths = ArrayUtils.addAll(scriptPaths, singleDataPaths);
  descriptorPaths = ArrayUtils.addAll(descriptorPaths, singleDataPaths);
  resourcePaths = ArrayUtils.addAll(resourcePaths, singleDataPaths);
 }
 if (modifyDataPath && clonedDescriptorPath != null) {
  if (!dataPath.endsWith(File.pathSeparator)) {
   dataPath += File.pathSeparator;
  }
  for (String path : clonedDescriptorPath) {
   dataPath += path + File.pathSeparator;
  }
  try {
   resourceManager.setDataPath(dataPath);
  } catch (MalformedURLException e) {
   throw new ResourceInitializationException(e);
  }
 }
}

代码示例来源:origin: org.apache.uima/ruta-ep-ide-ui

private ResourceManager getResourceManager(ClassLoader classloader)
    throws MalformedURLException, CoreException {
 if (resourceManager == null) {
  resourceManager = new ResourceManager_impl(classloader);
  List<IFolder> folders = RutaProjectUtils
      .getAllDescriptorFolders(sourceModule.getScriptProject().getProject());
  StringBuilder sb = new StringBuilder();
  Iterator<IFolder> iterator = folders.iterator();
  while (iterator.hasNext()) {
   IFolder iFolder = iterator.next();
   sb.append(iFolder.getLocation().toPortableString());
   if (iterator.hasNext()) {
    sb.append(System.getProperty("path.separator"));
   }
  }
  resourceManager.setDataPath(sb.toString());
 }
 return resourceManager;
}

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

dpElements.add(rm.getDataPath());
dpElements.addAll(Arrays.asList(additionalSearchPaths));
rm.setDataPath(dataPathJoiner.join(dpElements));

代码示例来源:origin: org.apache.uima/ruta-ep-ide-ui

private Set<String> getTypes(IFolder folder, String filePath) throws InvalidXMLException,
    IOException {
 Set<String> types = new HashSet<String>();
 IFile iFile = getFile(folder, filePath);
 URL url;
 try {
  url = iFile.getLocationURI().toURL();
  ResourceManager resMgr = UIMAFramework.newDefaultResourceManager();
  resMgr.setDataPath(folder.getLocation().toPortableString());
  types = getTypes(url, resMgr);
 } catch (MalformedURLException e) {
  e.printStackTrace();
 }
 return types;
}

代码示例来源:origin: org.apache.uima/ConceptMapper

public void initCPM() throws DictionaryLoaderException {
 try {
  ResourceManager resMgr = UIMAFramework.newDefaultResourceManager();
  String dp = System.getProperty("uima.datapath");
  if (null != dp) {
   resMgr.setDataPath(dp);
  }
  ae = UIMAFramework.produceAnalysisEngine(aeSpecifier);
  cas = ae.newCAS();
 } catch (ResourceInitializationException e) {
  throw new DictionaryLoaderException(e);
 } catch (MalformedURLException e) {
   throw new DictionaryLoaderException(e);
 }
}

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

private TypeSystemDescription getLocalTSD(String toLoad) throws InvalidXMLException, IOException {
 TypeSystemDescription localTSD = localTSDMap.get(toLoad);
 if (localTSD == null) {
  String locateTSD = locate(toLoad, descriptorPaths, "TypeSystem.xml", true);
  if (locateTSD != null) {
   localTSD = UIMAFramework.getXMLParser().parseTypeSystemDescription(
       new XMLInputSource(locateTSD));
   ResourceManager resMgr = UIMAFramework.newDefaultResourceManager();
   resMgr.setDataPath(getDataPath());
   localTSD.resolveImports(resMgr);
   localTSDMap.put(toLoad, localTSD);
  }
 }
 return localTSD;
}

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

try {
 rsrcMgr = UIMAFramework.newDefaultResourceManager();
 rsrcMgr.setDataPath(this.dataPathName);
} catch (MalformedURLException e) {
 StringBuffer msg = new StringBuffer();

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

rsrcMgr.setDataPath(sp.dataPath);
UIMAFramework.getLogger(this.getClass()).logrb(
   Level.CONFIG,

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

bais.close();
ResourceManager resMgr = UIMAFramework.newDefaultResourceManager();
resMgr.setDataPath(dataPath);
if (specifier instanceof AnalysisEngineDescription) {

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

/**
 * returns a valid ResourceManager with the information from the PackageBrowser object.
 * 
 * @param pkgBrowser
 *          packageBrowser object of an installed PEAR package
 * 
 * @return a ResourceManager object with the information from the PackageBrowser object.
 * 
 * @throws IOException passthru
 */
private static ResourceManager getResourceManager(PackageBrowser pkgBrowser) throws IOException {
 ResourceManager resourceMgr = UIMAFramework.newDefaultResourceManager();
 // set component data path
 if (pkgBrowser.getComponentDataPath() != null) {
  resourceMgr.setDataPath(pkgBrowser.getComponentDataPath());
 }
 // set component classpath
 if (pkgBrowser.buildComponentClassPath() != null) {
  resourceMgr.setExtensionClassPath(pkgBrowser.buildComponentClassPath(), true);
 }
 return resourceMgr;
}

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

resourceManager.setDataPath(dataPath);
} catch (MalformedURLException e1) {
 throw new InternalErrorCDE(Messages.getString("MultiPageEditor.14"), e1); //$NON-NLS-1$

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

.getPersistentProperty((new QualifiedName("", "CDEdataPath")));
if (dataPath != null) {
 resourceManager.setDataPath(dataPath);

代码示例来源:origin: org.apache.uima/ruta-ep-ide-ui

ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
 ResourceManager resMgr = UIMAFramework.newDefaultResourceManager();
 resMgr.setDataPath(rootPath.toPortableString());
 ae = UIMAFramework.produceAnalysisEngine(specifier, resMgr, null);
} catch (Exception e) {

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

dataPath += string + File.pathSeparator;
rm.setDataPath(dataPath);

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

resMgr.setDataPath(dataPath);

代码示例来源:origin: org.apache.uima/uimaj-component-test-util

resMgr.setDataPath(dataPath);

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

resMgr.setDataPath(dataPath);

相关文章