gpt4 book ai didi

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

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

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

XMLWriter.writeEndElementLineBreak介绍

[英]Writes the end of the last started element and writes a line-break.
[中]写入上一个开始元素的结尾,并写入换行符。

代码示例

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

/**
 * Writes the end of a <group> element.
 * @see #writeStartGroup(StartGroup)
 */
public void writeEndGroup () {
  writer.writeEndElementLineBreak(); // group
}

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

/**
 * Writes the end of a <file> element.
 * This method should be called for each call to {@link #writeStartFile(String, String, String)}.
 * @see #writeStartFile(String, String, String)
 */
public void writeEndFile () {
  writer.writeEndElementLineBreak(); // body
  writer.writeEndElementLineBreak(); // file
  inFile = false;
}
/**

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

private void processEndGroup (Ending resource) {
  writer.writeEndElementLineBreak(); // group
}

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

/**
 * Writes the end of the TMX document.
 */
public void writeEndDocument () {
  writer.writeEndElementLineBreak(); // body
  writer.writeEndElementLineBreak(); // tmx
  writer.writeEndDocument();
}

代码示例来源:origin: net.sf.okapi.steps/okapi-step-gttbatchtranslation

private void endExtractedBlock () {
  // Close the extraction file
  htmlWriter.writeEndElementLineBreak(); // html
  htmlWriter.close();
  // Check if we need to process 
  if ( blocks.size() >= 4 ) {
    processExtractionBlocks();
  }
}

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

@Override
protected void endWriting(OutputStream outStream) {
  writer.writeEndElementLineBreak(); // body
  writer.writeEndDocument();
  writer.close();
}

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

protected void writeProp(String name, String value) {
  // Write out the property
  if (expandDuplicateProps) {
    StringTokenizer st = new StringTokenizer(value, propValueSep, false);
    while (st.hasMoreTokens()) {
      writer.writeStartElement("prop");
      writer.writeAttributeString("type", name);
      writer.writeString(st.nextToken());
      writer.writeEndElementLineBreak(); // prop
    }             
  } else {
    writer.writeStartElement("prop");
    writer.writeAttributeString("type", name);
    writer.writeString(value);
    writer.writeEndElementLineBreak(); // prop
  }
}

代码示例来源:origin: net.sf.okapi.steps/okapi-step-gttbatchtranslation

private void startExtractedBlock () {
  try {
    File tmpFile = File.createTempFile("~okapi-45_gttbt_", ".html");
    blocks.add(tmpFile);
    
    // Create the HTML file
    htmlWriter = new XMLWriter(tmpFile.getPath());
    // Start building the source file
    htmlWriter.writeStartElement("html");
    htmlWriter.writeStartElement("meta");
    htmlWriter.writeAttributeString("http-equiv", "Content-Type");
    htmlWriter.writeAttributeString("content", "text/html; charset=UTF-8");
    htmlWriter.writeEndElementLineBreak();
    count = 100; // Roughly
  }
  catch ( IOException e ) {
    throw new OkapiIOException("Error creating extraction file.", e);
  }
}

代码示例来源:origin: net.sf.okapi.steps/okapi-step-leveraging

private XMLWriter startTemporaryFiles () {
  // Create the HTML source file
  XMLWriter htmlWriter = new XMLWriter(htmlSourceFile.getPath());
  // Start building the source file
  htmlWriter.writeStartElement("html");
  htmlWriter.writeStartElement("meta");
  htmlWriter.writeAttributeString("http-equiv", "Content-Type");
  htmlWriter.writeAttributeString("content", "text/html; charset=UTF-8");
  htmlWriter.writeEndElementLineBreak();
  // Set the output name and make sure it's deleted
  String path = htmlSourceFile.getAbsolutePath();
  path = Util.getDirectoryName(path) + File.separator + Util.getFilename(path, false) + ".trg.html";
  htmlTargetFile = new File(path);
  if ( htmlTargetFile.exists() ) {
    htmlTargetFile.delete();
  }
  // Create the store for the original source
  path = htmlSourceFile.getAbsolutePath();
  path = Util.getDirectoryName(path) + File.separator + Util.getFilename(path, false) + ".ori.bin";
  originalStoreFile = new File(path);
  store.create(originalStoreFile);
  
  return htmlWriter;
}

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

/**
 * Writes the end of this the document and close it.
 * If a <file> element is currently opened, it is closed automatically.
 */
