首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >意料之外的输出句分为三个部分

意料之外的输出句分为三个部分
EN

Stack Overflow用户
提问于 2021-09-07 03:29:53
回答 1查看 24关注 0票数 2

使用输入文件apertest.html

代码语言:javascript
复制
<h4><a href="/" rel="nofollow" title="Vodafone anuncia su plan para actualizar la red de cable de Ono a la tecnología DOCSIS 3.1 para poder ofrecer conexiones simétricas de 1 Gbps"><span class="title">Vodafone actualizará la red de Ono para poder ofrecer 1 Gbps simétrico</span> <span class="reach">144</span> <span class="date">2016</span> </a></h4>

运行cat apertest.html | apertium -f html -u es-en,输出:

代码语言:javascript
复制
<h4><a href="/" rel="nofollow" title="Vodafone Announces his plan to update the network of wire of Ono to the technology DOCSIS 3.1 to be able to offer symmetrical connections of 1 Gbps"><span class="title">Vodafone Will</span> update <span class="title">the network of Ono to be able to offer 1 Gbps symmetrical</span> <span class="reach">144</span> <span class="date">2016</span></a></h4>

我原以为:

代码语言:javascript
复制
<h4><a href="/" rel="nofollow" title="Vodafone Announces his plan to update the network of wire of Ono to the technology DOCSIS 3.1 to be able to offer symmetrical connections of 1 Gbps"><span class="title">Vodafone Will update the network of Ono to be able to offer 1 Gbps symmetrical</span> <span class="reach">144</span> <span class="date">2016</span></a></h4>

为什么要把句子分成三部分?

EN

回答 1

Stack Overflow用户

发布于 2021-09-07 07:02:38

可以肯定的是,这是因为spans被认为是字绑定标记(如<em><b>),而不是块级别(如<div>)。如果标签是字绑定的,Apertium可以自由地删除或复制它.块级结构OTOH始终保持不变。

如果某些类型的跨类被当作块级标记使用,则可以进行预处理(将所有<span class="title">转换为div),也可以使用https://github.com/TinoDidriksen/Transfuse/ (底层格式处理库)查看是否有可能对跨跨进行更细致的处理(如果这种事情经常发生,则在注入中有一个新的特性可以让您将某些跨度标记为实际的div)。然而,预处理似乎是最简单的出路。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69082107

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档