gpt4 book ai didi

org.apache.uima.cas.impl.XmiSerializationSharedData.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 21:46:40 29 4
gpt4 key购买 nike

本文整理了Java中org.apache.uima.cas.impl.XmiSerializationSharedData.<init>()方法的一些代码示例,展示了XmiSerializationSharedData.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmiSerializationSharedData.<init>()方法的具体详情如下:
包路径:org.apache.uima.cas.impl.XmiSerializationSharedData
类名称:XmiSerializationSharedData
方法名:<init>

XmiSerializationSharedData.<init>介绍

暂无

代码示例

代码示例来源:origin: apache/tika

/**
 * Serializes a CAS in the given format.
 * 
 * @param jcas
 *            CAS (Common Analysis System) to be serialized.
 * @param type
 *            type of cTAKES (UIMA) serializer used to write CAS.
 * @param prettyPrint
 *            {@code true} to do pretty printing of output.
 * @param stream
 *            {@link OutputStream} object used to print out information
 *            extracted by using cTAKES.
 * @throws SAXException
 *             if there was a SAX exception.
 * @throws IOException
 *             if any I/O error occurs.
 */
public static void serialize(JCas jcas, CTAKESSerializer type, boolean prettyPrint,
    OutputStream stream) throws SAXException, IOException {
  if (type == CTAKESSerializer.XCAS) {
    XCASSerializer.serialize(jcas.getCas(), stream, prettyPrint);
  } else if (type == CTAKESSerializer.XMI) {
    XmiCasSerializer.serialize(jcas.getCas(), jcas.getTypeSystem(),
        stream, prettyPrint, new XmiSerializationSharedData());
  } else {
    XmlCasSerializer.serialize(jcas.getCas(), jcas.getTypeSystem(),
        stream);
  }
}

代码示例来源:origin: org.apache.uima/uimaj-as-jms

protected CAS deserialize(String aSerializedCAS, CAS aCAS) throws Exception {
 XmiSerializationSharedData deserSharedData = new XmiSerializationSharedData();
 uimaSerializer.deserializeCasFromXmi(aSerializedCAS, aCAS, deserSharedData, true, -1);
 return aCAS;
}

代码示例来源:origin: org.apache.uima/uimaj-as-jms

protected String serializeCAS(CAS aCAS) throws Exception {
 XmiSerializationSharedData serSharedData = new XmiSerializationSharedData();
 return uimaSerializer.serializeCasToXmi(aCAS, serSharedData);
}

代码示例来源:origin: org.apache.uima/uimaj-as-core

private void deserialize(String xmi, CAS cas, String casReferenceId) throws Exception {
 CacheEntry entry = getController().getInProcessCache().getCacheEntryForCAS(casReferenceId);
 // Processing the reply from a standard, non-parallel delegate
 XmiSerializationSharedData deserSharedData;
 deserSharedData = entry.getDeserSharedData();
 if (deserSharedData == null) {
  deserSharedData = new XmiSerializationSharedData();
  entry.setXmiSerializationData(deserSharedData);
 }
 UimaSerializer uimaSerializer = SerializerCache.lookupSerializerByThreadId();
 uimaSerializer.deserializeCasFromXmi(xmi, cas, deserSharedData, true, -1);
}

代码示例来源:origin: org.apache.tika/tika-parsers

/**
 * Serializes a CAS in the given format.
 * 
 * @param jcas
 *            CAS (Common Analysis System) to be serialized.
 * @param type
 *            type of cTAKES (UIMA) serializer used to write CAS.
 * @param prettyPrint
 *            {@code true} to do pretty printing of output.
 * @param stream
 *            {@link OutputStream} object used to print out information
 *            extracted by using cTAKES.
 * @throws SAXException
 *             if there was a SAX exception.
 * @throws IOException
 *             if any I/O error occurs.
 */
public static void serialize(JCas jcas, CTAKESSerializer type, boolean prettyPrint,
    OutputStream stream) throws SAXException, IOException {
  if (type == CTAKESSerializer.XCAS) {
    XCASSerializer.serialize(jcas.getCas(), stream, prettyPrint);
  } else if (type == CTAKESSerializer.XMI) {
    XmiCasSerializer.serialize(jcas.getCas(), jcas.getTypeSystem(),
        stream, prettyPrint, new XmiSerializationSharedData());
  } else {
    XmlCasSerializer.serialize(jcas.getCas(), jcas.getTypeSystem(),
        stream);
  }
}

代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-parsers

/**
 * Serializes a CAS in the given format.
 * 
 * @param jcas
 *            CAS (Common Analysis System) to be serialized.
 * @param type
 *            type of cTAKES (UIMA) serializer used to write CAS.
 * @param prettyPrint
 *            {@code true} to do pretty printing of output.
 * @param stream
 *            {@see OutputStream} object used to print out information
 *            extracted by using cTAKES.
 * @throws SAXException
 *             if there was a SAX exception.
 * @throws IOException
 *             if any I/O error occurs.
 */
public static void serialize(JCas jcas, CTAKESSerializer type, boolean prettyPrint,
    OutputStream stream) throws SAXException, IOException {
  if (type == CTAKESSerializer.XCAS) {
    XCASSerializer.serialize(jcas.getCas(), stream, prettyPrint);
  } else if (type == CTAKESSerializer.XMI) {
    XmiCasSerializer.serialize(jcas.getCas(), jcas.getTypeSystem(),
        stream, prettyPrint, new XmiSerializationSharedData());
  } else {
    XmlCasSerializer.serialize(jcas.getCas(), jcas.getTypeSystem(),
        stream);
  }
}

代码示例来源:origin: apache/uima-uimaj

this.lenient = lenient;
this.sharedData = 
 sharedData != null ? sharedData : new XmiSerializationSharedData();
this.mergePoint = mergePoint;
this.allowPreexistingFS = allowPreexistingFS;

代码示例来源:origin: org.apache.uima/uimaj-as-jms

switch (serialFormat) {
case XMI:
 XmiSerializationSharedData serSharedData = new XmiSerializationSharedData();
 String serializedCAS = serializeCAS(aCAS, serSharedData);
 msg.put(AsynchAEMessage.CAS, serializedCAS);

代码示例来源:origin: org.apache.uima/uimaj-as-core

deserSharedData = new XmiSerializationSharedData();
uimaSerializer.deserializeCasFromXmi(xmi, cas, deserSharedData, true, -1);
break;

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com