本文整理汇总了Java中org.apache.uima.collection.CollectionProcessingEngine类的典型用法代码示例。如果您正苦于以下问题:Java CollectionProcessingEngine类的具体用法?Java CollectionProcessingEngine怎么用?Java CollectionProcessingEngine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CollectionProcessingEngine类属于org.apache.uima.collection包,在下文中一共展示了CollectionProcessingEngine类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: main
import org.apache.uima.collection.CollectionProcessingEngine; //导入依赖的package包/类
public static void main(String[] args) throws IOException, UIMAException,
CpeDescriptorException {
if (args.length != 1) {
System.err.println("Usage: <cpeDescriptorPath>");
return;
}
String cpeDescPath = args[0];
XMLInputSource cpeDescSource = new XMLInputSource(cpeDescPath);
CpeDescription cpeDesc = UIMAFramework.getXMLParser().parseCpeDescription(cpeDescSource);
// produce
CollectionProcessingEngine cpe = UIMAFramework
.produceCollectionProcessingEngine(cpeDesc);
cpe.addStatusCallbackListener(new ReportingStatusCallbackListener(cpe));
// run
cpe.process();
}
开发者ID:textocat,项目名称:textokit-core,代码行数:20,代码来源:CpeLauncher.java
示例2: process
import org.apache.uima.collection.CollectionProcessingEngine; //导入依赖的package包/类
@Override
public Boolean process() throws ResourceInitializationException,
CpeDescriptorException {
StatusCallbackListenerSlf4J listener = new StatusCallbackListenerSlf4J();
CollectionProcessingEngine cpe = createCpe(listener);
listener.setCpe(cpe);// workaround to get performanceReports
cpe.process();
StatusCallbackListenerSlf4J callback = (StatusCallbackListenerSlf4J) listener;
while (!callback.isCollectionProcessComplete()) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RuntimeException("should not happen, though...");
}
}
StopwatchUtils.closeAndPrint(); // close all stopwatches (for profiling)
return true;
}
开发者ID:BlueBrain,项目名称:bluima,代码行数:20,代码来源:CpeBuilder.java
示例3: main
import org.apache.uima.collection.CollectionProcessingEngine; //导入依赖的package包/类
public static void main(String[] args) throws IOException, UIMAException,
CpeDescriptorException {
if (args.length != 2) {
System.err.println("Usage: <txtInputDir> <xmiOutputDir>");
return;
}
String cpeDescPath = "desc/cpe/cpe-txt-to-xmi.xml";
String inputDirPath = args[0];
String outputDirPath = args[1];
XMLInputSource cpeDescSource = new XMLInputSource(cpeDescPath);
CpeDescription cpeDesc = UIMAFramework.getXMLParser().parseCpeDescription(cpeDescSource);
// configure reader
cpeDesc.getAllCollectionCollectionReaders()[0]
.getConfigurationParameterSettings().setParameterValue("DirectoryPath",
inputDirPath);
// configure writer
cpeDesc.getCpeCasProcessors().getAllCpeCasProcessors()[0]
.getConfigurationParameterSettings()
.setParameterValue("XmiOutputDir", outputDirPath);
// produce
CollectionProcessingEngine cpe = UIMAFramework
.produceCollectionProcessingEngine(cpeDesc);
cpe.addStatusCallbackListener(new ReportingStatusCallbackListener(cpe));
// run
cpe.process();
}
开发者ID:textocat,项目名称:textokit-core,代码行数:32,代码来源:TxtToXmiLauncher.java
示例4: createCpe
import org.apache.uima.collection.CollectionProcessingEngine; //导入依赖的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;
}
开发者ID:BlueBrain,项目名称:bluima,代码行数:30,代码来源:CpeBuilder.java
示例5: main
import org.apache.uima.collection.CollectionProcessingEngine; //导入依赖的package包/类
/**
* @param args
* @throws IOException
* @throws InvalidXMLException
* @throws ResourceInitializationException
*/
public static void main(String[] args) throws InvalidXMLException, IOException, ResourceInitializationException {
CpeDescription cpeDesc = UIMAFramework.getXMLParser().
parseCpeDescription(new XMLInputSource(desc_fname));
//instantiate CPE
CollectionProcessingEngine mCPE = UIMAFramework.produceCollectionProcessingEngine(cpeDesc);
mCPE.process();
}
开发者ID:UTHealth-CCB,项目名称:Medex,代码行数:17,代码来源:MedexUIMACPE.java
示例6: TestCPERunner
import org.apache.uima.collection.CollectionProcessingEngine; //导入依赖的package包/类
public TestCPERunner(CollectionProcessingEngine collectionProcessingEngine) {
this.collectionProcessingEngine = collectionProcessingEngine;
}
开发者ID:nlpie,项目名称:biomedicus,代码行数:4,代码来源:TestCPERunner.java
示例7: ReportingStatusCallbackListener
import org.apache.uima.collection.CollectionProcessingEngine; //导入依赖的package包/类
public ReportingStatusCallbackListener(CollectionProcessingEngine cpe) {
this(cpe, 0);
}
开发者ID:textocat,项目名称:textokit-core,代码行数:4,代码来源:ReportingStatusCallbackListener.java
示例8: setCpe
import org.apache.uima.collection.CollectionProcessingEngine; //导入依赖的package包/类
public void setCpe(CollectionProcessingEngine cpe) {
this.cpe = cpe;
}
开发者ID:BlueBrain,项目名称:bluima,代码行数:4,代码来源:StatusCallbackListenerSlf4J.java
注:本文中的org.apache.uima.collection.CollectionProcessingEngine类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论