本文整理汇总了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);
}
}
示例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;
}
示例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);
}
}
示例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();
}
}
示例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();
}
}