gpt4 book ai didi

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

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

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

XMLWriter.writeRawXML介绍

[英]Writes a chunk of raw XML (and line-breaks are normalized to platform specific ones). If a tag is open, it is closed automatically before the data are written. Use #appendRawXML(String) to output without preliminary closing.
[中]写入一大块原始XML(换行符被规范化为特定于平台的换行符)。如果标签打开,则在写入数据之前会自动关闭。使用#appendRawXML(字符串)输出,无需初步关闭。

代码示例

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

private void printBracket (int index,
  String range)
{
  writer.writeRawXML("<tr "+
    ((index % 2)==0 ? "" : "bgcolor=#FFFFCC")
    + "><td>"+range+"</td>"); //$NON-NLS-1$
  writer.writeRawXML(String.format("<td align='right'>%d</td>", edBrackets[index])); //$NON-NLS-1$
  // ED-Scores
  writer.writeRawXML(((itemCount == 0) ? "<td align='right'>NA</td>" : String.format("<td align='right'>%.0f</td>", (float)edBrackets[index]/itemCount*100))); //$NON-NLS-1$
  writer.writeRawXML(String.format("<td align='right'>%d</td>", edWCBrackets[index])); //$NON-NLS-1$
  writer.writeRawXML(((wcTotal == 0) ? "<td align='right'>NA</td>" : String.format("<td align='right'>%.0f</td>", (float)edWCBrackets[index]/wcTotal*100))); //$NON-NLS-1$
  writer.writeRawXML(String.format("<td align='right'>%d</td>", fmBrackets[index])); //$NON-NLS-1$
  // FM-Scores
  writer.writeRawXML(((itemCount == 0) ? "<td align='right'>NA</td>" : String.format("<td align='right'>%.0f</td>", (float)fmBrackets[index]/itemCount*100))); //$NON-NLS-1$
  writer.writeRawXML(String.format("<td align='right'>%d</td>", fmWCBrackets[index])); //$NON-NLS-1$
  writer.writeRawXML(((wcTotal == 0) ? "<td align='right'>NA</td>" : String.format("<td align='right'>%.0f</td>", (float)fmWCBrackets[index]/wcTotal*100))); //$NON-NLS-1$
  writer.writeRawXML("</tr>\n"); //$NON-NLS-1$
}

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

