使用输入文件apertest.html
<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,输出:
<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>我原以为:
<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>为什么要把句子分成三部分?
发布于 2021-09-07 07:02:38
可以肯定的是,这是因为spans被认为是字绑定标记(如<em>或<b>),而不是块级别(如<div>)。如果标签是字绑定的,Apertium可以自由地删除或复制它.块级结构OTOH始终保持不变。
如果某些类型的跨类被当作块级标记使用,则可以进行预处理(将所有<span class="title">转换为div),也可以使用https://github.com/TinoDidriksen/Transfuse/ (底层格式处理库)查看是否有可能对跨跨进行更细致的处理(如果这种事情经常发生,则在注入中有一个新的特性可以让您将某些跨度标记为实际的div)。然而,预处理似乎是最简单的出路。
https://stackoverflow.com/questions/69082107
复制相似问题