gpt4 book ai didi

net.sf.okapi.common.skeleton.ZipSkeleton.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 18:47:31 27 4
gpt4 key购买 nike

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

ZipSkeleton.<init>介绍

暂无

代码示例

代码示例来源:origin: net.sf.okapi/okapi-core

@Override
  public ZipSkeleton clone() {
    ZipSkeleton newSkel = new ZipSkeleton(original, entry);
    newSkel.setModifiedContents(modifiedContents);
    super.copyFields(newSkel);
    return newSkel;
  }
}

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-idml

@Override
public Event open() throws IOException, XMLStreamException {
  DocumentPart documentPart = new DocumentPart(zipEntry.getName(), false);
  ZipSkeleton skeleton = new ZipSkeleton(zipFile, zipEntry);
  skeleton.setModifiedContents(getModifiedContent());
  return new Event(EventType.DOCUMENT_PART, documentPart, skeleton);
}

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-openxml

@Override
public Event open(String documentId, String subDocumentId, LocaleId srcLang) throws IOException, XMLStreamException {
  DocumentPart dp = new DocumentPart(entry.getName(), false);
  ZipSkeleton skel = new ZipSkeleton(zipFile.getZip(), entry);
  skel.setModifiedContents(getModifiedContent());
  return new Event(EventType.DOCUMENT_PART, dp, skel);
}

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-idml

protected Event createStartSubDocumentEvent() {
  StartSubDocument sd = new StartSubDocument(parentId, id);
  sd.setName(zipEntry.getName());
  sd.setMimeType(MIME_TYPE);
  ZipSkeleton zs = new ZipSkeleton(zipFile, zipEntry);
  sd.setSkeleton(zs);
  sd.setFilterParameters(parameters);
  return new Event(EventType.START_SUBDOCUMENT, sd);
}

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-archive

private Event nextInZipFile () {
  while( entries.hasMoreElements() ) {
    entry = entries.nextElement();
    subFilter = getSubFilter(entry.getName());
    if (subFilter != null) {	
      subDocWriter = subFilter.createFilterWriter();
      ((ZipFilterWriter) createFilterWriter()).setSubDocWriter(subDocWriter);
      return openSubDocument();
    }
    else {
      DocumentPart dp = new DocumentPart(entry.getName(), false);
      ZipSkeleton skel = new ZipSkeleton(zipFile, entry);
      return new Event(EventType.DOCUMENT_PART, dp, skel);
    }
  }
  // No more sub-documents: end of the ZIP document
  close();
  Ending ending = new Ending(EID);
  return new Event(EventType.END_DOCUMENT, ending);
}

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-idml

private Event getStartDocumentEvent(URI uri, LocaleId sourceLocale, IFilterWriter filterWriter) {
  StartDocument startDoc = new StartDocument(startDocumentId);
  startDoc.setName(uri.getPath());
  startDoc.setLocale(sourceLocale);
  startDoc.setMimeType(MIME_TYPE);
  startDoc.setFilterWriter(filterWriter);
  startDoc.setFilterParameters(parameters);
  startDoc.setLineBreak("\n");
  startDoc.setEncoding(encoding, false);  // IDML files don't have UTF8BOM
  ZipSkeleton skel = new ZipSkeleton(zipFile, null);
  return new Event(EventType.START_DOCUMENT, startDoc, skel);
}

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-openxml

protected Event createStartSubDocumentEvent(String documentId, String subDocumentId) {
  StartSubDocument sd = new StartSubDocument(documentId, subDocumentId);
  sd.setName(partName);
  if (zipFile != null) { // XXX This null check is a hack for testing
    ZipSkeleton zs = new ZipSkeleton(zipFile.getZip(), entry);
    sd.setSkeleton(zs);
  }
  ConditionalParameters clonedParams = params.clone();
  sd.setFilterParameters(clonedParams);
  return new Event(EventType.START_SUBDOCUMENT, sd);
}

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-archive