writer.writeRawXML("<table border=1 cellspacing=0 cellpadding=5>"); //$NON-NLS-1$
writer.writeRawXML("<tr><th rowspan=2>Scores</th><th colspan=4>ED-Scores</th><th colspan=4>FM-Scores</th></tr>");
writer.writeRawXML("<tr>"
    + "<th style=\"text-align: right; width: 100px;\">Segments </th>"
    + "<th style=\"text-align: right; width: 100px;\">% </th>"
printBracket(1, "10 - 19");
printBracket(0, "0 - 9");
writer.writeRawXML("<tr><td>Total</td>"); //$NON-NLS-1$
writer.writeRawXML(String.format("<td align='right'>%d</td>", itemCount)); //$NON-NLS-1$    			
writer.writeRawXML("<td align='right'>100%</td>"); //$NON-NLS-1$
writer.writeRawXML(String.format("<td align='right'>%d</td>", wcTotal)); //$NON-NLS-1$
writer.writeRawXML("<td align='right'>100%</td>"); //$NON-NLS-1$
writer.writeRawXML(String.format("<td align='right'>%d</td>", itemCount)); //$NON-NLS-1$    			
writer.writeRawXML("<td align='right'>100%</td>"); //$NON-NLS-1$
writer.writeRawXML(String.format("<td align='right'>%d</td>", wcTotal)); //$NON-NLS-1$
writer.writeRawXML("<td align='right'>100%</td>"); //$NON-NLS-1$
writer.writeRawXML("</tr>\n"); //$NON-NLS-1$
writer.writeRawXML("</table>\n"); // table
writer.writeElementString("p", " ");
writer.writeRawXML("<tr><td>"); //$NON-NLS-1$
writer.writeString("Total Number of Segments:"); //$NON-NLS-1$
writer.writeRawXML("</td><td><b>"); //$NON-NLS-1$
writer.writeString(String.format("%d", itemCount));
writer.writeRawXML("</b></td></tr>\n"); //$NON-NLS-1$
writer.writeRawXML("<tr><td>"); //$NON-NLS-1$
writer.writeString("Total Number of Words:"); //$NON-NLS-1$

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

writer.writeStartElement("html"); //$NON-NLS-1$
writer.writeStartElement("head"); //$NON-NLS-1$
writer.writeRawXML("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />"); //$NON-NLS-1$
writer.writeRawXML("<style>td { font-family: monospace } td { vertical-align: top; white-space: pre } td.p { border-top-style: solid; border-top-width: 1px;}</style>"); //$NON-NLS-1$
writer.writeString(String.format("Base document (%s): %s",
  params.getDocument1Label(), baseDocumentPath));
writer.writeRawXML("<br>");
writer.writeString(String.format("Comparison 1 (%s): %s",
  params.getDocument2Label(), compDocumentPath));
if ( rawDoc3 != null ) {
  writer.writeRawXML("<br>");
  writer.writeString(String.format("Comparison 2 (%s): %s",
    params.getDocument3Label(), rawDoc3.getInputURI().getPath()));
writer.writeRawXML("<p>ED-Score = Edit distance score, FM-Score = Fuzzy Match score.<br/>For details see: "
  +"<a href='"+WIKIURL+"'>"+WIKIURL+"</a>.</p>");
writer.writeRawXML("<p><a href='#summary'>Go to Summary</a></p>");
writer.writeStartElement("table"); //$NON-NLS-1$

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

htmlWriter.writeRawXML(out);

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

report = new XMLWriter(reportPath);
report.writeStartDocument();
report.writeRawXML("<h1>Transifex Package Summary</h1>");
report.writeLineBreak();
report.writeRawXML(String.format("<p>Resources uploaded to Transifex in the project "
  + "<b><a target='_blank' href='%s'>%s</a></b></p>",
  options.getServerWithoutAPI() + "projects/p/" + options.getProjectId() + "/",
  options.getProjectName()));
report.writeLineBreak();
report.writeRawXML("<table border='1' cellspacing='0' cellpadding='5'>");
report.writeRawXML("<tr><th>Transifex Resource</th><th>Original Source File</th></tr>");
report.writeLineBreak();
  report.writeRawXML(String.format("<tr><td><a target='_blank' href=\"%s\">%s</a></td>",
    options.getServerWithoutAPI() + "projects/p/" + options.getProjectId() + "/language/"+manifest.getSourceLocale().toPOSIXLocaleId()+"/",
    resourceFile));
  report.writeRawXML(String.format("<td>%s</td></tr>", info.getRelativeInputPath()));
  report.writeLineBreak();
report.writeRawXML("</table>");
report.writeRawXML("<p>For more information about this package, see: "
  + "<a target='_blank' href='http://www.opentag.com/okapi/wiki/index.php?title=Rainbow_TKit_-_Transifex_Project'>"
  + "Rainbow TKit - Transifex Project</a>.");
report.writeRawXML("<p><font size='2'>Note: This report was generated when creating the translation package, "
  + "the Transifex project may have been updated with other files since.</font></p>");
report.close();

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

XR.writeRawXML("__DEFAULT__");
XR.writeRawXML("__DEFAULT__");
XR.writeRawXML("__DEFAULT__");
XR.writeRawXML("__DEFAULT__");
XR.writeRawXML("__DEFAULT__");
XR.writeRawXML(manifest.getSourceLocale().toString());
XR.writeRawXML(manifest.getTargetLocale().toString());
XR.writeRawXML(getPreSegmented() ? "false" : (options.getAllowSegmentation() ? "true" : "false"));

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

writer.writeAttributeString("xml:lang", srcLoc.toBCP47());
writer.writeStartElement("seg");
writer.writeRawXML(tmxCont.setContent(source).toString());
  writer.writeRawXML(tmxCont.setContent(target).toString());

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

writer.writeRawXML("<tr><td class='p'>"); //$NON-NLS-1$
  writer.writeRawXML("</td>"); //$NON-NLS-1$
  writer.writeRawXML("<td class='p'>"); //$NON-NLS-1$
  fmt.setContent(srcFrag);
  writer.writeString(fmt.toString(!params.getGenericCodes()));
  writer.writeRawXML("</td></tr>\n"); //$NON-NLS-1$
  writer.writeRawXML("<tr><td>"); //$NON-NLS-1$
writer.writeRawXML("</td>"); //$NON-NLS-1$
if ( srcFrag != null ) writer.writeRawXML("<td>"); //$NON-NLS-1$
else writer.writeRawXML("<td class='p'>"); //$NON-NLS-1$
fmt.setContent(trgFrag1);
writer.writeString(fmt.toString(!params.getGenericCodes()));
writer.writeRawXML("</td></tr>"); //$NON-NLS-1$
writer.writeRawXML("<tr><td>"); //$NON-NLS-1$
writer.writeString(params.getDocument2Label()+":");
writer.writeRawXML("</td><td>"); //$NON-NLS-1$
fmt.setContent(trgFrag2);
writer.writeString(fmt.toString(!params.getGenericCodes()));
writer.writeRawXML("</td></tr>"); //$NON-NLS-1$
  writer.writeRawXML("<tr><td>"); //$NON-NLS-1$
  writer.writeString(params.getDocument3Label()+":");
  writer.writeRawXML("</td><td>"); //$NON-NLS-1$
  fmt.setContent(trgFrag3);
  writer.writeString(fmt.toString(!params.getGenericCodes()));

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

htmlWriter.writeStartElement("p");
htmlWriter.writeAttributeString("id", String.format("%d:%s:%s", currentSubDocId, tu.getId(), seg.id));
htmlWriter.writeRawXML(qutil.toCodedHTML(seg.text));

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

writer.writeRawXML(tmxCont.setContent(frag).toString());

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

writer.writeAttributeString("xml:lang", alt.getSourceLocale().toBCP47());
  writer.writeRawXML(xliffCont.toSegmentedString(cont, 0, params.getEscapeGt(), false, params.getPlaceholderMode(),
    params.getIncludeCodeAttrs(), params.getIncludeIts(), trgLoc));
  writer.appendRawXML(tmp.toString());
writer.writeRawXML(xliffCont.toSegmentedString(alt.getTarget(), 0, params.getEscapeGt(), false, params.getPlaceholderMode(),
  params.getIncludeCodeAttrs(), params.getIncludeIts(), trgLoc));

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

writer.writeRawXML(params.getToolXmlSnippet());
writer.writeRawXML(extraForHeader);

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

writer.writeRawXML(xliffCont.toSegmentedString(tc, 0, params.getEscapeGt(), false, params.getPlaceholderMode(),
  params.getIncludeCodeAttrs(), params.getIncludeIts(), trgLoc));
List<GenericAnnotations> srcStandoff = xliffCont.getStandoff();
  writer.writeRawXML(xliffCont.toSegmentedString(tc, 0, params.getEscapeGt(), true, params.getPlaceholderMode(),
    params.getIncludeCodeAttrs(), params.getIncludeIts(), trgLoc));
    writer.writeRawXML(xliffCont.toSegmentedString(tc, 0, params.getEscapeGt(), tc.hasBeenSegmented(), params.getPlaceholderMode(),
      params.getIncludeCodeAttrs(), params.getIncludeIts(), trgLoc));
    trgStandoff = xliffCont.getStandoff();
  writer.writeRawXML(writeStandoffLQI(srcStandoff));
  writer.writeRawXML(itsContForSrcCont.writeStandoffLQI());
  writer.writeRawXML(writeStandoffLQI(trgStandoff));
  writer.writeRawXML(itsContForTrgCont.writeStandoffLQI());
  writer.writeRawXML(itsContForUnit.writeStandoffLQI());

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