本文整理汇总了Java中org.apache.uima.cas.impl.XCASDeserializer类的典型用法代码示例。如果您正苦于以下问题:Java XCASDeserializer类的具体用法?Java XCASDeserializer怎么用?Java XCASDeserializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XCASDeserializer类属于org.apache.uima.cas.impl包,在下文中一共展示了XCASDeserializer类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: indexDocument
import org.apache.uima.cas.impl.XCASDeserializer; //导入依赖的package包/类
void indexDocument(Path documentPath) throws NlpTabException {
try (InputStream inputStream = Files.newInputStream(documentPath)) {
CAS cas = CasCreationUtils.createCas(typeSystem, null, null, tuningProperties, resourceManager);
if (systemIndexingSettings.useXCas()) {
XCASDeserializer.deserialize(inputStream, cas);
} else {
XmiCasDeserializer.deserialize(inputStream, cas);
}
CasProcessorSettings casProcessorSettings = new CasProcessorSettings(systemIndexingSettings.getIndex(),
typeSystemInfo, systemIndexFSProcessorDelegateProvider, systemIndexCasViewProcessorDelegate);
casProcessorFactory.create(casProcessorSettings, cas).process();
} catch (ResourceInitializationException | IOException | SAXException e) {
throw new NlpTabException(e);
}
}
开发者ID:nlpie,项目名称:nlptab,代码行数:19,代码来源:SystemIndexing.java
示例2: getNext
import org.apache.uima.cas.impl.XCASDeserializer; //导入依赖的package包/类
public void getNext(JCas jCas) throws IOException, CollectionException {
if (!hasNext()) {
throw new RuntimeException("getNext(jCas) was called but hasNext() returns false");
}
FileInputStream inputStream = new FileInputStream(currentFile);
try {
if (xmlScheme.equals(XMI))
XmiCasDeserializer.deserialize(inputStream, jCas.getCas());
else
XCASDeserializer.deserialize(inputStream, jCas.getCas());
} catch (SAXException e) {
throw new CollectionException(e);
} finally {
inputStream.close();
}
completed++;
currentFile = null;
}
开发者ID:ClearTK,项目名称:cleartk,代码行数:22,代码来源:XReader.java
示例3: process
import org.apache.uima.cas.impl.XCASDeserializer; //导入依赖的package包/类
@Override
public void process(JCas jCas) throws AnalysisEngineProcessException {
URI uri = ViewUriUtil.getURI(jCas);
InputStream inputStream = null;
try {
inputStream = uri.toURL().openStream();
switch (this.xmlScheme) {
case XMI:
XmiCasDeserializer.deserialize(inputStream, jCas.getCas());
break;
case XCAS:
XCASDeserializer.deserialize(inputStream, jCas.getCas());
break;
}
inputStream.close();
} catch (Exception e) {
throw new AnalysisEngineProcessException(e);
}
}
开发者ID:ClearTK,项目名称:cleartk,代码行数:22,代码来源:UriToXmiCasAnnotator.java
示例4: deserialize
import org.apache.uima.cas.impl.XCASDeserializer; //导入依赖的package包/类
public static void deserialize(File currentZipFile, JCas jCas,
String _xmlScheme) throws IOException {
InputStream inputStream = unzipUniqueFileAsStream(currentZipFile);
try {
if (_xmlScheme.equals(XMI))
XmiCasDeserializer.deserialize(inputStream, jCas.getCas());
else
XCASDeserializer.deserialize(inputStream, jCas.getCas());
} catch (SAXException e) {
throw new IOException(e);
} finally {
inputStream.close();
}
}
开发者ID:BlueBrain,项目名称:bluima,代码行数:16,代码来源:ZipXmiCollectionReader.java
示例5: getNext
import org.apache.uima.cas.impl.XCASDeserializer; //导入依赖的package包/类
@Override
public void getNext(JCas jCas) throws IOException, CollectionException {
File currentFile = fileIterator.next();
FileInputStream inputStream = new FileInputStream(currentFile);
try {
if (xmlScheme.equals(XMI))
XmiCasDeserializer.deserialize(inputStream, jCas.getCas());
else
XCASDeserializer.deserialize(inputStream, jCas.getCas());
} catch (SAXException e) {
throw new CollectionException(e);
} finally {
inputStream.close();
}
}
开发者ID:BlueBrain,项目名称:bluima,代码行数:16,代码来源:XCollectionReader.java
注:本文中的org.apache.uima.cas.impl.XCASDeserializer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论