"Bernard Chardonneau" <[email protected]>
writes:

> Now, I would like to make a rule in witch several attributes will be
> changed according to conditions.
>
> The rule (half working)
>
>     <rule>
>       <pattern>
>         <pattern-item n="prn"/>
>         <pattern-item n="verbe"/>
>       </pattern>
>       <action>
>         <out>
>           <lu>
>             <clip pos="1" side="tl" part="lem"/>
>             <clip pos="1" side="tl" part="type_mot"/>
>             <clip pos="1" side="tl" part="personne"/>
>             <clip pos="1" side="tl" part="genre"/>
>             <clip pos="1" side="tl" part="nombre"/>
>           </lu>
>           <b />
>           <lu>
>             <clip pos="2" side="tl" part="lem"/>
>             <clip pos="2" side="tl" part="type_mot"/>
>             <clip pos="2" side="tl" part="temps"/>
>             <clip pos="1" side="tl" part="personne"/>
>             <clip pos="1" side="tl" part="nombre"/>
>           </lu>
>         </out>
>       </action>
>     </rule>
>
> I would like to change some values according to conditions :
>
> if personne = "p2" then
>     nombre <- "pl"
>
> if personne = p3 and nombre = "pl" then
>     genre <- "m"

http://wiki.apertium.eu/index.php/Session_5:_Structural_transfer_basics#Practice
has a simple example that does this kind of thing, look for the
<choose><when> parts. 


-- 
Kevin Brubeck Unhammer

GPG: 0x766AC60C


------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Apertium-stuff mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/apertium-stuff

Reply via email to