El dt 20 de 12 de 2011 a les 16:15 +0000, en/na Jimmy O'Regan va
escriure:
> On 20 December 2011 15:11, Mikel Forcada <[email protected]> wrote:
> > Pim:
> >
> > I'm trying to fix an issue with the af-nl pair, namely that removing
> > "nie" at the end of a sentence leaves a space between the last word
> > and the period.
> >
> > Have you tried to see where this extra space is added? I assume this is a
> > problem with a .t1x rule or similar dealing with nie, which does not
> > properly take care of superblanks. The rule <rule comment="REGLA: nie"> is
> 
> Blank handling can only be done when the blank is _inside_ the chunk.
> Which, usually, is what you want.
> 
> This file:
> <?xml version="1.0"?>
> <transfer>
>   <section-def-cats>
>     <def-cat n="punct">
>       <cat-item lemma="," tags="cm"/>
>       <cat-item lemma="." tags="sent"/>
>       <cat-item lemma=";" tags="sent"/>
>       <cat-item lemma=":" tags="sent"/>
>     </def-cat>
> 
>     <def-cat n="any">
>       <cat-item tags=""/>        <!-- unknown words -->
>       <cat-item tags="*"/>
>     </def-cat>
> 
>   </section-def-cats>
> 
>   <section-def-attrs>
>   </section-def-attrs>
> 
>   <section-def-vars>
>   </section-def-vars>
> 
>   <section-rules>
>     <rule>
>       <pattern>
>         <pattern-item n="any"/>
>         <pattern-item n="punct"/>
>       </pattern>
>       <action>
>         <choose>
>           <when>
>             <test>
>               <equal>
>                 <b pos="1"/>
>                 <lit v=" "/>
>               </equal>
>             </test>
>             <out>
>               <lu><clip pos="1" side="tl" part="whole"/></lu>
>               <lu><clip pos="2" side="tl" part="whole"/></lu>
>             </out>
>           </when>
>           <otherwise>
>             <out>
>               <lu><clip pos="1" side="tl" part="whole"/></lu>
>               <b pos="1"/>
>               <lu><clip pos="2" side="tl" part="whole"/></lu>
>             </out>
>           </otherwise>
>         </choose>
>       </action>
>     </rule>
>   </section-rules>
> </transfer>
> 
> when saved as 'noblank.t1x' gives the correct output:
> 
> $ echo '^test<n><sg>$ ^.<sent>$' |apertium-transfer -n noblank.t1x noblank.bin
> ^test<n><sg>$^.<sent>$
> $ echo '^test<n><sg>$[ ]^.<sent>$' |apertium-transfer -n noblank.t1x
> noblank.bin
> ^test<n><sg>$[ ]^.<sent>$
> 
> I presume you want the same behaviour for ',' ':' and ';' as '.'

Excellent job, thanks! I've committed this change :)

Fran


------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Apertium-stuff mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/apertium-stuff

Reply via email to