public void close () {
  if ( writer != null ) {
    if ( !hasFile ) {
      writeStartFile(original, dataType, skeletonPath, fwConfigId, fwInputEncoding, null);
    }
    if ( inFile ) {
      writeEndFile();
    }
    writer.writeEndElementLineBreak(); // xliff
    writer.writeEndDocument();
    writer.close();
    writer = null;
  }
  fwConfigId = null;
  fwInputEncoding = null;
  skeletonPath = null;
}

代码示例来源:origin: net.sf.okapi.steps/okapi-step-gttbatchtranslation

htmlWriter.writeEndElementLineBreak(); // p

代码示例来源:origin: net.sf.okapi.steps/okapi-step-rainbowkit

XR.writeEndElementLineBreak(); // source_dir
XR.writeEndElementLineBreak(); // target_dir
XR.writeEndElementLineBreak(); // tm_dir
XR.writeEndElementLineBreak(); // glossary_dir
XR.writeEndElementLineBreak(); // dictionary_dir
XR.writeEndElementLineBreak(); // source_lang
XR.writeEndElementLineBreak(); // target_lang
XR.writeEndElementLineBreak(); // sentence_seg
    XR.writeEndElementLineBreak(); // external_command
XR.writeEndElementLineBreak(); // project

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

writer.writeAttributeString("type", name);
  writer.writeString(attributes.get(name));
  writer.writeEndElementLineBreak(); // prop
writer.writeRawXML(tmxCont.setContent(source).toString());
writer.writeEndElementLineBreak(); // tuv
  writer.writeRawXML(tmxCont.setContent(target).toString());
  writer.writeEndElementLineBreak(); // tuv
writer.writeEndElementLineBreak(); // tu

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

writer.writeAttributeString("type", "start");
writer.writeAttributeString("include", (includeStartCodes ? "yes" : "no"));
writer.writeEndElementLineBreak(); // formathandle
writer.writeEndElementLineBreak(); // formathandle
writer.writeEndElementLineBreak(); // formathandle
  writer.writeAttributeString("treatIsolatedCodesAsWhitespace",
      (treatIsolatedCodesAsWhitespace ? "yes" : "no"));
  writer.writeEndElementLineBreak(); // okpsrx:options
  writer.writeAttributeString("useMappedRules", (testOnSelectedGroup() ? "no" : "yes"));
  writer.writeString(getSampleText());
  writer.writeEndElementLineBreak(); // okpsrx:sample
  writer.writeEndElementLineBreak(); // okpsrx:rangeRule
writer.writeEndElementLineBreak(); // header
    writer.writeElementString("afterbreak", rule.after);
    writer.writeLineBreak();
    writer.writeEndElementLineBreak(); // rule
  writer.writeEndElementLineBreak(); // languagerule
writer.writeEndElementLineBreak(); // languagerules
  writer.writeAttributeString("languagepattern", langMap.pattern);

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

writer.writeEndElementLineBreak(); // tu
writer.flush();

代码示例来源:origin: net.sf.okapi.steps/okapi-step-leveraging

htmlWriter.writeAttributeString("id", String.format("%d:%s:%s", currentSubDocId, tu.getId(), seg.id));
htmlWriter.writeRawXML(qutil.toCodedHTML(seg.text));
htmlWriter.writeEndElementLineBreak(); // p
atLeastOne = true;
docEntries++;

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

writer.writeEndElementLineBreak(); // tuv

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

writer.writeEndElementLineBreak(); // source
writer.writeEndElementLineBreak(); // target
annotatorsRef.pop();
writer.writeEndElementLineBreak(); // alt-trans

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

private void writeXliffNotes(ITextUnit tu) {
  XLIFFNoteAnnotation notes = tu.getAnnotation(XLIFFNoteAnnotation.class);
  if (notes == null) {
    return;
  }
  for (XLIFFNote n : notes) {
    writer.writeStartElement("note");
    // annotates
    if (n.getAnnotates() != null) {
      writer.writeAttributeString("annotates", n.getAnnotates().toString());
    }
    // from
    if (n.getFrom() != null) {
      writer.writeAttributeString("from", n.getFrom());
    }
    // priority
    if (n.getPriority() != null) {
      writer.writeAttributeString("priority", n.getPriority().toString());
    }
    writer.writeString(n.getNoteText());
    writer.writeEndElementLineBreak(); // note
  }
}

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

writer.writeRawXML(extraForHeader);
writer.writeEndElementLineBreak(); // header

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