本文整理汇总了Java中org.apache.uima.resource.ResourceManager类的典型用法代码示例。如果您正苦于以下问题:Java ResourceManager类的具体用法?Java ResourceManager怎么用?Java ResourceManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResourceManager类属于org.apache.uima.resource包,在下文中一共展示了ResourceManager类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveFile
import org.apache.uima.resource.ResourceManager; //导入依赖的package包/类
public static File resolveFile(String path, ResourceManager resMgr)
throws URISyntaxException, MalformedURLException {
Preconditions.checkArgument(path != null);
if (resMgr == null) {
resMgr = UIMAFramework.newDefaultResourceManager();
}
URL modelBaseURL = resMgr.resolveRelativePath(path);
if (modelBaseURL == null)
throw new IllegalStateException(format(
"Can't resolve path %s using an UIMA relative path resolver", path));
return new File(modelBaseURL.toURI());
}
示例2: resolveDirectory
import org.apache.uima.resource.ResourceManager; //导入依赖的package包/类
public static File resolveDirectory(String path, ResourceManager resMgr)
throws MalformedURLException, URISyntaxException {
File f = resolveFile(path, resMgr);
if (!f.isDirectory()) {
throw new IllegalStateException(format(
"Path '%s' is resolved into '%s' but it is not a directory", path, f));
}
return f;
}
示例3: JCasFactoryImpl
import org.apache.uima.resource.ResourceManager; //导入依赖的package包/类
/**
* Constructor
*
* @param typeSystemDescriptions
*/
public JCasFactoryImpl(TypeSystemDescription[] typeSystemDescriptions) {
// Initialize cas manager
ResourceManager resManager = new ResourceManager_impl();
casManager = resManager.getCasManager();
for (TypeSystemDescription desc : typeSystemDescriptions) {
ProcessingResourceMetaData metaData = new ProcessingResourceMetaData_impl();
metaData.setTypeSystem(desc);
casManager.addMetaData(metaData);
}
}
示例4: createCpe
import org.apache.uima.resource.ResourceManager; //导入依赖的package包/类
public CollectionProcessingEngine createCpe(StatusCallbackListener aListener)
throws ResourceInitializationException, CpeDescriptorException {
ResourceManager resMgr = UIMAFramework.newDefaultResourceManager();
// max errors
if (maxErrors != 0) {
for (CpeCasProcessor cpeCasProcessor : cpeDesc
.getCpeCasProcessors().getAllCpeCasProcessors()) {
if (maxErrors == -1) // infinite nr errors ok
cpeCasProcessor.setActionOnMaxError("continue");
else if (maxErrors > 0)
cpeCasProcessor.setMaxErrorCount(maxErrors);
}
}
// thread cnt
if (maxProcessingUnitThreatCount == 0) {
cpeDesc.getCpeCasProcessors().setPoolSize(3);
} else {
cpeDesc.getCpeCasProcessors().setPoolSize(
maxProcessingUnitThreatCount + 2);
cpeDesc.setProcessingUnitThreadCount(maxProcessingUnitThreatCount);
}
CollectionProcessingEngine cpe = UIMAFramework
.produceCollectionProcessingEngine(cpeDesc, resMgr, null);
cpe.addStatusCallbackListener(aListener);
return cpe;
}
示例5: setResourceManager
import org.apache.uima.resource.ResourceManager; //导入依赖的package包/类
public void setResourceManager(ResourceManager resourceManager) {
mResourceManager = resourceManager;
}
示例6: createEngine
import org.apache.uima.resource.ResourceManager; //导入依赖的package包/类
/**
* Create a new analysis engine
*/
private AnalysisEngine createEngine(Class<? extends AnalysisComponent> componentClass, ResourceManager resourceManager, Object... configurationData) throws ResourceInitializationException{
return UIMAFramework.produceAnalysisEngine(AnalysisEngineFactory.createEngineDescription(componentClass, configurationData), resourceManager, null);
}
示例7: asService
import org.apache.uima.resource.ResourceManager; //导入依赖的package包/类
private PreprocessorService asService(Lang lang, CorpusMetadata corpusMetadata) {
PreprocessingPipelineBuilder builder = PreprocessingPipelineBuilder
.create(lang, taggerPath)
.setNbDocuments(corpusMetadata.getNbDocuments())
.setCorpusSize(corpusMetadata.getTotalSize());
if(tagger.isPresent())
builder.setTagger(tagger.get());
if(documentLoggingEnabled.isPresent())
builder.setDocumentLoggingEnabled(documentLoggingEnabled.get());
if(fixedExpressionEnabled.isPresent())
builder.setFixedExpressionEnabled(fixedExpressionEnabled.get());
if(listener.isPresent())
builder.addPipelineListener(listener.get());
for(AnalysisEngineDescription customAE:customAEs)
builder.addCustomAE(customAE);
if(resourceOptions.isPresent())
builder.setResourceConfig(resourceOptions.get());
if(history.isPresent())
builder.setHistory(history.get());
final AnalysisEngine aae;
try {
logger.info("Initializing analysis engine");
ResourceManager resMgr = UIMAFramework.newDefaultResourceManager();
AnalysisEngineDescription aaeDesc;
aaeDesc = createEngineDescription(builder.create());
// Instantiate AAE
aae = UIMAFramework.produceAnalysisEngine(aaeDesc, resMgr, null);
} catch (ResourceInitializationException e) {
throw new TermSuiteException(e);
}
return Guice.createInjector(
new TermSuiteModule(),
new PreprocessingModule(lang, aae))
.getInstance(PreprocessorService.class);
}
示例8: setResourceManager
import org.apache.uima.resource.ResourceManager; //导入依赖的package包/类
@Override
public void setResourceManager(ResourceManager resourceManager) {
}
示例9: getResourceManager
import org.apache.uima.resource.ResourceManager; //导入依赖的package包/类
@Override
public ResourceManager getResourceManager() {
throw new UnsupportedOperationException();
}