当前位置: 首页>>代码示例>>Java>>正文


Java XCASDeserializer.deserialize方法代码示例

本文整理汇总了Java中org.apache.uima.cas.impl.XCASDeserializer.deserialize方法的典型用法代码示例。如果您正苦于以下问题:Java XCASDeserializer.deserialize方法的具体用法?Java XCASDeserializer.deserialize怎么用?Java XCASDeserializer.deserialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.uima.cas.impl.XCASDeserializer的用法示例。


在下文中一共展示了XCASDeserializer.deserialize方法的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.deserialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。