Hello,

I have encountered a problem while trying to define a rule for a part of
speech with certain tags. For example: romanian defined nouns such as
"cățelul", "băiatul", "fata" that should be translated in french by adding
an article: "le chien", "le garcon", "la fille".
I have tried two approaches, but none of them seems to be working properly.
First, I tried to create a rule that matches all nouns, and verify which of
them has a tag equal to the "def" tag used to recognize defined nouns.

<rule>
   <pattern>
     <pattern-item n="nom"/>
   </pattern>
    <action>
        <choose>
          <when>
            <test>
               <equal>
                  <clip pos="1" side="sl" part="nounart"/>
                  <lit-tag v="def"/>
                </equal>
        </test>
      </when>
    </choose>

I defined "nounart" as:

<def-attr n="nounart">
   <attr-item tags="def"/>
   <attr-item tags="ind"/>
</def-attr>

However, this had as result adding articles to all nouns, and I tend to
believe this approach is useful only with the <let> tag, so you could
change a tag for the lexical item that will be output.(like in the example
here:
http://wiki.apertium.eu/index.php/Session_5:_Structural_transfer_basics#Describe_a_transfer_rule
)

The second attempt was defining:

<def-cat n="defn">
   <cat-item tags="def.*"/>
   <cat-item tags="def"/>
</def-cat>

Also tried:

<def-cat n="defn">
   <cat-item tags="def.*"/>
   <cat-item tags="def"/>
   <cat-item tags="n"/>
</def-cat>

And then having the rule:

<rule>
   <pattern>
     <pattern-item n="defn"/>
   </pattern>
    <action>
     <out>
        <lu>
    <lit v="artn"/>
    <lit-tag v="art"/>
     <clip pos="1" side="tl" part="gender"/>
       </lu>
    <b/>
       <lu>
         <clip pos="1" side="tl" part="lem"/>
         <clip pos="1" side="tl" part="a_nom"/>
         <clip pos="1" side="tl" part="gender"/>
         <clip pos="1" side="tl" part="nbr"/>
         <lit-tag v="nom"/>
         <lit-tag v="ind"/>
       </lu>
     </out>
   </action>
</rule>

This attempt was also unsuccessful.
Could you please help me out with this issue. Which approach would be
closer to the correct one, or what would be the way to go?

Thanks,
Alexandru Blanda
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Apertium-stuff mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/apertium-stuff

Reply via email to