net.sf.okapi.lib.translation.QueryUtil.fromCodedHTML()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(65)

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

QueryUtil.fromCodedHTML介绍

[英]Converts back a coded HTML to a coded text. (extra span elements are removed).
[中]将编码的HTML转换回编码的文本。(额外的跨度元素被移除)。

代码示例

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

/**
 * Converts back a coded HTML to a coded text.
 * (extra span elements are removed).
 * 
 * @param htmlText the coded HTML to convert back.
 * @param fragment the original text fragment.
 * @param addMissingCodes true to added codes that are in the original fragment but not in the HTML string.
 * @return the coded text with its code markers.
 */
public String fromCodedHTML (String htmlText,
  TextFragment fragment,
  boolean addMissingCodes)
{
  return fromCodedHTML(htmlText, fragment, addMissingCodes, true);
}

代码示例来源:origin: net.sf.okapi.connectors/okapi-connector-microsoft

private TextFragment makeFragment(String codedHtml, TextFragment sourceFragment) {
    return sourceFragment.hasCode() ?
        new TextFragment(util.fromCodedHTML(codedHtml, sourceFragment, false), sourceFragment.getClonedCodes()) :
        new TextFragment(util.fromCodedHTML(codedHtml, sourceFragment, false));
  }
}

代码示例来源:origin: net.sf.okapi.connectors/okapi-connector-apertium

result.source = fragment;
if ( fragment.hasCode() ) {
  result.target = new TextFragment(util.fromCodedHTML(res, fragment, true),
    fragment.getClonedCodes());
  result.target = new TextFragment(util.fromCodedHTML(res, fragment, true));

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

String ctext = qutil.fromCodedHTML(elem.getContent().toString(), srcFrag, true);
trgFrag = new TextFragment(ctext, srcFrag.getCodes());

相关文章