private Event openSubDocument () {
  if (subFilter != null) subFilter.close();
  Event event;
  try {
    subFilter.open(new RawDocument(zipFile.getInputStream(entry), "UTF-8", srcLoc, trgLoc));
    event = subFilter.next(); // START_DOCUMENT
  }
  catch (IOException e) {
    throw new OkapiIOException("Error opening internal file.", e);
  }
  
  // Change the START_DOCUMENT event from sub-filter to START_SUBDOCUMENT
  StartDocument sd = null;
  StartSubDocument ssd = null;
  if (event.getEventType() == EventType.START_DOCUMENT) {
    sd = (StartDocument) event.getResource();
    ssd = new StartSubDocument(SID, sd.getId());			
    saveStartDoc = sd; // Remember the SD transformed to SSD not to loose isMultilingual
  }
  else
    ssd = new StartSubDocument(SID, String.valueOf(++subDocId));
  
  ResourceUtil.copyProperties(sd, ssd);
  ssd.setName(docURI.getPath() + "/" + entry.getName()); // Use '/'
  nextAction = NextAction.NEXTINSUBDOC;
  ZipSkeleton skel = new ZipSkeleton(
    (GenericSkeleton)event.getResource().getSkeleton(), zipFile, entry);
  return new Event(EventType.START_SUBDOCUMENT, ssd, skel);
}

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-openxml

/**
 * Open the nested {@link OpenXMLContentFilter} instance on the specified InputStream,
 * and convert a START_SUBDOCUMENT event for it.
 * @param is input stream
 * @param documentId document identifier
 * @param subDocumentId sub-document identifier
 * @param srcLang the source language
 * @return the START_SUBDOCUMENT Event
 */
protected Event openContentFilter(InputStream is, String documentId, String subDocumentId, LocaleId srcLang) {
  contentFilter.open(new RawDocument(is, StandardCharsets.UTF_8.name(), srcLang));
  Event startDocEvent = contentFilter.next();
  // Change the START_DOCUMENT event to START_SUBDOCUMENT
  StartSubDocument sd = new StartSubDocument(documentId, subDocumentId);
  sd.setName(entry.getName());
  ConditionalParameters clonedParams = params.clone();
  clonedParams.nFileType = contentFilter.getParseType();
  sd.setFilterParameters(clonedParams);
  ZipSkeleton skel = new ZipSkeleton((GenericSkeleton)startDocEvent.getStartDocument().getSkeleton(),
                    zipFile.getZip(), entry);
  return new Event(EventType.START_SUBDOCUMENT, sd, skel);
}

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-openxml

startDoc.setEncoding(encoding, false);  // Office 2007 files don't have UTF8BOM
startDoc.setFilterParameters(cparams);
ZipSkeleton skel = new ZipSkeleton(zipFile.getZip(), null);
return new Event(EventType.START_DOCUMENT, startDoc, skel);

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-archive

private Event nextInSubDocument () {
  if (saveStartDoc != null && subDocWriter != null) {
    // To set the lost StartDocument's isMultilingual in sub-filter's skeleton writer
    subDocWriter.getSkeletonWriter().processStartDocument(trgLoc, "UTF-8", null, 
        subDocWriter.getEncoderManager(), saveStartDoc);
    saveStartDoc = null;
  }
  
  Event event;
  while ( subFilter.hasNext() ) {
    event = subFilter.next();
    switch ( event.getEventType() ) {
    case END_DOCUMENT:
      // Change the END_DOCUMENT to END_SUBDOCUMENT
      Ending ending = (Ending) event.getResource();
      nextAction = NextAction.NEXTINZIP;
      ZipSkeleton skel = new ZipSkeleton(
        (GenericSkeleton)event.getResource().getSkeleton(), zipFile, entry);
      return new Event(EventType.END_SUBDOCUMENT, ending, skel);
    
    default: // Else: just pass the event through
      return event;
    }
  }
  return null; // Should not get here
}

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-idml

ZipSkeleton skel = new ZipSkeleton(
    (GenericSkeleton) event.getResource().getSkeleton(), subDocument.getZipFile(), subDocument.getZipEntry());
subDocument.close();

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-openxml

ZipSkeleton skel = new ZipSkeleton(
  (GenericSkeleton)event.getResource().getSkeleton(), zipFile.getZip(), entry);
currentPartHandler.close();

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