<?xml version="1.0" encoding="UTF-8"?> <!-- -*- nxml -*- -->
<interchunk>
  <section-def-cats>
 
    <def-cat n="SPRN">
      <cat-item lemma="prnsubj" tags="SN.*"/>
    </def-cat>

    <def-cat n="PRNS">
      <cat-item lemma="prnperssubj" tags="SN.*"/>
      <cat-item tags="PRN.subj.*"/>
      <cat-item tags="SN.@SUBJ→.tn.*"/>
    </def-cat>

    <def-cat n="ANT">
      <cat-item lemma="ant" tags="SN.*"/>
    </def-cat>

    <def-cat n="SN_loc">
      <cat-item lemma="pr_nploc" tags="SN.*"/>
    </def-cat>

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

    <def-cat n="CNJADV">
      <cat-item tags="cnjadv"/>
    </def-cat>

    <def-cat n="CS">
      <cat-item tags="cnjsub"/>
    </def-cat>

    <def-cat n="INF">
      <cat-item tags="SV.vblex.inf.*"/>
    </def-cat>
    
    <def-cat n="V_en_train">
      <cat-item lemma="en_train_de_inf" tags="SN"/>
    </def-cat>
     
    <def-cat n="V_être_sg3">
      <cat-item lemma="être" tags="SV.*.vblex.pri.p3.sg"/>
      <cat-item lemma="être" tags="SV.*.*.pri.p3.sg"/>
    </def-cat>
   
    <def-cat n="V_être_temps_que">
      <cat-item lemma="être_temps_que" tags="SV"/>
    </def-cat>

    <def-cat n="V_être_temps_de">
      <cat-item lemma="être_temps_de" tags="SV"/>
    </def-cat>

    <def-cat n="V_falloir">
      <cat-item lemma="falloir" tags="SV"/>
      <cat-item lemma="falloir" tags="SV.*"/>
    </def-cat>

    <def-cat n="V_que">
      <cat-item lemma="vouloir_que" tags="SV"/>
      <cat-item lemma="vouloir_que" tags="SV.*"/>
      <cat-item lemma="falloir_que" tags="SV"/>
      <cat-item lemma="falloir_que" tags="SV.*"/>
      <cat-item lemma="y_avoir_moyen_que" tags="SV"/>
      <cat-item lemma="y_avoir_moyen_que" tags="SV.*"/>
    </def-cat>

    <def-cat n="UNK">
      <cat-item lemma="unknown" tags=""/>
    </def-cat>
    
    <def-cat n="negacio"><!-- BCN-->
      <cat-item tags="SN.DET.*.*.negacio"/>
    </def-cat>
    
    <def-cat n="pr"><!-- BCN-->
      <cat-item tags="PREP"/>
    </def-cat>


     <def-cat n="SN_nopron">
      <cat-item tags="SN.DET.*"/>
      <cat-item tags="SN.UNDET.*"/>
      <cat-item tags="SN.NUM.*"/>
    </def-cat>

    <def-cat n="FMAINV">
      <cat-item tags="SV.@\+FMAINV.*"/>
    </def-cat>

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

<def-cat n="VPART_en_em">
      <cat-item lemma="en em" tags="Vpart.ref"/>
    </def-cat>
<def-cat n="PREP_à">
      <cat-item lemma="à" tags="PREP"/>
    </def-cat>
<def-cat n="VPART_a">
      <cat-item lemma="a" tags="Vpart.subj"/>
      <cat-item lemma="a" tags="Vpart"/>
    </def-cat>
<def-cat n="VPART">
      <cat-item tags="Vpart"/>
      <cat-item tags="Vpart.*"/>
    </def-cat>
<def-cat n="QUEREL">
      <cat-item tags="querel.*"/>
    </def-cat>

    <def-cat n="vbcop">
      <cat-item lemma="être" tags="SV.vblex.*"/>
      <cat-item lemma="être" tags="SV.*.vblex.*"/>
      <cat-item tags="SV.vbser.*"/>
      <cat-item tags="SV.*.vbser.*"/>
    </def-cat>
     
     <def-cat n="adv_neg">
      <cat-item lemma="adv_neg" tags="adv"/>
    </def-cat>
     
     <def-cat n="adv">
      <cat-item tags="adv"/>
      <cat-item tags="adv.*"/>
      <cat-item tags="preadv"/>
      
    </def-cat>

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

     <def-cat n="pp">
      <cat-item lemma="pp"  tags="SA.*"/>
      <cat-item lemma="adj"  tags="SA.*"/><!-- BCN per que agafi bï¿½resolutions adopted -->
    </def-cat>

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

    <def-cat n="RELNN">
      <cat-item tags="REL.nn.*"/>
    </def-cat>

 <def-cat n="RELAN">
      <cat-item tags="REL.an.*"/>
    </def-cat>
    
    <def-cat n="NUM">
      <cat-item lemma="num" tags="SN.*"/>
      <cat-item tags="NUM.*"/>
    </def-cat>

     <def-cat n="punt">
      <cat-item tags="sent"/>
    </def-cat>

    <def-cat n="cnjcoo"> <!-- BCN-->
      <cat-item tags="cnjcoo"/>
    </def-cat>


  </section-def-cats>

  <section-def-attrs>

<def-attr n="pers">
          <attr-item tags="impers"/>
          <attr-item tags="p1"/>
      <attr-item tags="p2"/>
      <attr-item tags="p3"/>
      <attr-item tags="PD"/>
</def-attr>

      <def-attr n="gen">
          <attr-item tags="m"/>
          <attr-item tags="f"/>
      <attr-item tags="mf"/>
      <attr-item tags="GD"/>
      <attr-item tags="nt"/>
      </def-attr>

   <def-attr n="nbr">
          <attr-item tags="sg"/>
      <attr-item tags="pl"/>
      <attr-item tags="sp"/>
      <attr-item tags="ND"/>
      </def-attr>

      <def-attr n="temps">
          <attr-item tags="inf"/>
      <attr-item tags="pri"/>
      <attr-item tags="prs"/>
      <attr-item tags="ifi"/>
      <attr-item tags="pii"/>
      <attr-item tags="pis"/>
      <attr-item tags="cni"/>
      <attr-item tags="fti"/>
      <attr-item tags="pp"/>
      <attr-item tags="ger"/>
      <attr-item tags="imp"/>
      
      </def-attr>

       <def-attr n="a_verb">
      <attr-item tags="vblex"/>      
      <attr-item tags="vblex.pron"/>
      <attr-item tags="vbhaver"/>
      <attr-item tags="vbser"/>
      <attr-item tags="vbmod"/>
      <attr-item tags="HAVER"/>
    </def-attr>
      
  <def-attr n="a_SN">
          <attr-item tags="DET"/>
      <attr-item tags="UNDET"/>
      <attr-item tags="NUM"/>
      <attr-item tags="PDET"/><!--'Per determinar', per a SN UNDET que han de passar a determinats, transformació que fará el postchunk detectant els PDET. -->
   </def-attr>
   <def-attr n="constituent">
     <attr-item tags="subj"/>
     <attr-item tags="obj"/>
   </def-attr>
   <def-attr n="syn_label">
     <attr-item tags="@SUBJ→"/>
     <attr-item tags="@←SUBJ"/>
   </def-attr>


  </section-def-attrs>


  <section-def-vars>
    <def-var n="nombre_subj" v="ND"/>
    <def-var n="partitiu"/>
    <def-var n="pers_subj"/>
    <def-var n="uno"/>
    <def-var n="nombre"/>
    <def-var n="numero"/>
    <def-var n="genere"/>
    <def-var n="concord"/>
    <def-var n="subj_vist"/>
    <def-var n="verb_prs"/>
    <def-var n="last_cnj"/>
  </section-def-vars>


<section-def-lists>
<def-list n="prde">

<list-item v="afin de"/>
<list-item v="à l'égard de"/>
<list-item v="à l'encontre de"/>
<list-item v="à l'exception de"/>
<list-item v="à l'instar de"/>
<list-item v="à l'occasion de"/>
<list-item v="au bout de"/>
<list-item v="au cours de"/>
<list-item v="au delà de"/>
<list-item v="au-delà de"/>
<list-item v="au dire de"/>
<list-item v="au milieu de"/>
<list-item v="au prétexte de"/>
<list-item v="au profit de"/>
<list-item v="au sujet de"/>
<list-item v="dans bien de"/>
<list-item v="dans le cadre de"/>
<list-item v="de"/>
<list-item v="en échange de"/>
<list-item v="en raison de"/>
<list-item v="lors de"/>
<list-item v="par l'intermédiaire de"/>
<list-item v="pour ce qui est de"/>
<list-item v="sur la requête de"/>
        
</def-list>



<def-list n="advcantidad">

<list-item v="plus"/>
<list-item v="moins"/>
<list-item v="beaucoup"/>
</def-list>
</section-def-lists>


<section-def-macros>
  <def-macro n="assign_subj_num" npar="1">
    <choose>
      <when>
        <test>
          <or>
            <equal>
              <var n="nombre_subj"/>
              <lit-tag v="sg"/>
            </equal>
            <equal>
              <var n="nombre_subj"/>
              <lit-tag v="pl"/>
            </equal>
          </or>
        </test>
        <let>
          <clip pos="1" part="nbr"/>
          <var n="nombre_subj"/>
        </let>
      </when>
    </choose>
  </def-macro>
  <def-macro n="check_subject_number1" npar="1">
    <choose>
      <when>
        <test>
          <equal>
            <clip pos="1" part="syn_label"/>
            <lit-tag v="@SUBJ→"/>
          </equal>
        </test>
        <let>
          <var n="nombre_subj"/>
          <clip pos="1" part="nbr"/>
        </let>
      </when>
    </choose>
  </def-macro>
  <def-macro n="convert_tense" npar="1">
    <choose>
      <when>
        <test>
          <and>
            <equal caseless="yes">
              <var n="last_cnj"/>
              <lit v="pour que"/>
            </equal>
            <or>
              <equal>
                <clip pos="1" part="temps"/>
                <lit-tag v="cni"/>
              </equal>
              <equal>
                <clip pos="1" part="temps"/>
                <lit-tag v="fti"/>
              </equal>
            </or>
          </and>
        </test>
        <let>
          <clip pos="1" part="temps"/>
          <lit-tag v="prs"/>
        </let>
      </when>
      <when>
        <test>
          <and>
            <equal caseless="yes">
              <var n="last_cnj"/>
              <lit v="sauf si"/>
            </equal>
            <equal>
              <clip pos="1" part="temps"/>
              <lit-tag v="cni"/>
            </equal>
          </and>
        </test>
        <let>
          <clip pos="1" part="temps"/>
          <lit-tag v="pii"/>
        </let>
      </when>
    </choose>
  </def-macro>

  <def-macro n="f_concord1" npar="1">

  <choose> 
    <when>
      <test>
        <equal>
          <clip pos="1" part="gen"/>
          <lit-tag v="GD"/>
        </equal>
      </test>
      <let>
        <clip pos="1" part="gen"/>
        <lit-tag v="m"/>
      </let>
    </when>
  </choose>
  </def-macro>
 
  <def-macro n="particle_concord2" npar="2">

  <choose> 
    <when>
      <test>
        <equal caseless="yes">
          <clip pos="1" part="lem"/>
          <lit v="en em"/>
        </equal>
      </test>
      <let>
        <clip pos="2" part="lem"/>
        <lit v="verbcj_ref"/>
      </let>
    </when>
  </choose>
    
</def-macro>

<def-macro n="verb_prs_from_prn_inf" npar="2">
  <let>
    <var n="numero"/>
    <clip pos="1" part="nbr"/>
  </let>
  <modify-case>
     <clip pos="2" part="lem"/>
     <lit v="aa"/>
  </modify-case>

  <choose> 
    <when>
      <test>
        <equal caseless="yes">
          <clip pos="2" part="lem"/>
          <lit v="aller"/>
        </equal>
      </test>
      <let>
        <clip pos="2" part="lem"/>
        <lit v="y aller"/>
      </let>
    </when>
  </choose>

  <choose>
    <when>
      <test>
        <equal caseless="yes">
          <clip pos="1" part="lem"/>
          <lit v="prnperssubj"/>
        </equal>
      </test>
      <let>
        <var n="verb_prs"/>
        <concat>
          <lit v="verbcj"/>
          <lit-tag v="SV"/>
          <lit-tag v="vblex.prs"/>
          <clip pos="1" part="pers"/>
          <clip pos="1" part="nbr"/>
          <lit v="{^"/>
          <clip pos="2" part="lem"/>
          <lit-tag v="vblex.prs"/>
          <clip pos="1" part="pers"/>
          <clip pos="1" part="nbr"/> 
          <lit v="$}"/>
        </concat>
      </let>
    </when>
    <otherwise>
      <let>
        <var n="verb_prs"/>
        <concat>
          <lit v="verbcj"/>
          <lit-tag v="SV"/>
          <lit-tag v="vblex.prs.p3"/>
          <var n="numero"/>
          <lit v="{^"/>
          <clip pos="2" part="lem"/>
          <lit-tag v="vblex.prs.p3"/>
          <var n="numero"/>
          <lit v="$}"/>
        </concat>
      </let>
    </otherwise>
  </choose>
</def-macro>

<def-macro n="comprova_concord_2" npar="3">
    <choose>
        <when>
            <test>
                <equal>
                    <clip pos="3" part="nbr"/>
                    <lit-tag v="pl"/>
                </equal>
            </test>
            <choose>
                <when>
                    <test>
                        <equal>
                            <clip pos="3" part="pers"/>
                            <lit-tag v="p1"/>
                        </equal>    
                    </test>
                    <choose>
                        <when>
                            <test>
                                <or>
                                    <equal>
                                        <clip pos="1" part="pers"/>
                                        <lit-tag v="p1"/>
                                    </equal>
                                    <equal>
                                        <clip pos="2" part="pers"/>
                                        <lit-tag v="p1"/>
                                    </equal>
                                </or>
                            </test>
                            <let><var n="concord"/><lit-tag v="yes"/></let>
                        </when>
                        <otherwise>
                            <let><var n="concord"/><lit-tag v="no"/></let>
                        </otherwise>
                    </choose>
                </when> <!--no Ã©s 1a pers-->
                <otherwise>
                    <choose>
                        <when>
                            <test>
                                <equal>
                                    <clip pos="3" part="pers"/>
                                    <lit-tag v="p2"/>
                                </equal>    
                            </test>
                            <choose>
                                <when>
                                    <test>
                                    <or>
                                        <equal>
                                            <clip pos="1" part="pers"/>
                                            <lit-tag v="p3"/>
                                        </equal>
                                        <equal>
                                            <clip pos="2" part="pers"/>
                                            <lit-tag v="p2"/>
                                        </equal>
                                    </or>
                                    </test>
                                    <let><var n="concord"/><lit-tag v="yes"/></let>
                                </when>
                                <otherwise>
                                    <let><var n="concord"/><lit-tag v="no"/></let>
                                </otherwise>
                            </choose>
                        </when> <!--no Ã©s 2a pers-->
                        <otherwise><!--Ã©s 3a pers-->
                            <choose>
                                <when>
                                    <test>
                                        <and>
                                        <not>
                                            <equal>
                                                <clip pos="1" part="pers"/>
                                                <lit-tag v="p1"/>
                                            </equal>
                                        </not>
                                        <not>
                                            <equal>
                                                <clip pos="2" part="pers"/>
                                                <lit-tag v="p1"/>
                                            </equal>
                                        </not>
                                        <not>
                                            <equal>
                                                <clip pos="1" part="pers"/>
                                                <lit-tag v="p2"/>
                                            </equal>
                                        </not>
                                        <not>
                                            <equal>
                                                <clip pos="2" part="pers"/>
                                                <lit-tag v="p2"/>
                                            </equal>
                                        </not>
                                        </and>
                                    </test>
                                    <let><var n="concord"/><lit-tag v="yes"/></let>
                                </when>
                                <otherwise>
                                    <let><var n="concord"/><lit-tag v="no"/></let>
                                </otherwise>
                            </choose>
                        </otherwise>
                    </choose>
                </otherwise>
            </choose>
        </when><!--no Ã©s pl-->
        <otherwise>
            <let><var n="concord"/><lit-tag v="no"/></let>
        </otherwise>
    </choose>
</def-macro>

<def-macro n="assigna_gen_nbr" npar="1">
 <choose><!--To determine value of variables of gender and
                 number and propagate to other rules.  Variables are
                 not used again in this rule -->
        <when> 
            <test>
                <equal>
                    <clip pos="1" part="nbr"/>
                    <lit-tag v="pl"/>
                </equal>
            </test>
            <let><var n="nombre"/><lit-tag v="pl"/></let>
        </when>
<!--afegit per Gema--> <when> 
            <test>
                <equal>
                    <clip pos="1" part="nbr"/>
                    <lit-tag v="sp"/>
                </equal>
            </test>
            <let><clip pos="1" part="nbr"/><lit-tag v="sg"/></let> <!-- @@@ -->
        </when>
        
        <when> 
            <test>
                <equal>
                    <clip pos="1" part="nbr"/>
                    <lit-tag v=""/>
                </equal>
            </test>
            <let><clip pos="1" part="nbr"/><lit-tag v="pl"/></let>
        </when>
        
        <when>
            <test>
                <or>
                <equal>
                    <clip pos="1" part="nbr"/>
                    <lit-tag v="sg"/>
                </equal>
                <equal>
                    <var n="nombre"/>
                    <lit v=""/>
                </equal>
                </or>
            </test>
            <let><var n="nombre"/><lit-tag v="sg"/></let>
        </when>
    </choose> 
    <choose>
        <when> 
            <test>
                <equal>
                    <clip pos="1" part="gen"/>
                    <lit-tag v="f"/>
                </equal>
            </test>
            <let><var n="genere"/><lit-tag v="f"/></let>
        </when>
        <when> 
            <test>
                <or>
                <equal>
                    <clip pos="1" part="gen"/>
                    <lit-tag v="m"/>
                </equal>
                <equal>
                    <var n="genere"/>
                    <lit v=""/>
                </equal>
                </or>
            </test>
            <let><var n="genere"/><lit-tag v="m"/></let>
        </when>
    </choose> 
    <choose>
        <when> 
            <test>
                <equal>
                    <clip pos="1" part="nbr"/>
                    <lit-tag v="ND"/>
                </equal>
            </test>
            <let><clip pos="1" part="nbr"/><var n="nombre"/></let>
        </when>
    </choose>
    <choose>
        <when> 
            <test>
                <equal>
                    <clip pos="1" part="gen"/>
                    <lit-tag v="GD"/>
                </equal>
            </test>
            <let><clip pos="1" part="gen"/><var n="genere"/></let>
        </when>
    </choose>
</def-macro>

<def-macro n="assigna_nombre_subj" npar="1">
    <choose><!--mirem el nbr-->
        <when>
            <test>
                <or>
                    <equal>
                        <var n="nombre_subj"/>
                        <lit v="no_assignat"/>
                    </equal>
                    <equal>
                        <var n="nombre_subj"/>
                        <lit v=""/>
                    </equal>
                </or>
            </test>
            <let><var n="nombre_subj"/><clip pos="1" part="nbr"/></let>
        </when>
        <otherwise>
            <choose>
                <when>
                    <test>
                        <or>
                        <equal>
                            <var n="nombre_subj"/>
                            <lit-tag v="vist_sg"/>
                        </equal>
                        <equal>
                            <var n="nombre_subj"/>
                            <lit-tag v="sg"/>
                        </equal>
                        </or>
                    </test>
                    <let><var n="nombre_subj"/><lit-tag v="pl"/></let>
                </when>
            </choose>
        </otherwise>
    </choose>
    <choose><!--i aquÃ­ la pers-->
        <when>
            <test>
                <or>
                <equal>
                    <var n="pers_subj"/>
                    <lit-tag v="p3"/>
                </equal>
                <equal>
                    <var n="pers_subj"/>
                    <lit v=""/>
                </equal>
                </or>
            </test>
            <choose>
                <when>
                    <test>
                        <equal>
                            <clip pos="1" part="pers"/>
                            <lit-tag v="p1"/>
                        </equal>
                    </test>
                    <let><var n="pers_subj"/><lit-tag v="p1"/></let>
                </when>
                <otherwise>
                    <choose>
                        <when>
                            <test>
                                <equal>
                                    <clip pos="1" part="pers"/>
                                    <lit-tag v="p2"/>
                                </equal>
                            </test>
                            <let><var n="pers_subj"/><lit-tag v="p2"/></let>
                        </when>
                        <otherwise><let><var n="pers_subj"/><lit-tag v="p3"/></let></otherwise>
                    </choose>
                </otherwise>
            </choose>
        </when>
        <otherwise>
            <choose>
                <when>
                    <test>
                        <equal>
                            <var n="pers_subj"/>
                            <lit-tag v="p2"/>
                        </equal>
                    </test>
                    <choose>
                        <when>
                            <test>
                                <equal>
                                    <clip pos="1" part="pers"/>
                                    <lit-tag v="p1"/>
                                </equal>
                            </test>
                            <let><var n="pers_subj"/><lit-tag v="p1"/></let>
                        </when>
<!-- Ã©s p2 -->
                    </choose>
                </when>
            </choose>
        </otherwise>
    </choose>

</def-macro>

<def-macro n="concord_sa" npar="2">
<!--assigna el gen i el nbr del sn en els sa en les frases 
    amb verb copulatiu (p.ex "la perspectiva de tu tía es interesante" 
    -> "interesante" concordará  amb "aperçu")-->

                    <choose>
                        <when> 
                            <test>
                                <equal>
                                    <clip pos="1" part="gen"/>
                                    <lit-tag v="f"/>
                                </equal>
                            </test>
                            <let>
                                <clip pos="2" part="gen"/>
                                <lit-tag v="f"/>
                            </let>
                        </when>
                        <otherwise>
                            <let>
                                <clip pos="2" part="gen"/>
                                <lit-tag v="m"/>
                            </let>
                        </otherwise>
                    </choose>
    
                    <choose>
                        <when> 
                            <test>
                                <equal>
                                    <clip pos="1" part="nbr"/>
                                    <lit-tag v="pl"/>
                                </equal>
                            </test>
                            <let>
                                <clip pos="2" part="nbr"/>
                                <lit-tag v="pl"/>
                            </let>
                        </when>
                        <otherwise>
                            <let>
                                <clip pos="2" part="nbr"/>
                                <lit-tag v="sg"/>
                            </let>
                        </otherwise>
                    </choose>
    
</def-macro>

<def-macro n="concord_sn" npar="2"> <!--asgina gen i nbr en els sn GD o ND quan van seguits de vcop. (p.ex. "esta chica es mi ayudante)-->
    <choose>
        <when> 
            <test>
                    <equal>
                        <clip pos="2" part="gen"/>
                        <lit-tag v="GD"/>
                    </equal>
            </test>
                    <choose>
                        <when> 
                            <test>
                                <equal>
                                    <clip pos="1" part="gen"/>
                                    <lit-tag v="f"/>
                                </equal>
                            </test>
                            <let>
                                <clip pos="2" part="gen"/>
                                <lit-tag v="f"/>
                            </let>
                        </when>
                        <otherwise>
                            <let>
                                <clip pos="2" part="gen"/>
                                <lit-tag v="m"/>
                            </let>
                        </otherwise>
                    </choose>
        </when>
    </choose>
    <choose>
        <when> 
            <test>
                    <equal>
                        <clip pos="2" part="nbr"/>
                        <lit-tag v="ND"/>
                    </equal>
            </test>
                    <choose>
                        <when> 
                            <test>
                                <equal>
                                    <clip pos="1" part="nbr"/>
                                    <lit-tag v="pl"/>
                                </equal>
                            </test>
                            <let>
                                <clip pos="2" part="nbr"/>
                                <lit-tag v="pl"/>
                            </let>
                        </when>
                        <otherwise>
                            <let>
                                <clip pos="2" part="nbr"/>
                                <lit-tag v="sg"/>
                            </let>
                        </otherwise>
                    </choose>
        </when>
    </choose>
</def-macro>

<def-macro n="posa_subj2" npar="1"><!--aquesta és la funció de posar el subjecte vella. com que no hi ha hagut temps d'experimentar bé amb la nova, algunes regles encara la fan servir-->
<choose>
  <when>
     <test>
       <not>
         <equal>
           <clip pos="1" part="gen"/>
           <lit v=""/>
         </equal>
       </not>
     </test>
     <let>
       <var n="genere"/>
       <clip pos="1" part="gen"/>
     </let>
   </when>
</choose>
<choose>
  <when> <!-- Siempre que no sea un imperativo -->
    <test>
      <not>
        <equal>
          <clip pos="1" part="temps"/>
          <lit-tag v="imp"/>
        </equal>
      </not>
    </test>
    <choose>
      <when> <!-- La primera persona -->
        <test>
          <equal>
            <clip pos="1" part="pers"/>
            <lit-tag v="p1"/>
          </equal>
        </test>
        <choose>
          <when> <!-- En singular -->
            <test>
              <equal>
                <clip pos="1" part="nbr"/>
                <lit-tag v="sg"/>
              </equal>
            </test>
            <out>
              <chunk>
                <get-case-from pos="1">
                  <lit v="prnperssubj"/>
                </get-case-from>
                <lit-tag v="SN"/>
                <lit v="{^"/>
                <lit v="je"/>
                <lit-tag v="prn.tn.p1.mf.sg"/>
                <lit v="$}"/>
              </chunk>
              <b/>
            </out>
            </when>
            <otherwise>
              <out>
                <chunk>
                  <get-case-from pos="1">
                    <lit v="prnperssubj"/>
                  </get-case-from>
                  <lit-tag v="SN"/>
                  <lit v="{^"/>
                  <lit v="nous"/>
                  <lit-tag v="prn.tn.p1.mf.pl"/>
                  <lit v="$}"/>
                </chunk>
                <b/>
              </out>
            </otherwise>
          </choose>
        </when>
        <otherwise>
                <choose>
                    <when>
                        <test>
                            <equal>
                                <clip pos="1" part="pers"/>
                                <lit-tag v="p2"/>
                            </equal>
                        </test>
                        <choose>
                            <when>
                                <test>
                                    <equal>
                                        <clip pos="1" part="nbr"/>
                                        <lit-tag v="sg"/>
                                    </equal>
                                </test>
                                <out>
                                    <chunk>
                                        <get-case-from pos="1">
                                            <lit v="prnperssubj"/>
                                        </get-case-from>
                                        <lit-tag v="SN"/>
                                        <lit v="{^"/>
                                        <lit v="tu"/>
                                        <lit-tag v="prn.tn.p2.mf.sg"/>
                                        <lit v="$}"/>
                                    </chunk>
                                    <b/>
                                </out>
                            </when>
                            <otherwise>
                                <out>
                                    <chunk>
                                        <get-case-from pos="1">
                                            <lit v="prnperssubj"/>
                                        </get-case-from>
                                        <lit-tag v="SN"/>
                                        <lit v="{^"/>
                                        <lit v="vous"/>
                                        <lit-tag v="prn.tn.p2.mf.pl"/>
                                        <lit v="$}"/>
                                    </chunk>
                                    <b/>
                                </out>
                            </otherwise>
                        </choose>
                    </when>
                    <when>
                        <test>
                            <equal>
                                <clip pos="1" part="pers"/>
                                <lit-tag v="impers"/>
                            </equal>
                        </test>
                        <choose>
                            <when>
                                <test>
                                    <equal>
                                        <clip pos="1" part="nbr"/>
                                        <lit-tag v="sp"/>
                                    </equal>
                                </test>
                                                                <let>
                                                                  <clip pos="1" part="nbr"/>
                                                                  <lit-tag v="sg"/>
                                                                </let>
                                                                <let>
                                                                  <clip pos="1" part="pers"/>
                                                                  <lit-tag v="p3"/>
                                                                </let>
                                <out>
                                    <chunk>
                                        <get-case-from pos="1">
                                            <lit v="prnperssubj"/>
                                        </get-case-from>
                                        <lit-tag v="SN"/>
                                        <lit v="{^"/>
                                        <lit v="on"/>
                                        <lit-tag v="prn.pro.ref.p3.mf.sp"/>
                                        <lit v="$}"/>
                                    </chunk>
                                    <b/>
                                </out>
                            </when>
                        </choose>
                    </when>
                    <otherwise>
                        <out>
                            <chunk>
                                <get-case-from pos="1">
                                  <lit v="prnperssubj"/>
                                </get-case-from>
                                        
                                <lit-tag v="SN"/>
                                <lit v="{^"/>
                                <lit v="il"/> <!-- @@@ -->
                                <lit-tag v="prn.tn.p3"/>
                                                                <var n="genere"/>
                                <clip pos="1" part="nbr"/>
                                <lit v="$}"/>
                            </chunk>
                            <b/>
                        </out>
                    </otherwise>
                </choose>
            </otherwise>
        </choose>
        <choose>
            <when>
                <test>
                    <equal>
                        <case-of pos="1" part="lem"/>
                        <lit v="Aa"/>
                    </equal>
                </test>
                <modify-case>
                    <clip pos="1" part="lem"/>
                    <lit v="aa"/>
                </modify-case>
            </when>
        </choose>
    </when>
</choose>
</def-macro>



<def-macro n="posa_subj" npar="1">
    <choose>
      <when>
         <test>
           <not>
             <equal>
               <clip pos="1" part="gen"/>
               <lit v=""/>
             </equal>
           </not>
         </test>
         <let>
           <var n="genere"/>
           <clip pos="1" part="gen"/>
         </let>
       </when>
       <when>
         <test>
             <equal>
               <var n="genere"/>
               <lit-tag v="f"/>
             </equal>
         </test>
         <let>
           <var n="genere"/>
           <lit-tag v="f"/>
         </let>
       </when>
       <otherwise>
         <let>
           <var n="genere"/>
           <lit-tag v="m"/>
         </let>
       </otherwise>
    </choose>
    <choose>
      <when>
        <test>
          <and>
            <equal>
              <var n="subj_vist"/>
              <lit v="yes"/>
            </equal>
            <not>
              <equal>
                <clip pos="1" part="lem"/>
                <lit v="verbcj_ref"/>
              </equal>
            </not>
            <equal>
              <clip pos="1" part="pers"/>
              <lit-tag v="impers"/>
            </equal>
            <equal>
              <clip pos="1" part="nbr"/>
              <lit-tag v="sp"/>
            </equal>
          </and>
        </test>
        <let>
          <clip pos="1" part="pers"/>
          <lit-tag v="p3"/>
        </let>
        <let>
          <clip pos="1" part="nbr"/>
          <lit-tag v="sg"/>
        </let>
      </when>
    </choose>

    <choose>
        <when>
            <test>
               <and>
                <not>
                    <equal>
                        <clip pos="1" part="temps"/>
                        <lit-tag v="imp"/>
                    </equal>
                </not>
                <not>
                    <equal>
                        <clip pos="1" part="temps"/>
                        <lit-tag v="inf"/>
                    </equal>
                </not>
                <not>
                  <equal>
                    <var n="subj_vist"/>
                    <lit v="yes"/>
                  </equal>
                </not>
            <not>
              <equal>
                <clip pos="1" part="lem"/>
                <lit v="verbcj_ref"/>
              </equal>
            </not>
               </and>    
            </test>

            <choose><!--aposta arriscada: vol dir que hem vist un sn sg i una cnjcoo; i desprès cap altre sn=> suposem que es mantÃ© sg?-->
                <when>
                    <test>
                        <equal>
                            <var n="nombre_subj"/>
                            <lit-tag v="vist_sg"/>
                        </equal>
                    </test>
                    <let><var n="nombre_subj"/><lit-tag v="vist_sg"/></let>
                </when>
            </choose>

            <choose>
                <when><!-- si el verb está  en impers -->
                    <test>
                        <equal>
                            <clip pos="1" part="pers"/>
                            <lit-tag v="impers"/>
                        </equal>
                    </test>
                    <let>
                        <clip pos="1" part="nbr"/>
                        <lit-tag v="sg"/>
                    </let>
                    <let>
                        <clip pos="1" part="pers"/>
                        <lit-tag v="p3"/>
                    </let>
                    <choose>
                        <when>
                            <test>
                                <or>
                                    <equal caseless="yes">
                                      <clip pos="1" part="lem"/>
                                      <lit v="verbcj_ref"/>
                                    </equal>
                                    <equal caseless="yes">
                                      <clip pos="1" part="lem"/>
                                      <lit v="pronaux_pp"/>
                                    </equal>
                                </or>
                            </test>
                            <out>
                                <chunk>
                                    <get-case-from pos="1">
                                        <lit v="prnperssubj"/>
                                    </get-case-from>
                                        <lit-tag v="SN"/>
                                        <lit v="{^"/>
                                        <lit v="on"/>
                                        <lit-tag v="prn.pro.ref.p3.mf.sp"/>
                                        <lit v="$}"/>
                                            </chunk>
                                            <b/>
                                            <chunk>
                                                <lit v="prnpro"/>
                                                <lit-tag v="SN"/>
                                                <lit v="{^"/>
                                                <lit v="se"/>
                                                <lit-tag v="prn.pro.p3.mf.sg"/>
                                                <lit v="$}"/>
                                            </chunk>
                                            <b/>
                                        </out>
                                    </when>
                                <otherwise>
                                            <out>
                                                <chunk>
                                                    <get-case-from pos="1">
                                                    <lit v="prnperssubj"/>
                                                    </get-case-from>
                                                    <lit-tag v="SN"/>
                                                    <lit v="{^"/>
                                                    <lit v="on"/>
                                                    <lit-tag v="prn.pro.ref.p3.mf.sp"/>
                                                    <lit v="$}"/>
                                                </chunk>
                                                <b/>
                                            </out>
                                </otherwise>
                                </choose>
                        </when>
                <when>
                    <test><!--el verb está en primera persona-->
                        <equal>
                            <clip pos="1" part="pers"/>
                            <lit-tag v="p1"/>
                        </equal>
                    </test>
                    <choose>
                        <when>
                            <test><!--mirem si concorda amb el possible subj-->
                                <or>
                                    <not>
                                        <equal>
                                            <var n="pers_subj"/>
                                            <lit-tag v="p1"/>
                                        </equal>
                                    </not>
                                    <not>
                                        <equal>
                                            <clip pos="1" part="nbr"/>
                                            <var n="nombre_subj"/>
                                        </equal>
                                    </not>
                                </or>
                            </test>
                            <choose><!--si no, n'hi posem un-->
                                <when>
                                    <test>
                                        <equal>
                                            <clip pos="1" part="nbr"/>
                                            <lit-tag v="sg"/>
                                        </equal>
                                    </test>

                                    <choose>
                                    <when>
                                    <test>
                                    <or>
                                    <equal caseless="yes">
                                      <clip pos="1" part="lem"/>
                                    <!--  <lit v="pronverb"/> -->
                                      <lit v="verbcj_ref"/>
                                    </equal>
                                    <equal caseless="yes">
                                      <clip pos="1" part="lem"/>
                                      <lit v="pronaux_pp"/>
                                    </equal>
                                    </or>
                                    </test>
                                    <out>
                                        
                                        <chunk>
                                            <lit v="prnperssubj"/>
                                            <lit-tag v="SN"/>
                                            <lit v="{^"/>
                                            <lit v="je"/>
                                            <lit-tag v="prn.tn.p1.mf.sg"/>
                                            <lit v="$}"/>
                                        </chunk>
                                        <b/>
                                        <chunk>
                                        <get-case-from pos="1">
                                            <lit v="prnpro"/>
                                        </get-case-from>
                                            <lit-tag v="SN"/>
                                            <lit v="{^"/>
                                            <lit v="me"/>
                                            <lit-tag v="prn.pro.p1.mf.sg"/>
                                            <lit v="$}"/>
                                                 </chunk>
                                            <b/>
                                    </out>
                                    </when>
                                    <otherwise>
                                    <out>
                                        
                                        <chunk>
                                        <get-case-from pos="1">
                                            <lit v="prnperssubj"/>
                                        </get-case-from>
                                            <lit-tag v="SN"/>
                                            <lit v="{^"/>
                                            <lit v="je"/>
                                            <lit-tag v="prn.tn.p1.mf.sg"/>
                                            <lit v="$}"/>
                                        </chunk>
                                        <b/>
                                    </out>
                                    </otherwise>
                                    </choose>
                                </when>
                                <otherwise>


                                    <choose>
                                    <when>
                                    <test>
                                    <or>
                                    <equal caseless="yes">
                                      <clip pos="1" part="lem"/>
                                      <!-- <lit v="pronverb"/> -->
                                      <lit v="verbcj_ref"/>
                                    </equal>
                                    <equal caseless="yes">
                                      <clip pos="1" part="lem"/>
                                      <lit v="pronaux_pp"/>
                                    </equal>
                                    </or>
                                    </test>
                                    <out>
                                        
                                        <chunk>
                                        <get-case-from pos="1">
                                            <lit v="prnperssubj"/>
                                        </get-case-from>
                                            <lit-tag v="SN"/>
                                            <lit v="{^"/>
                                            <lit v="nous"/>
                                            <lit-tag v="prn.tn.p1.mf.pl"/>
                                            <lit v="$}"/>
                                        </chunk>
                                        <b/>
                                        <chunk>
                                            <lit v="prnpro"/>
                                            <lit-tag v="SN"/>
                                            <lit v="{^"/>
                                            <lit v="nous"/>
                                            <lit-tag v="prn.pro.p1.mf.pl"/>
                                            <lit v="$}"/>
                                                 </chunk>
                                            <b/>
                                    </out>
                                    </when>
                                    <otherwise>

                                    <out>
                                    
                                    <!-- mayúsculas: ejemplo a seguir-->
                                        <chunk>
                                        <get-case-from pos="1">
                                            <lit v="prnperssubj"/>
                                        </get-case-from>    
                                            <lit-tag v="SN"/>
                                            <lit v="{^"/>    
                                            <lit v="nous"/>
                                            <lit-tag v="prn.tn.p1.mf.pl"/>
                                            <lit v="$}"/>
                                        </chunk>
                                        <b/>
                                    </out>
                                    </otherwise>
                                     </choose>
                                </otherwise>
                            </choose>
                        </when>
                    </choose>
                </when>
                <otherwise>
                    <choose>
                        <when><!-- si el verb estÃ  en p2 -->
                            <test>
                                <equal>
                                    <clip pos="1" part="pers"/>
                                    <lit-tag v="p2"/>
                                </equal>
                            </test>
                            <choose>
                                <when>
                                    <test><!--mirem si concorda amb el possible subj-->
                                        <or>
                                            <not>
                                                <equal>
                                                    <var n="pers_subj"/>
                                                    <lit-tag v="p2"/>
                                                </equal>
                                            </not>
                                            <not>
                                                <equal>
                                                    <clip pos="1" part="nbr"/>
                                                    <var n="nombre_subj"/>
                                                </equal>
                                            </not>
                                        </or>
                                    </test>
                                    <choose><!--si no, n'hi posem un-->
                                        <when>
                                            <test>
                                                <equal>
                                                    <clip pos="1" part="nbr"/>
                                                    <lit-tag v="sg"/>
                                                </equal>
                                            </test>

                                            <choose>
                                              <when>
                                                <test>
                                                  <or>
                                                    <equal caseless="yes">
                                                      <clip pos="1" part="lem"/>
                                                      <lit v="verbcj_ref"/>
                                                    </equal>
                                                    <equal caseless="yes">
                                                      <clip pos="1" part="lem"/>
                                                      <lit v="pronaux_pp"/>
                                                    </equal>
                                                  </or>
                                                </test>
                                                <out>
                                        
                                                  <chunk>
                                                    <get-case-from pos="1">
                                                      <lit v="prnperssubj"/>
                                                    </get-case-from>
                                                    <lit-tag v="SN"/>
                                                    <lit v="{^"/>
                                                    <lit v="tu"/>
                                                    <lit-tag v="prn.tn.p2.mf.sg"/>
                                                    <lit v="$}"/>
                                                  </chunk>
                                                  <b/>
                                                  <chunk>
                                                    <lit v="prnpro"/>
                                                    <lit-tag v="SN"/>
                                                    <lit v="{^"/>
                                                    <lit v="te"/>
                                                    <lit-tag v="prn.pro.p2.mf.sg"/>
                                                    <lit v="$}"/>
                                                  </chunk>
                                                  <b/>
                                                </out>
                                              </when>
                                              <otherwise>

                                            <out>
                                                <chunk>
                                                    <get-case-from pos="1">
                                                    <lit v="prnperssubj"/>
                                                    </get-case-from>
                                                    <lit-tag v="SN"/>
                                                    <lit v="{^"/>
                                                    <lit v="tu"/>
                                                    <lit-tag v="prn.tn.p2.mf.sg"/>
                                                    <lit v="$}"/>
                                                </chunk>
                                                <b/>
                                            </out>
                                        </otherwise>
                                        </choose>
                                        </when>
                                        <otherwise>

                                    <choose>
                                    <when>
                                    <test>
                                    <or>
                                    <equal caseless="yes">
                                      <clip pos="1" part="lem"/>
                                      <lit v="verbcj_ref"/>
                                    </equal>
                                    <equal caseless="yes">
                                      <clip pos="1" part="lem"/>
                                      <lit v="pronaux_pp"/>
                                    </equal>
                                    </or>
                                    </test>
                                    <out>
                                        
                                        <chunk>
                                        <get-case-from pos="1">
                                            <lit v="prnperssubj"/>
                                        </get-case-from>
                                            <lit-tag v="SN"/>
                                            <lit v="{^"/>
                                            <lit v="vous"/>
                                            <lit-tag v="prn.tn.p2.mf.pl"/>
                                            <lit v="$}"/>
                                        </chunk>
                                        <b/>
                                        <chunk>
                                            <lit v="prnpro"/>
                                            <lit-tag v="SN"/>
                                            <lit v="{^"/>
                                            <lit v="vous"/>
                                            <lit-tag v="prn.pro.p2.mf.pl"/>
                                            <lit v="$}"/>
                                                 </chunk>
                                            <b/>
                                    </out>
                                    </when>
                                    <otherwise>

                                            <out>
                                                <chunk>
                                                <get-case-from pos="1">
                                                    <lit v="prnperssubj"/>
                                                </get-case-from>
                                                    <lit-tag v="SN"/>
                                                    <lit v="{^"/>
                                                    <lit v="vous"/>
                                                    <lit-tag v="prn.tn.p2.mf.pl"/>
                                                    <lit v="$}"/>
                                                </chunk>
                                                <b/>
                                            </out>
                                    </otherwise>
                                    </choose>    
                                        </otherwise>
                                    </choose>
                                </when>
                            </choose>    
        
                        </when>
                        <otherwise> <!--el verb no és ni p1 ni p2 => és p3 ;-) -->
                            <choose>
                                <when>
                                    <test><!--mirem si concorda amb el possible subj-->
                                        <or>
                                            <not>
                                                <equal>
                                                    <var n="pers_subj"/>
                                                    <lit-tag v="p3"/>
                                                </equal>
                                            </not>
                                            <not>
                                                <equal>
                                                    <clip pos="1" part="nbr"/>
                                                    <var n="nombre_subj"/>
                                                </equal>
                                            </not>
                                        </or>
                                    </test>

                                    <choose>
                                    <when>
                                    <test>
                                    <or>
                                    <equal caseless="yes">
                                      <clip pos="1" part="lem"/>
                                      <lit v="verbcj_ref"/>
                                    </equal>
                                    <equal caseless="yes">
                                      <clip pos="1" part="lem"/>
                                      <lit v="pronaux_pp"/>
                                    </equal>
                                    </or>
                                    </test>
                                    <out>
                                        
                                        <chunk>
                                        <get-case-from pos="1">
                                            <lit v="prnperssubj"/>
                                        </get-case-from>
                                            <lit-tag v="SN"/>
                                            <lit v="{^"/>
                                            <lit v="il"/>
                                            <lit-tag v="prn.tn.p3"/>
                                                    <var n="genere"/>
                                            <clip pos="1" part="nbr"/>
                                            <lit v="$}"/>
                                        </chunk>
                                        <b/>
                                        <chunk>
                                            <lit v="prnpro"/>
                                            <lit-tag v="SN"/>
                                            <lit v="{^"/>
                                            <lit v="se"/>
                                            <lit-tag v="prn.pro.ref.p3.mf.sp"/>
                                            <lit v="$}"/>
                                                 </chunk>
                                            <b/>
                                    </out>
                                    </when>
                                    <otherwise>
                                    <out>
                                        <chunk>
                                           <get-case-from pos="1">
                                            <lit v="prnperssubj"/>
                                           </get-case-from>
                                            <lit-tag v="SN"/>
                                            <lit v="{^"/>
                                            <lit v="il"/>
                                            <lit-tag v="prn.tn.p3"/>
                                            <var n="genere"/>
                                            <clip pos="1" part="nbr"/>
                                            <lit v="$}"/>
                                        </chunk>
                                        <b/>
                                    </out>
                                    </otherwise>
                                  </choose>
                                </when>
                            </choose>
                        </otherwise>
                    </choose>
                </otherwise>
            </choose>
            <choose>
                <when>
                    <test>
                        <equal>
                            <case-of pos="1" part="lem"/>
                            <lit v="Aa"/>
                        </equal>
                    </test>
                    <modify-case>
                        <clip pos="1" part="lem"/>
                        <lit v="aa"/>
                    </modify-case>
                </when>
            </choose>
        </when>
    </choose>
    <let>
        <var n="nombre_subj"/>
        <lit v="no_assignat"/>
    </let>
    <let>
        <var n="pers_subj"/>
        <lit-tag v="p3"/>
    </let>
    <let>
        <var n="subj_vist"/>
                <lit v="no"/>
    </let>
    <let>
        <var n="genere"/>
                <lit v=""/>
    </let>
</def-macro>


  <def-macro n="f_bcond" npar="1"><!--Per mirar si el blanc contï¿½o no format. Cal posar aquesta funciï¿½en les regles en quï¿½desaparegui alguna paraula, per tal de decidir si el blanc de la paraula eliminada s'ha d'eliminar o conservar. Si contï¿½format cal conservar-la, si no en contï¿½cal eliminar-la perquï¿½no apareguin dos espais seguits. -->
         <choose>
           <when>
             <test>
               <not>
                 <equal>
                   <b pos="1"/>
                   <lit v=" "/>
                 </equal>
              </not>
             </test>
            <out>
              <b pos="1"/>
            </out>
          </when>             
         </choose>
     </def-macro>

     <def-macro n="concord_prnsubj_verb2" npar="2">
       <choose>
         <when>
           <test>
             <equal>
               <clip pos="2" part="pers"/>
               <lit-tag v="impers"/>
             </equal>
           </test>
           <let>
             <clip pos="2" part="pers"/>
             <lit-tag v="p3"/>
           </let>
           <let>
             <clip pos="2" part="nbr"/>
             <lit-tag v="sg"/>
           </let>
         </when>
         <otherwise>
           <choose>
             <when>
               <test>
                 <not>
                   <equal>
                     <clip pos="2" part="pers"/>
                     <lit v=""/>
                   </equal>
                 </not>
               </test>
               <let>
                 <clip pos="2" part="pers"/>
                 <lit-tag v="p3"/>
               </let>
             </when>
             <otherwise>
               <let>
                 <clip pos="2" part="pers"/>
                 <clip pos="1" part="pers"/>
               </let>
             </otherwise>
           </choose>
           <let>
             <clip pos="2" part="nbr"/>
             <clip pos="1" part="nbr"/>
           </let>
         </otherwise>
       </choose>
     </def-macro> 
     <def-macro n="set_partitiu2" npar="2">
        <let>
          <var n="partitiu"/>
          <lit v=""/>
        </let>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="partadj_nom"/>
                            </equal>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="partnom_adj"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="1" part="nbr"/>
                            <lit-tag v="sg"/>
                        </equal>
                    </and>
                </test>
                <let>
                  <var n="partitiu"/>
                  <concat>
                      <lit v=" ^"/>
                      <get-case-from pos="2">
                        <lit v="partitiu"/>
                      </get-case-from>
                      <lit-tag v="part"/>      
                                            
                      <lit v="{^de"/>
                      <lit-tag v="pr"/>
                      <lit v="$"/>
                      <b/>
                      <lit v="^le"/>    
                          <lit-tag v="det.def"/>
                      <clip pos="1" part="gen"/>
                      <lit-tag v="sg"/>
                      <lit v="$}$"/>
                  </concat>
                </let>
            </when>
        </choose>
     </def-macro> 

</section-def-macros>

  <section-rules>
 
<rule comment="REGLA: punt SN 'zo' SN de SN punt"> 
    <pattern>
        <pattern-item n="punt"/>
        <pattern-item n="SN"/>
        <pattern-item n="V_être_sg3"/>
        <pattern-item n="SN"/>
        <pattern-item n="pr"/>
        <pattern-item n="SN"/>
        <pattern-item n="punt"/>
    </pattern>
    <action>
        <out>
          <chunk>
            <clip pos="1" part="whole"/>
          </chunk>
          <b pos="1"/>
          <chunk>
            <clip pos="2" part="whole"/>
          </chunk>
          <b pos="2"/>
          <chunk>
            <clip pos="3" part="whole"/>
          </chunk>
          <b pos="3"/>
          <chunk>
            <clip pos="4" part="whole"/>
          </chunk>
          <b pos="4"/>
          <chunk>
            <clip pos="5" part="whole"/>
          </chunk>
          <b pos="5"/>
          <chunk>
            <clip pos="6" part="whole"/>
          </chunk>
          <b pos="6"/>
          <chunk>
            <clip pos="7" part="whole"/>
          </chunk>
        </out>
    </action>
</rule>
  
 
<rule comment="REGLA: punt SN 'zo' SN punt"> 
    <pattern>
        <pattern-item n="punt"/>
        <pattern-item n="SN"/>
        <pattern-item n="V_être_sg3"/>
        <pattern-item n="SN"/>
        <pattern-item n="punt"/>
    </pattern>
    <action>
        <out>
          <chunk>
            <clip pos="1" part="whole"/>
          </chunk>
          <b pos="1"/>
          <chunk>
            <clip pos="2" part="whole"/>
          </chunk>
          <b pos="2"/>
          <chunk>
            <clip pos="3" part="whole"/>
          </chunk>
          <b pos="3"/>
          <chunk>
            <clip pos="4" part="whole"/>
          </chunk>
          <b pos="4"/>
          <chunk>
            <clip pos="5" part="whole"/>
          </chunk>
        </out>
    </action>
</rule>
  
 
<rule comment="REGLA: punt SN 'zo' SA punt"> 
    <pattern>
        <pattern-item n="punt"/>
        <pattern-item n="SN"/>
        <pattern-item n="V_être_sg3"/>
        <pattern-item n="SA"/>
        <pattern-item n="punt"/>
    </pattern>
    <action>
        <out>
          <chunk>
            <clip pos="1" part="whole"/>
          </chunk>
          <b pos="1"/>
          <chunk>
            <clip pos="2" part="whole"/>
          </chunk>
          <b pos="2"/>
          <chunk>
            <clip pos="3" part="whole"/>
          </chunk>
          <b pos="3"/>
          <chunk>
            <clip pos="4" part="whole"/>
          </chunk>
          <b pos="4"/>
          <chunk>
            <clip pos="5" part="whole"/>
          </chunk>
        </out>
    </action>
</rule>
  
 
<rule comment="REGLA: punt SN 'zo' punt"> 
    <pattern>
        <pattern-item n="punt"/>
        <pattern-item n="SN"/>
        <pattern-item n="V_être_sg3"/>
        <pattern-item n="punt"/>
    </pattern>
    <action>
      <call-macro n="set_partitiu2">
        <with-param pos="2"/>
        <with-param pos="3"/>
      </call-macro>
        <out>
          <chunk>
            <clip pos="1" part="whole"/>
          </chunk>
          <b pos="1"/>
          <chunk>
            <lit v="il_y_a"/>
            <clip pos="3" part="tags"/>
            <lit v="{^"/>
            <get-case-from pos="2">
            <lit v="il"/>
            </get-case-from>
            <lit-tag v="prn.tn.p3.m.sg"/>
            <lit v="$ ^"/>
            <lit v="y avoir"/>
            <lit-tag v="vblex.pri.p3.sg"/>
            <lit v="$}"/>
          </chunk>
          <var n="partitiu"/>
          <b pos="2"/>
          <chunk>
            <get-case-from pos="3">
            <clip pos="2" part="lem"/>
            </get-case-from>
            <clip pos="2" part="tags"/>
            <clip pos="2" part="chcontent"/>
          </chunk>
          <b pos="3"/>
          <chunk>
            <clip pos="4" part="whole"/>
          </chunk>
        </out>
    </action>
</rule>
  
<rule comment="REGLA: punt SN 'zo'"> 
    <pattern>
        <pattern-item n="punt"/>
        <pattern-item n="SN"/>
        <pattern-item n="V_être_sg3"/>
    </pattern>
    <action>
      <call-macro n="set_partitiu2">
        <with-param pos="1"/>
        <with-param pos="3"/>
      </call-macro>
        <out>
          <chunk>
            <clip pos="1" part="whole"/>
          </chunk>
          <b pos="1"/>
          <chunk>
            <lit v="il_y_a"/>
            <clip pos="3" part="tags"/>
            <lit v="{^"/>
            <get-case-from pos="2">
            <lit v="il"/>
            </get-case-from>
            <lit-tag v="prn.tn.p3.m.sg"/>
            <lit v="$ ^"/>
            <lit v="y avoir"/>
            <lit-tag v="vblex.pri.p3.sg"/>
            <lit v="$}"/>
          </chunk>
          <var n="partitiu"/>
          <b pos="2"/>
          <chunk>
            <get-case-from pos="3">
            <clip pos="2" part="lem"/>
            </get-case-from>
            <clip pos="2" part="tags"/>
            <clip pos="2" part="chcontent"/>
          </chunk>
        </out>
    </action>
</rule>
 
<rule comment="REGLA: punt SN VPART_a 'zo' adv"> 
    <pattern>
        <pattern-item n="punt"/>
        <pattern-item n="SN"/>
        <pattern-item n="VPART_a"/>
        <pattern-item n="V_être_sg3"/>
        <pattern-item n="adv"/>
    </pattern>
    <action>
        <call-macro n="set_partitiu2">
          <with-param pos="2"/>
          <with-param pos="4"/>
        </call-macro>
        <out>
          <chunk>
            <clip pos="1" part="whole"/>
          </chunk>
          <b pos="1"/>
          <chunk>
            <lit v="il_y_a"/>
            <clip pos="3" part="tags"/>
            <lit v="{^"/>
            <get-case-from pos="2">
            <lit v="il"/>
            </get-case-from>
            <lit-tag v="prn.tn.p3.m.sg"/>
            <lit v="$ ^"/>
            <lit v="y avoir"/>
            <lit-tag v="vblex.pri.p3.sg"/>
            <lit v="$}"/>
          </chunk>
          <var n="partitiu"/>
          <b pos="2"/>
          <chunk>
            <get-case-from pos="4">
            <clip pos="2" part="lem"/>
            </get-case-from>
            <clip pos="2" part="tags"/>
            <clip pos="2" part="chcontent"/>
          </chunk>
          <b pos="3"/>
          <chunk>
            <clip pos="5" part="lem"/>
            <clip pos="5" part="tags"/>
            <clip pos="5" part="chcontent"/>
          </chunk>
        </out>
        <let>
          <var n="partitiu"/>
          <lit v=""/>
        </let>
    </action>
</rule>

  
<rule comment="REGLA: punt SN VPART_a 'zo'"> 
    <pattern>
        <pattern-item n="punt"/>
        <pattern-item n="SN"/>
        <pattern-item n="VPART_a"/>
        <pattern-item n="V_être_sg3"/>
    </pattern>
    <action>
        <call-macro n="set_partitiu2">
          <with-param pos="2"/>
          <with-param pos="4"/>
        </call-macro>
        <out>
          <chunk>
            <clip pos="1" part="whole"/>
          </chunk>
          <b pos="1"/>
          <chunk>
            <lit v="il_y_a"/>
            <clip pos="3" part="tags"/>
            <lit v="{^"/>
            <get-case-from pos="2">
            <lit v="il"/>
            </get-case-from>
            <lit-tag v="prn.tn.p3.m.sg"/>
            <lit v="$ ^"/>
            <lit v="y avoir"/>
            <lit-tag v="vblex.pri.p3.sg"/>
            <lit v="$}"/>
          </chunk>
          <var n="partitiu"/>
          <b pos="2"/>
          <chunk>
            <get-case-from pos="4">
            <clip pos="2" part="lem"/>
            </get-case-from>
            <clip pos="2" part="tags"/>
            <clip pos="2" part="chcontent"/>
          </chunk>
        </out>
    </action>
</rule>
 
<rule comment="REGLA: SN VPART_a 'zo' adv punt"> 
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="VPART_a"/>
        <pattern-item n="V_être_sg3"/>
        <pattern-item n="adv"/>
        <pattern-item n="punt"/>
    </pattern>
    <action>
      <call-macro n="set_partitiu2">
        <with-param pos="1"/>
        <with-param pos="4"/>
      </call-macro>
                        <out>
          <chunk>
            <lit v="il_y_a"/>
            <clip pos="3" part="tags"/>
            <lit v="{^"/>
            <get-case-from pos="1">
            <lit v="il"/>
            </get-case-from>
            <lit-tag v="prn.tn.p3.m.sg"/>
            <lit v="$ ^"/>
            <lit v="y avoir"/>
            <lit-tag v="vblex.pri.p3.sg"/>
            <lit v="$}"/>
          </chunk>
          <var n="partitiu"/>
          <b pos="1"/>
          <chunk>
            <get-case-from pos="3">
            <clip pos="1" part="lem"/>
            </get-case-from>
            <clip pos="1" part="tags"/>
            <clip pos="1" part="chcontent"/>
          </chunk>
          <b pos="2"/>
          <chunk>
            <clip pos="4" part="lem"/>
            <clip pos="4" part="tags"/>
            <clip pos="4" part="chcontent"/>
          </chunk>

          <chunk>
            <clip pos="5" part="whole"/>
          </chunk>
        </out>
    </action>
</rule>

 
<rule comment="REGLA: SN VPART_a 'zo' punt"> 
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="VPART_a"/>
        <pattern-item n="V_être_sg3"/>
        <pattern-item n="punt"/>
    </pattern>
    <action>
      <call-macro n="set_partitiu2">
        <with-param pos="1"/>
        <with-param pos="3"/>
      </call-macro>
                        <out>
          <chunk>
            <lit v="il_y_a"/>
            <clip pos="3" part="tags"/>
            <lit v="{^"/>
            <get-case-from pos="1">
            <lit v="il"/>
            </get-case-from>
            <lit-tag v="prn.tn.p3.m.sg"/>
            <lit v="$ ^"/>
            <lit v="y avoir"/>
            <lit-tag v="vblex.pri.p3.sg"/>
            <lit v="$}"/>
          </chunk>
          <var n="partitiu"/>
          <b pos="1"/>
          <chunk>
            <get-case-from pos="3">
            <clip pos="1" part="lem"/>
            </get-case-from>
            <clip pos="1" part="tags"/>
            <clip pos="1" part="chcontent"/>
          </chunk>
          <chunk>
            <clip pos="4" part="whole"/>
          </chunk>
        </out>
    </action>
</rule>

 
<!--REGLES GENERALS -->

<rule comment="REGLA: unknown">
    <pattern>
        <pattern-item n="UNK"/>
    </pattern>
    <action>
    <let>
        <var n="subj_vist"/>
        <lit v="yes"/>
    </let>

    <out>
            <chunk>
                <clip pos="1" part="whole"/>
            </chunk>
    </out>
    </action>
</rule>

<rule comment="regla: PRNS SV SN">
      <pattern>
    <pattern-item n="PRNS"/>
    <pattern-item n="SV"/>
    <pattern-item n="SN"/>
      </pattern>
      <action>
        <call-macro n="concord_prnsubj_verb2">
          <with-param pos="1"/>
          <with-param pos="2"/>
        </call-macro>
    <out>
      <chunk>
        <clip pos="1" part="whole"/>
      </chunk>
      <b pos="1"/>
      <chunk>
        <clip pos="2" part="whole"/>
      </chunk>
      <b pos="2"/>
      <chunk>
        <clip pos="3" part="whole"/>
      </chunk>
    </out>
        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>
      </action>
</rule>



<rule comment="regla: PRNS SV">
      <pattern>
    <pattern-item n="PRNS"/>
    <pattern-item n="SV"/>
      </pattern>
      <action>
        <call-macro n="concord_prnsubj_verb2">
          <with-param pos="1"/>
          <with-param pos="2"/>
        </call-macro>
    <out>
      <chunk>
        <clip pos="1" part="whole"/>
      </chunk>
      <b pos="1"/>
      <chunk>
        <clip pos="2" part="whole"/>
      </chunk>
    </out>
        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>
      </action>
</rule>




<rule comment="REGLA: SPRN"> <!-- after pronouns that can be subject we mark the subject as seen -->
    <pattern>
        <pattern-item n="SPRN"/>
    </pattern>
    <action>
        <let>
          <var n="subj_vist"/>
          <lit v="yes"/>
        </let>
        <call-macro n="check_subject_number1">
          <with-param pos="1"/>
        </call-macro>
    <out>
        <chunk>
                <clip pos="1" part="lem"/>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
        </chunk>
    </out>
    </action>
</rule>

<rule comment="REGLA: SN">
    <pattern>
        <pattern-item n="SN"/>
    </pattern>
    <action>
<!--     <out> <chunk><var n="pers_subj"/></chunk>     </out> -->
    <call-macro n="assigna_nombre_subj">
        <with-param pos="1"/>
    </call-macro>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
        <out>
        <chunk>
                <clip pos="1" part="lem"/>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
<!-- <var n="pers_subj"/> 
<var n="nombre_subj"/>-->
            </chunk>
        </out>
    </action>
</rule>



<!--
<rule comment="REGLA: prep SN">
    <pattern>
        <pattern-item n="pr"/>
        <pattern-item n="SN"/>
    </pattern>
    <action>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="2"/>
    </call-macro>
    <call-macro n="assigna_nombre_subj">
        <with-param pos="2"/>
    </call-macro>
           <choose>
             <when>
           <test>
             <and>
              <equal caseless="yes">
                 <clip pos="1" part="lem"/>
                 <lit v="en"/>
              </equal>
              <equal caseless="yes">
                 <clip pos="2" part="lem"/>
                 <lit v="det_nom"/>
              </equal>
            </and>  
               </test>
            <out>
            <chunk>
                    <get-case-from pos="1">
                  <lit v="à"/>
                </get-case-from>
                <clip pos="1" part="tags"/>
                <lit v="{^à"/>
                <lit-tag v="pr"/>
                <lit v="$}"/>
            </chunk>
            <b pos="1"/>
            </out>
         </when>  
         <otherwise>
        <out>
            <chunk>
                <clip pos="1" part="lem"/>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
            </chunk>
            <b pos="1"/>
        </out>
        </otherwise>
        </choose>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="nom"/>
                            </equal>

                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>


                        </or>
                        <equal>
                            <clip pos="2" part="nbr"/>
                            <lit-tag v="pl"/>
                        </equal>
                        <not>
                           <in caseless="yes">
                            <clip pos="1" part="lem"/>
                            <list n="prde"/>
                           </in>
                        </not>
                        <not>
                        <equal caseless="yes">
                            <clip pos="1" part="lem"/>
                                                        <lit-tag v="à"/>
                        </equal>
                        </not>
                    </and>
                </test>
                <out>
                    <chunk>
                      <get-case-from pos="2">
                        <lit v="partitiu"/>
                      </get-case-from>
                      <lit-tag v="part"/>      
                                            
                      <lit v="{^de"/>
                      <lit-tag v="pr"/>
                      <lit v="$"/>
                      <b/>
                      <lit v="^le"/>
                      <lit-tag v="det.def.mf.pl"/>
                      <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="partadj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="partnom_adj"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="2" part="nbr"/>
                            <lit-tag v="sg"/>
                        </equal>
                        <not>
                           <in caseless="yes">
                            <clip pos="1" part="lem"/>
                            <list n="prde"/>
                           </in>
                        </not>
                        <not>
                        <equal caseless="yes">
                            <clip pos="1" part="lem"/>
                                                        <lit-tag v="à"/>
                        </equal>
                        </not>
                    </and>
                </test>
                <out>
                    <chunk>
                      <get-case-from pos="2">
                        <lit v="partitiu"/>
                      </get-case-from>
                      <lit-tag v="part"/>      
                                            
                      <lit v="{^de"/>
                      <lit-tag v="pr"/>
                      <lit v="$"/>
                      <b/>
                      <lit v="^le"/>    
                          <lit-tag v="det.def"/>
                      <clip pos="2" part="gen"/>
                      <lit-tag v="sg"/>
                      <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>

        <out>
            <chunk>
                <clip pos="2" part="lem"/>
                <clip pos="2" part="tags"/>
                <clip pos="2" part="chcontent"/>
            </chunk>
        </out>
    </action>
</rule>

-->

<rule comment="REGLA: prep adv SN">
    <pattern>
        <pattern-item n="pr"/>
        <pattern-item n="adv"/>
        <pattern-item n="SN"/>
    </pattern>
    <action>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="3"/>
    </call-macro>
    <call-macro n="assigna_nombre_subj">
        <with-param pos="3"/>
    </call-macro>
           <choose>
             <when>
           <test>
             <and>
              <equal caseless="yes">
                 <clip pos="1" part="lem"/>
                 <lit v="en"/>
              </equal>
              <equal caseless="yes">
                 <clip pos="3" part="lem"/>
                 <lit v="det_nom"/>
              </equal>
            </and>  
               </test>
            <out>
            <chunk>
                    <get-case-from pos="1">
                  <lit v="à"/>
                </get-case-from>
                <clip pos="1" part="tags"/>
                <lit v="{^à"/>
                <lit-tag v="pr"/>
                <lit v="$}"/>
            </chunk>
            <b pos="1"/>
            <chunk>
             <clip pos="2" part="lem"/> 
                         <clip pos="2" part="tags"/>
                         <clip pos="2" part="chcontent"/>
                        </chunk>
            <b pos="2"/>
            </out>
         </when>  
         <otherwise>
        <out>
            <chunk>
                <clip pos="1" part="lem"/>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
            </chunk>
            <b pos="1"/>
            <chunk>
             <clip pos="2" part="lem"/> 
                         <clip pos="2" part="tags"/>
                         <clip pos="2" part="chcontent"/>
                        </chunk>
            <b pos="2"/>
        </out>
        </otherwise>
        </choose>
        <choose>
            <when>
                <test>
                        <or>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="nom"/>
                            </equal>

                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>


                        </or>
                </test>
                <out>
                    <chunk>
                      <get-case-from pos="2">
                        <lit v="partitiu"/>
                      </get-case-from>
                      <lit-tag v="part"/>      
                                            
                      <lit v="{^de"/>
                      <lit-tag v="pr"/>
                      <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <out>
            <chunk>
                <clip pos="3" part="lem"/>
                <clip pos="3" part="tags"/>
                <clip pos="3" part="chcontent"/>
            </chunk>
        </out>
    </action>
</rule>



<rule comment="REGLA: prep adv SN cnjcoo SN">
    <pattern>
        <pattern-item n="pr"/>
        <pattern-item n="adv"/>
        <pattern-item n="SN"/>
        <pattern-item n="cnjcoo"/>
        <pattern-item n="SN"/>
    </pattern>
    <action>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="3"/>
    </call-macro>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="4"/>
    </call-macro>
    <call-macro n="assigna_nombre_subj">
        <with-param pos="3"/>
    </call-macro>
           <choose>
             <when>
           <test>
             <and>
              <equal caseless="yes">
                 <clip pos="1" part="lem"/>
                 <lit v="en"/>
              </equal>
              <equal caseless="yes">
                 <clip pos="3" part="lem"/>
                 <lit v="det_nom"/>
              </equal>
            </and>  
               </test>
            <out>
            <chunk>
                    <get-case-from pos="1">
                  <lit v="à"/>
                </get-case-from>
                <clip pos="1" part="tags"/>
                <lit v="{^à"/>
                <lit-tag v="pr"/>
                <lit v="$}"/>
            </chunk>
            <b pos="1"/>
            <chunk>
             <clip pos="2" part="lem"/> 
                         <clip pos="2" part="tags"/>
                         <clip pos="2" part="chcontent"/>
                        </chunk>
            <b pos="2"/>
            </out>
         </when>  
         <otherwise>
        <out>
            <chunk>
                <clip pos="1" part="lem"/>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
            </chunk>
            <b pos="1"/>
            <chunk>
             <clip pos="2" part="lem"/> 
                         <clip pos="2" part="tags"/>
                         <clip pos="2" part="chcontent"/>
                        </chunk>
            <b pos="2"/>
        </out>
        </otherwise>
        </choose>
        <choose>
            <when>
                <test>
                        <or>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="nom"/>
                            </equal>

                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>


                        </or>
                </test>
                <out>
                    <chunk>
                      <get-case-from pos="2">
                        <lit v="partitiu"/>
                      </get-case-from>
                      <lit-tag v="part"/>      
                                            
                      <lit v="{^de"/>
                      <lit-tag v="pr"/>
                      <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <out>
            <chunk>
                <clip pos="3" part="lem"/>
                <clip pos="3" part="tags"/>
                <clip pos="3" part="chcontent"/>
            </chunk>
            <b pos="3"/>
            <chunk>
                <clip pos="4" part="lem"/>
                <clip pos="4" part="tags"/>
                <clip pos="4" part="chcontent"/>
            </chunk>
            <b pos="3"/>
        </out>

    <choose>
            <when>
                <test>
                        <or>
                            <equal>
                                <clip pos="5" part="lem"/>
                                <lit v="nom"/>
                            </equal>

                            <equal>
                                <clip pos="5" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="5" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="5" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>


                        </or>
                </test>
                <out>
                    <chunk>
                      <get-case-from pos="4">
                        <lit v="partitiu"/>
                      </get-case-from>
                      <lit-tag v="part"/>      
                                            
                      <lit v="{^de"/>
                      <lit-tag v="pr"/>
                      <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>

        <out>
            <chunk>
                <clip pos="5" part="lem"/>
                <clip pos="5" part="tags"/>
                <clip pos="5" part="chcontent"/>
            </chunk>
        </out>
    </action>
</rule>


<rule comment="REGLA: prep SN cnjcoo SN">
    <pattern>
        <pattern-item n="pr"/>
        <pattern-item n="SN"/>
        <pattern-item n="cnjcoo"/>
        <pattern-item n="SN"/>
    </pattern>
    <action>
        <call-macro n="assigna_gen_nbr">
            <with-param pos="2"/>
        </call-macro>
        <call-macro n="assigna_gen_nbr">
            <with-param pos="4"/>
        </call-macro>
        <call-macro n="assigna_nombre_subj">
        <with-param pos="4"/>
    </call-macro>
        <out>
            <chunk>
                <clip pos="1" part="lem"/>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
            </chunk>
            <b pos="1"/>
        </out>

        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="nom"/>
                            </equal>

                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>


                        </or>
                        <equal>
                            <clip pos="2" part="nbr"/>
                            <lit-tag v="pl"/>
                        </equal>
                        
                        <not>
                           <in caseless="yes">
                            <clip pos="1" part="lem"/>
                            <list n="prde"/>
                           </in>
                        </not>
                    </and>
                </test>
                <out>
                    <chunk>
                    
                      <get-case-from pos="2">
                        <lit v="partitiu"/>
                      </get-case-from>
                      <lit-tag v="part"/>      
                                            
                      <lit v="{^de"/>
                      <lit-tag v="pr"/>
                      <lit v="$"/>
                      <b/>
                      <lit v="^le"/>    
                          <lit-tag v="det.def.mf.pl"/>
                      <lit v="$}"/>
                        
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="partadj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="partnom_adj"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="2" part="nbr"/>
                            <lit-tag v="sg"/>
                        </equal>
                        
                        <not>
                           <in caseless="yes">
                            <clip pos="1" part="lem"/>
                            <list n="prde"/>
                           </in>
                        </not>
                    </and>
                </test>
                <out>
                    <chunk>
                      <get-case-from pos="2">
                        <lit v="partitiu"/>
                      </get-case-from>
                      <lit-tag v="part"/>      
                                            
                      <lit v="{^de"/>
                      <lit-tag v="pr"/>
                      <lit v="$"/>
                      <b/>
                      <lit v="^le"/>    
                          <lit-tag v="det.def"/>
                      <clip pos="2" part="gen"/>
                      <lit-tag v="sg"/>
                      <lit v="$}"/>
                            
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>

        <out>
            <chunk>
                <clip pos="2" part="lem"/>
                <clip pos="2" part="tags"/>
                <clip pos="2" part="chcontent"/>
            </chunk>
            <b pos="2"/>
            <chunk>
                <clip pos="3" part="lem"/>
                <clip pos="3" part="tags"/>
                <clip pos="3" part="chcontent"/>
            </chunk>
            <b pos="3"/>
        </out>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="nom"/>
                            </equal>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>

                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="part"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="4" part="nbr"/>
                            <lit-tag v="pl"/>
                        </equal>
                        
                        <not>
                           <in caseless="yes">
                            <clip pos="1" part="lem"/>
                            <list n="prde"/>
                           </in>
                        </not>
                    </and>
                </test>
                <out>
                    <chunk>
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="4">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>                        
                            <get-case-from pos="4">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def.mf.pl"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="partadj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="partnom_adj"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="4" part="nbr"/>
                            <lit-tag v="sg"/>
                        </equal>
                        
                        <not>
                           <in caseless="yes">
                            <clip pos="1" part="lem"/>
                            <list n="prde"/>
                           </in>
                        </not>
                    </and>
                </test>
                <out>
                    <chunk>
                    
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="4">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>                        
                            <get-case-from pos="4">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def"/>
                            <clip pos="4" part="gen"/>
                            <lit-tag v="sg"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <out>
            <chunk>
                <clip pos="4" part="lem"/>
                <clip pos="4" part="tags"/>
                <clip pos="4" part="chcontent"/>
            </chunk>
        </out>
    </action>
</rule>

<rule comment="REGLA: CNJADV">
    <pattern>
        <pattern-item n="CNJADV"/>
    </pattern>
    <action>
    <let>
      <var n="last_cnj"/>
      <clip pos="1" part="lem"/>
    </let>
        <out>
            <chunk>
                <clip pos="1" part="lem"/>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
            </chunk>
        </out>
    </action>
</rule>


<rule comment="REGLA: CS">
    <pattern>
        <pattern-item n="CS"/>
    </pattern>
    <action>
        <let>
          <var n="last_cnj"/>
          <clip pos="1" part="lem"/>
        </let>
        <choose>
            <when>
                <test>
                    <not>
                        <equal>
                            <var n="nombre_subj"/>
                            <lit v="no_assignat"/>
                        </equal>
                    </not>
                </test>

                <choose>
                    <when>
                        <test>
                            <equal>
                                <var n="nombre_subj"/>
                                <lit-tag v="sg"/>
                            </equal>
                        </test>
                        <let><var n="nombre_subj"/><lit-tag v="vist_sg"/></let>
                    </when>
                </choose>
            </when>
        </choose>
        <out>
            <chunk>
                <clip pos="1" part="lem"/>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
            </chunk>
        </out>
        <let>
          <var n="subj_vist"/>
          <lit v="no"/>
        </let>


    </action>
</rule>



<rule comment="REGLA: cnjcoo">
    <pattern>
        <pattern-item n="cnjcoo"/>
    </pattern>
    <action>
        <choose>
            <when>
                <test>
                    <not>
                        <equal>
                            <var n="nombre_subj"/>
                            <lit v="no_assignat"/>
                        </equal>
                    </not>
                </test>

                <choose>
                    <when>
                        <test>
                            <equal>
                                <var n="nombre_subj"/>
                                <lit-tag v="sg"/>
                            </equal>
                        </test>
                        <let><var n="nombre_subj"/><lit-tag v="vist_sg"/></let>
                    </when>
                </choose>
            </when>
        </choose>
        <out>
            <chunk>
                <clip pos="1" part="lem"/>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
            </chunk>
        </out>
        <let>
          <var n="subj_vist"/>
          <lit v="no"/>
        </let>


    </action>
</rule>


<rule comment="REGLA: SA">
    <pattern>
        <pattern-item n="SA"/>
    </pattern>
    <action>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <call-macro n="assigna_nombre_subj">
        <with-param pos="1"/>
    </call-macro>
            <out>
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
            </out>
</action>
</rule>

<rule comment="REGLA: det">
    <pattern>
        <pattern-item n="DET"/>
    </pattern>
    <action>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
        <out>
            <chunk>
                <clip pos="1" part="lem"/>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
            </chunk>
        </out>
    </action>
</rule>

<rule comment="REGLA: SN QUE SV SV">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="QUEREL"/>
        <pattern-item n="SV"/>
        <pattern-item n="SV"/>
    </pattern>
    <action>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <choose> <!--mirem si el SN és el subj de la subordinada-->
        <when>
          <test>
            <or>
              <and>
                <equal caseless="yes">
                    <clip pos="1" part="lem"/>
                    <lit v="prnperssubj"/>
                </equal>
                <equal>
                    <clip pos="3" part="pers"/>
                    <clip pos="1" part="pers"/>
                </equal>
                <equal>
                    <clip pos="3" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
              </and>
              <and>
                <not>
                    <equal caseless="yes">
                        <clip pos="1" part="lem"/>
                        <lit v="prnperssubj"/>
                    </equal>
                </not>
                <equal>
                    <clip pos="3" part="pers"/>
                    <lit-tag v="p3"/>
                </equal>
                <equal>
                    <clip pos="3" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
              </and>
            </or>
          </test>
            <out> <!--si és que sí, el rel será  "qui" i no "que"-->
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <lit v="qui"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
            </out>
        </when>
        <otherwise><!--si és que no, el rel será  "que" i caldrá  posar subjecte al verb-->
            <out>
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
            </out>
            <call-macro n="posa_subj2">
                <with-param pos="3"/>
            </call-macro>
            <out>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
            </out>
        </otherwise>
    </choose>
    <choose> <!--després mirem si el SN és el subj de la principal-->
        <when>
            <test>
                <not>
                    <or>
                        <and>
                            <equal caseless="yes">
                            <clip pos="1" part="lem"/>
                            <lit v="prnperssubj"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="pers"/>
                            <clip pos="1" part="pers"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="nbr"/>
                            <clip pos="1" part="nbr"/>
                        </equal>
                    </and>
                    <and>
                        <equal>
                            <clip pos="4" part="pers"/>
                            <lit-tag v="p3"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="nbr"/>
                            <clip pos="1" part="nbr"/>
                        </equal>
                    </and>
                </or>
            </not>
        </test> <!--si no ho és, li posem un subj-->
        <call-macro n="posa_subj2">
            <with-param pos="4"/>
        </call-macro>
    </when>
</choose>
    <out><!--finalment, enviem el SV de la pral-->
        <chunk>
            <clip pos="4" part="lem"/>
            <clip pos="4" part="tags"/>
            <clip pos="4" part="chcontent"/>
        </chunk>
    </out>
</action>
</rule>



<rule comment="REGLA: SN sprep QUE SV SV">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="pr"/>
        <pattern-item n="SN"/>
        <pattern-item n="QUEREL"/>
        <pattern-item n="SV"/>
        <pattern-item n="SV"/>
    </pattern>
    <action>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>    
    <call-macro n="assigna_gen_nbr">
        <with-param pos="3"/>
    </call-macro>
    <choose> <!--mirem si el SN Ã©s el subj de la subordinada-->
        <when>
            <test>
            <or>
            <and>
                <equal caseless="yes">
                    <clip pos="1" part="lem"/>
                    <lit v="prnperssubj"/>
                </equal>
                <equal>
                    <clip pos="5" part="pers"/>
                    <clip pos="1" part="pers"/>
                </equal>
                <equal>
                    <clip pos="5" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
            <and>
                <not>
                    <equal caseless="yes">
                        <clip pos="1" part="lem"/>
                        <lit v="prnperssubj"/>
                    </equal>
                </not>
                <equal>
                    <clip pos="5" part="pers"/>
                    <lit-tag v="p3"/>
                </equal>
                <equal>
                    <clip pos="5" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
        </or>
            </test>
            <out> <!--si Ã©s que sÃ­, el rel serÃ  "qui" i no "que"-->
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
                <chunk>
                    <lit v="qui"/>
                    <clip pos="4" part="tags"/>
                    <clip pos="4" part="chcontent"/>
                </chunk>
                <b pos="4"/>
                <chunk>
                    <clip pos="5" part="lem"/>
                    <clip pos="5" part="tags"/>
                    <clip pos="5" part="chcontent"/>
                </chunk>
    <b pos="5"/>
            </out>
        </when>
        <otherwise><!--si Ã©s que no, el rel serÃ  "que" i caldrÃ  posar subjecte al verb-->
            <out>
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
                <chunk>
                    <clip pos="4" part="lem"/>
                    <clip pos="4" part="tags"/>
                    <clip pos="4" part="chcontent"/>
                </chunk>
                <b pos="4"/>
            </out>
            <call-macro n="posa_subj2">
                <with-param pos="5"/>
            </call-macro>
            <out>
                <chunk>
                    <clip pos="5" part="lem"/>
                    <clip pos="5" part="tags"/>
                    <clip pos="5" part="chcontent"/>
                </chunk>
                <b pos="5"/>
            </out>
        </otherwise>
    </choose>
    <choose> <!--desprÃ©s mirem si el SN Ã©s el subj de la principal-->
        <when>
            <test>
                <not>
                    <or>
                        <and>
                            <equal caseless="yes">
                            <clip pos="1" part="lem"/>
                            <lit v="prnperssubj"/>
                        </equal>
                        <equal>
                            <clip pos="6" part="pers"/>
                            <clip pos="1" part="pers"/>
                        </equal>
                        <equal>
                            <clip pos="6" part="nbr"/>
                            <clip pos="1" part="nbr"/>
                        </equal>
                    </and>
                    <and>
                        <equal>
                            <clip pos="6" part="pers"/>
                            <lit-tag v="p3"/>
                        </equal>
                        <equal>
                            <clip pos="6" part="nbr"/>
                            <clip pos="1" part="nbr"/>
                        </equal>
                    </and>
                </or>
            </not>
        </test> <!--si no ho és, li posem un subj-->
        <call-macro n="posa_subj2">
            <with-param pos="6"/>
        </call-macro>
    </when>
</choose>
    <out><!--finalment, enviem el SV de la pral-->
        <chunk>
            <clip pos="6" part="lem"/>
            <clip pos="6" part="tags"/>
            <clip pos="6" part="chcontent"/>
        </chunk>
    </out>
</action>
</rule>

<rule comment="REGLA: SN QUE SV">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="QUEREL"/>
        <pattern-item n="SV"/>
    </pattern>
    <action>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <choose> <!--mirem si el SN Ã©s el subj de la subordinada-->
        <when>
            <test>
            <or>
            <and>
                <equal caseless="yes">
                    <clip pos="1" part="lem"/>
                    <lit v="prnperssubj"/>
                </equal>
                <equal>
                    <clip pos="3" part="pers"/>
                    <clip pos="1" part="pers"/>
                </equal>
                <equal>
                    <clip pos="3" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
            <and>
                <not>
                    <equal caseless="yes">
                        <clip pos="1" part="lem"/>
                        <lit v="prnperssubj"/>
                    </equal>
                </not>
                <equal>
                    <clip pos="3" part="pers"/>
                    <lit-tag v="p3"/>
                </equal>
                <equal>
                    <clip pos="3" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
        </or>
            </test>
            <out> <!--si Ã©s que sÃ­, el rel serÃ  "qui" i no "que"-->
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <lit v="qui"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
            </out>
        </when>
        <otherwise><!--si Ã©s que no, el rel serÃ  "que" i caldrÃ  posar subjecte al verb-->
            <out>
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
            </out>
            <call-macro n="posa_subj2">
                <with-param pos="3"/>
            </call-macro>
            <out>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
            </out>
        </otherwise>
    </choose>
</action>
</rule>

<rule comment="REGLA: SV"> 
  <pattern>
    <pattern-item n="SV"/>
  </pattern>
  <action>
    <call-macro n="assign_subj_num">
      <with-param pos="1"/>
    </call-macro>
    <call-macro n="convert_tense">
      <with-param pos="1"/>
    </call-macro>
    <call-macro n="posa_subj">
      <with-param pos="1"/>
    </call-macro>
    <out>
      <chunk>
        <clip pos="1" part="lem"/>
        <clip pos="1" part="tags"/>
        <clip pos="1" part="chcontent"/>
        <!--  <var n="pers_subj"/>  -->
        <!--  <var n="nombre_subj"/> -->
      </chunk>
    </out>
  </action>
</rule>

<rule comment="ANT VPART_a SV punt">
      <pattern>
    <pattern-item n="ANT"/>
    <pattern-item n="VPART_a"/>
    <pattern-item n="SV"/>
    <pattern-item n="punt"/>
      </pattern>
      <action>
    <out>
      <chunk>
        <clip pos="1" part="whole"/>
      </chunk>
      <b pos="1"/>
      <chunk>
        <clip pos="3" part="whole"/>
      </chunk>
      <b pos="2"/>
      <chunk>
        <clip pos="4" part="whole"/>
          </chunk>
    </out>
        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>
      </action>
</rule>

<rule comment="regla: ANT SV punt">
      <pattern>
    <pattern-item n="ANT"/>
    <pattern-item n="SV"/>
    <pattern-item n="punt"/>
      </pattern>
      <action>
    <out>
      <chunk>
        <clip pos="1" part="whole"/>
      </chunk>
      <b pos="1"/>
      <chunk>
        <clip pos="2" part="whole"/>
      </chunk>
      <b pos="2"/>
      <chunk>
        <clip pos="3" part="whole"/>
          </chunk>
    </out>
        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>
      </action>
</rule>

 <rule comment="REGLA: PRNS VPART SV">
      <pattern>
    <pattern-item n="PRNS"/>
    <pattern-item n="VPART"/>
    <pattern-item n="SV"/>
      </pattern>
      <action>
        <call-macro n="concord_prnsubj_verb2">
          <with-param pos="1"/>
          <with-param pos="3"/>
        </call-macro>
    <out>
      <chunk>
        <clip pos="1" part="whole"/>
      </chunk>
      <b pos="1"/>
      <chunk>
        <clip pos="3" part="whole"/>
      </chunk>
    </out>
        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>
      </action>
</rule>

 <rule comment="REGLA: PRNS VPART SV punt">
      <pattern>
    <pattern-item n="PRNS"/>
    <pattern-item n="VPART"/>
    <pattern-item n="SV"/>
    <pattern-item n="punt"/>
      </pattern>
      <action>
        <call-macro n="concord_prnsubj_verb2">
          <with-param pos="1"/>
          <with-param pos="3"/>
        </call-macro>
    <out>
      <chunk>
        <clip pos="1" part="whole"/>
      </chunk>
      <b pos="1"/>
      <chunk>
        <clip pos="3" part="whole"/>
      </chunk>
      <b pos="2"/>
      <chunk>
        <clip pos="4" part="whole"/>
      </chunk>
    </out>
        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>
      </action>
</rule>

<rule comment="REGLA: SN VPART_a SV punt"> 
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="VPART_a"/>
        <pattern-item n="SV"/>
        <pattern-item n="punt"/>
    </pattern>
    <action>

        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>
                        <out>
                            <chunk>
                                <clip pos="1" part="lem"/>
                                <clip pos="1" part="tags"/>
                                <clip pos="1" part="chcontent"/>
                            </chunk>
                            <b pos="1"/>
                        </out>

        <call-macro n="posa_subj">
            <with-param pos="3"/>
        </call-macro>
                        <out>
                            <chunk>
                                <clip pos="3" part="lem"/>
                                <clip pos="3" part="tags"/>
                                <clip pos="3" part="chcontent"/>
                            </chunk>
          <chunk>
            <clip pos="4" part="whole"/>
          </chunk>
        </out>
    </action>
</rule>


<rule comment="REGLA: SN VPART_en_em SV punt"> 
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="VPART_en_em"/>
        <pattern-item n="SV"/>
        <pattern-item n="punt"/>
    </pattern>
    <action>
      <call-macro n="particle_concord2">
          <with-param pos="2"/>
          <with-param pos="3"/>
      </call-macro>
        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>
      <call-macro n="f_concord1"> <!-- This should not be necessary "ar serc’hed en em starde" -->
        <with-param pos="1"/>
      </call-macro>
      <choose>
        <when>
          <test>
            <not>
              <equal>
                <clip pos="1" part="nbr"/>
                <lit-tag v="sp"/>
              </equal>
            </not>
          </test>
           <let>
             <clip pos="3" part="nbr"/>
             <clip pos="1" part="nbr"/>
           </let>
        </when>
      </choose>

                        <out>
                            <chunk>
                                <clip pos="1" part="lem"/>
                                <clip pos="1" part="tags"/>
                                <clip pos="1" part="chcontent"/>
                            </chunk>
                         
                            <b pos="1"/>
                                            <chunk>
                                                <lit v="prnpro"/>
                                                <lit-tag v="SN"/>
                                                <lit v="{^"/>
                                                <lit v="se"/>
                                                <lit-tag v="prn.pro.ref.p3.mf.sp"/>
                                                <lit v="$}"/>
                                            </chunk>
                                            <b/>

                            <chunk>
                                <clip pos="3" part="lem"/>
                                <clip pos="3" part="tags"/>
                                <clip pos="3" part="chcontent"/>
                            </chunk>
                        </out>
        <out>
          <chunk>
            <clip pos="4" part="whole"/>
          </chunk>
        </out>
    </action>
</rule>



<rule comment="REGLA: SN VPART SV punt"> 
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="VPART"/>
        <pattern-item n="SV"/>
        <pattern-item n="punt"/>
    </pattern>
    <action>
      <call-macro n="particle_concord2">
          <with-param pos="2"/>
          <with-param pos="3"/>
      </call-macro>
        <call-macro n="posa_subj">
            <with-param pos="3"/>
        </call-macro>
      <call-macro n="f_concord1"> <!-- This should not be necessary "ar serc’hed en em starde" -->
        <with-param pos="1"/>
      </call-macro>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="nom"/>
                            </equal>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="1" part="nbr"/>
                            <lit-tag v="pl"/>
                        </equal>
                    </and>
                </test>
                <out>
                    <chunk>
                      <get-case-from pos="2">
                        <clip pos="3" part="lem"/>
                      </get-case-from>
                        <clip pos="3" part="tags"/>
                        <clip pos="3" part="chcontent"/>
                    </chunk>
                    <b pos="1"/>
                    <chunk>
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="3">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>
                            <get-case-from pos="3">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def.mf.pl"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>

                    <chunk>
                      <get-case-from pos="3">
                        <clip pos="1" part="lem"/>
                      </get-case-from>
                        <clip pos="1" part="tags"/>
                        <clip pos="1" part="chcontent"/>
                    </chunk>


                </out>
            </when>
            <otherwise>
                <choose>
                    <when>
                        <test>
                            <and>
                                <or>
                                    <equal caseless="yes">
                                        <clip pos="1" part="lem"/>
                                        <lit v="part"/>
                                    </equal>
                                    <equal caseless="yes">
                                        <clip pos="1" part="lem"/>
                                        <lit v="partadj_nom"/>
                                    </equal>
                                    <equal caseless="yes">
                                        <clip pos="1" part="lem"/>
                                        <lit v="partnom_adj"/>
                                    </equal>
                                </or>                
                                <equal caseless="yes">
                                    <clip pos="1" part="nbr"/>
                                    <lit-tag v="sg"/>
                                </equal>                
                            </and>
                        </test>
                        <out>
                            <chunk>
                              <get-case-from pos="2">
                                <clip pos="3" part="lem"/>
                              </get-case-from>
                                <clip pos="3" part="tags"/>
                                <clip pos="3" part="chcontent"/>
                            </chunk>
                            <b pos="1"/>
                            <chunk>
                                <lit v="partitiu"/>
                                    <lit-tag v="part"/>
                                    <lit v="{^"/>
                                    <get-case-from pos="3">
                                        <lit v="de"/>
                                    </get-case-from>
                                    <lit-tag v="pr"/>
                                    <lit v="$ ^"/>
                                    <get-case-from pos="3">
                                        <lit v="le"/>
                                    </get-case-from>
                                    <lit-tag v="det.def"/>
                                    <clip pos="1" part="gen"/>
                                    <lit-tag v="sg"/>
                                <lit v="$}"/>
                            </chunk>
                            <b/>

                            <chunk>
                              <get-case-from pos="3">
                                <clip pos="1" part="lem"/>
                              </get-case-from>
                                <clip pos="1" part="tags"/>
                                <clip pos="1" part="chcontent"/>
                            </chunk>


                        </out>
                    </when>
                    <otherwise>

                        <out>
                            <chunk>
                              <get-case-from pos="2">
                                <clip pos="3" part="lem"/>
                              </get-case-from>
                                <clip pos="3" part="tags"/>
                                <clip pos="3" part="chcontent"/>
                            </chunk>
                            <b pos="1"/>
                            <chunk>
                              <get-case-from pos="3">
                                <clip pos="1" part="lem"/>
                              </get-case-from>
                                <clip pos="1" part="tags"/>
                                <clip pos="1" part="chcontent"/>
                            </chunk>
                        </out>
                    </otherwise>
                </choose>
            </otherwise>
        </choose>
        <out>
          <chunk>
            <clip pos="4" part="whole"/>
          </chunk>
        </out>
    </action>
</rule>

<rule comment="REGLA: SN SV adv punt"> 
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="SV"/>
        <pattern-item n="adv"/>
        <pattern-item n="punt"/>
    </pattern>
    <action>
        <call-macro n="posa_subj">
            <with-param pos="2"/>
        </call-macro>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="nom"/>
                            </equal>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="1" part="nbr"/>
                            <lit-tag v="pl"/>
                        </equal>
                    </and>
                </test>
                <out>
                    <chunk>
                      <get-case-from pos="2">
                        <clip pos="2" part="lem"/>
                      </get-case-from>
                        <clip pos="2" part="tags"/>
                        <clip pos="2" part="chcontent"/>
                    </chunk>
                    <b pos="1"/>
                    <chunk>
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="2">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>
                            <get-case-from pos="2">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def.mf.pl"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>

                    <chunk>
                      <get-case-from pos="2">
                        <clip pos="1" part="lem"/>
                      </get-case-from>
                        <clip pos="1" part="tags"/>
                        <clip pos="1" part="chcontent"/>
                    </chunk>


                </out>
            </when>
            <otherwise>
                <choose>
                    <when>
                        <test>
                            <and>
                                <or>
                                    <equal caseless="yes">
                                        <clip pos="1" part="lem"/>
                                        <lit v="part"/>
                                    </equal>
                                    <equal caseless="yes">
                                        <clip pos="1" part="lem"/>
                                        <lit v="partadj_nom"/>
                                    </equal>
                                    <equal caseless="yes">
                                        <clip pos="1" part="lem"/>
                                        <lit v="partnom_adj"/>
                                    </equal>
                                </or>                
                                <equal caseless="yes">
                                    <clip pos="1" part="nbr"/>
                                    <lit-tag v="sg"/>
                                </equal>                
                            </and>
                        </test>
                        <out>
                            <chunk>
                              <get-case-from pos="2">
                                <clip pos="2" part="lem"/>
                              </get-case-from>
                                <clip pos="2" part="tags"/>
                                <clip pos="2" part="chcontent"/>
                            </chunk>
                            <b pos="1"/>
                            <chunk>
                                <lit v="partitiu"/>
                                    <lit-tag v="part"/>
                                    <lit v="{^"/>
                                    <get-case-from pos="2">
                                        <lit v="de"/>
                                    </get-case-from>
                                    <lit-tag v="pr"/>
                                    <lit v="$ ^"/>
                                    <get-case-from pos="2">
                                        <lit v="le"/>
                                    </get-case-from>
                                    <lit-tag v="det.def"/>
                                    <clip pos="1" part="gen"/>
                                    <lit-tag v="sg"/>
                                <lit v="$}"/>
                            </chunk>
                            <b/>

                            <chunk>
                              <get-case-from pos="2">
                                <clip pos="1" part="lem"/>
                              </get-case-from>
                                <clip pos="1" part="tags"/>
                                <clip pos="1" part="chcontent"/>
                            </chunk>


                        </out>
                    </when>
                    <otherwise>

                        <out>
                            <chunk>
                              <get-case-from pos="1">
                                <clip pos="2" part="lem"/>
                              </get-case-from>
                                <clip pos="2" part="tags"/>
                                <clip pos="2" part="chcontent"/>
                            </chunk>
                            <b pos="1"/>
                            <chunk>
                              <get-case-from pos="2">
                                <clip pos="1" part="lem"/>
                              </get-case-from>
                                <clip pos="1" part="tags"/>
                                <clip pos="1" part="chcontent"/>
                            </chunk>
                            <b pos="2"/>
                        </out>
                    </otherwise>
                </choose>
            </otherwise>
        </choose>
        <out>
          <chunk>
            <clip pos="3" part="whole"/>
          </chunk>
          <b pos="3"/>
          <chunk>
            <clip pos="4" part="whole"/>
          </chunk>
        </out>
    </action>
</rule>


<rule comment="REGLA: SN_loc SV punt"> 
    <pattern>
        <pattern-item n="SN_loc"/>
        <pattern-item n="SV"/>
        <pattern-item n="punt"/>
    </pattern>
    <action>
        <call-macro n="posa_subj">
            <with-param pos="2"/>
        </call-macro>
                        <out>
                            <chunk>
                                <clip pos="2" part="lem"/>
                                <clip pos="2" part="tags"/>
                                <clip pos="2" part="chcontent"/>
                            </chunk>
                            <b pos="1"/>
                            <chunk>
                              <get-case-from pos="2">
                                <clip pos="1" part="lem"/>
                              </get-case-from>
                                <clip pos="1" part="tags"/>
                                <clip pos="1" part="chcontent"/>
                            </chunk>
          <chunk>
            <clip pos="3" part="whole"/>
          </chunk>
        </out>
    </action>
</rule>


<rule comment="regla: PRNS SV punt">
      <pattern>
    <pattern-item n="PRNS"/>
    <pattern-item n="SV"/>
    <pattern-item n="punt"/>
      </pattern>
      <action>
        <call-macro n="concord_prnsubj_verb2">
          <with-param pos="1"/>
          <with-param pos="2"/>
        </call-macro>
    <out>
      <chunk>
        <clip pos="1" part="whole"/>
      </chunk>
      <b pos="1"/>
      <chunk>
        <clip pos="2" part="whole"/>
      </chunk>
      <b pos="2"/>
      <chunk>
        <clip pos="3" part="whole"/>
          </chunk>
    </out>
        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>
      </action>
</rule>



<rule comment="REGLA: SN SV punt"> 
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="SV"/>
        <pattern-item n="punt"/>
    </pattern>
    <action>
        <call-macro n="posa_subj">
            <with-param pos="2"/>
        </call-macro>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="nom"/>
                            </equal>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="1" part="nbr"/>
                            <lit-tag v="pl"/>
                        </equal>
                    </and>
                </test>
                <out>
                    <chunk>
                      <get-case-from pos="2">
                        <clip pos="2" part="lem"/>
                      </get-case-from>
                        <clip pos="2" part="tags"/>
                        <clip pos="2" part="chcontent"/>
                    </chunk>
                    <b pos="1"/>
                    <chunk>
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="2">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>
                            <get-case-from pos="2">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def.mf.pl"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>

                    <chunk>
                      <get-case-from pos="2">
                        <clip pos="1" part="lem"/>
                      </get-case-from>
                        <clip pos="1" part="tags"/>
                        <clip pos="1" part="chcontent"/>
                    </chunk>


                </out>
            </when>
            <otherwise>
                <choose>
                    <when>
                        <test>
                            <and>
                                <or>
                                    <equal caseless="yes">
                                        <clip pos="1" part="lem"/>
                                        <lit v="part"/>
                                    </equal>
                                    <equal caseless="yes">
                                        <clip pos="1" part="lem"/>
                                        <lit v="partadj_nom"/>
                                    </equal>
                                    <equal caseless="yes">
                                        <clip pos="1" part="lem"/>
                                        <lit v="partnom_adj"/>
                                    </equal>
                                </or>                
                                <equal caseless="yes">
                                    <clip pos="1" part="nbr"/>
                                    <lit-tag v="sg"/>
                                </equal>                
                            </and>
                        </test>
                        <out>
                            <chunk>
                              <get-case-from pos="2">
                                <clip pos="2" part="lem"/>
                              </get-case-from>
                                <clip pos="2" part="tags"/>
                                <clip pos="2" part="chcontent"/>
                            </chunk>
                            <b pos="1"/>
                            <chunk>
                                <lit v="partitiu"/>
                                    <lit-tag v="part"/>
                                    <lit v="{^"/>
                                    <get-case-from pos="2">
                                        <lit v="de"/>
                                    </get-case-from>
                                    <lit-tag v="pr"/>
                                    <lit v="$ ^"/>
                                    <get-case-from pos="2">
                                        <lit v="le"/>
                                    </get-case-from>
                                    <lit-tag v="det.def"/>
                                    <clip pos="1" part="gen"/>
                                    <lit-tag v="sg"/>
                                <lit v="$}"/>
                            </chunk>
                            <b/>

                            <chunk>
                              <get-case-from pos="2">
                                <clip pos="1" part="lem"/>
                              </get-case-from>
                                <clip pos="1" part="tags"/>
                                <clip pos="1" part="chcontent"/>
                            </chunk>


                        </out>
                    </when>
                    <otherwise>

                        <out>
                            <chunk>
                              <get-case-from pos="1">
                                <clip pos="2" part="lem"/>
                              </get-case-from>
                                <clip pos="2" part="tags"/>
                                <clip pos="2" part="chcontent"/>
                            </chunk>
                            <b pos="1"/>
                            <chunk>
                              <get-case-from pos="2">
                                <clip pos="1" part="lem"/>
                              </get-case-from>
                                <clip pos="1" part="tags"/>
                                <clip pos="1" part="chcontent"/>
                            </chunk>
                        </out>
                    </otherwise>
                </choose>
            </otherwise>
        </choose>
        <out>
          <chunk>
            <clip pos="3" part="whole"/>
          </chunk>
        </out>
    </action>
</rule>


 <rule comment="SV PRNS">
      <pattern>
    <pattern-item n="SV"/>
    <pattern-item n="PRNS"/>
      </pattern>
      <action>
            <out>
              <chunk>
                <clip pos="1" part="whole"/>
              </chunk>
              <chunk>
                <lit v="guio{^-"/>
                <lit-tag v="guio"/> 
                <lit v="$}"/>
              </chunk>
              <chunk>
                <clip pos="2" part="lem"/>
                <clip pos="2" part="tags"/>
                <clip pos="2" part="chcontent"/>
              </chunk>
            </out>

        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>

      </action>
</rule>




<rule comment="REGLA: SV SN"> 
    <pattern>
        <pattern-item n="SV"/>
        <pattern-item n="SN"/>
    </pattern>
    <action>
        <call-macro n="posa_subj">
            <with-param pos="1"/>
        </call-macro>
        
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="nom"/>
                            </equal>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>


                        </or>
                        <equal>
                            <clip pos="2" part="nbr"/>
                            <lit-tag v="pl"/>
                        </equal>
                    </and>
                </test>
                <out>
                    <chunk>
                        <clip pos="1" part="lem"/>
                        <clip pos="1" part="tags"/>
                        <clip pos="1" part="chcontent"/>
                    </chunk>
                    <b pos="1"/>
                    <chunk>
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="2">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>
                            <get-case-from pos="2">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def.mf.pl"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>

                    <chunk>
                        <clip pos="2" part="lem"/>
                        <clip pos="2" part="tags"/>
                        <clip pos="2" part="chcontent"/>
                    </chunk>


                </out>
            </when>
            <otherwise>
                <choose>
                    <when>
                        <test>
                            <and>
                                <or>
                                    <equal>
                                        <clip pos="2" part="lem"/>
                                        <lit v="part"/>
                                    </equal>
                                    <equal>
                                        <clip pos="2" part="lem"/>
                                        <lit v="partadj_nom"/>
                                    </equal>
                                    <equal>
                                        <clip pos="2" part="lem"/>
                                        <lit v="partnom_adj"/>
                                    </equal>
                                </or>                
                                <equal>
                                    <clip pos="2" part="nbr"/>
                                    <lit-tag v="sg"/>
                                </equal>                
                            </and>
                        </test>
                        <out>
                            <chunk>
                                <clip pos="1" part="lem"/>
                                <clip pos="1" part="tags"/>
                                <clip pos="1" part="chcontent"/>
                            </chunk>
                            <b pos="1"/>
                            <chunk>
                                <lit v="partitiu"/>
                                    <lit-tag v="part"/>
                                    <lit v="{^"/>
                                    <get-case-from pos="2">
                                        <lit v="de"/>
                                    </get-case-from>
                                    <lit-tag v="pr"/>
                                    <lit v="$ ^"/>
                                    <get-case-from pos="2">
                                        <lit v="le"/>
                                    </get-case-from>
                                    <lit-tag v="det.def"/>
                                    <clip pos="2" part="gen"/>
                                    <lit-tag v="sg"/>
                                <lit v="$}"/>
                            </chunk>
                            <b/>

                            <chunk>
                                <clip pos="2" part="lem"/>
                                <clip pos="2" part="tags"/>
                                <clip pos="2" part="chcontent"/>
                            </chunk>


                        </out>
                    </when>
                    <otherwise>

                        <out>
                            <chunk>
                                <clip pos="1" part="lem"/>
                                <clip pos="1" part="tags"/>
                                <clip pos="1" part="chcontent"/>
                            </chunk>
                            <b pos="1"/>
                            <chunk>
                                <clip pos="2" part="lem"/>
                                <clip pos="2" part="tags"/>
                                <clip pos="2" part="chcontent"/>
                            </chunk>
                        </out>
                    </otherwise>
                </choose>
            </otherwise>
        </choose>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="2"/>
    </call-macro>
    </action>
</rule>

<rule comment="REGLA: SV SN cnjcoo SN">
    <pattern>
        <pattern-item n="SV"/>
        <pattern-item n="SN"/>
        <pattern-item n="cnjcoo"/>
        <pattern-item n="SN"/>
    </pattern>
    <action>
    <call-macro n="posa_subj">
        <with-param pos="1"/>
    </call-macro>
        <out>
            <chunk>
                <clip pos="1" part="lem"/>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
            </chunk>
            <b pos="1"/>
        </out>

        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="nom"/>
                            </equal>

                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>


                        </or>
                        <equal>
                            <clip pos="2" part="nbr"/>
                            <lit-tag v="pl"/>
                        </equal>
                        
                        <not>
                           <in caseless="yes">
                            <clip pos="1" part="lem"/>
                            <list n="prde"/>
                           </in>
                        </not>
                    </and>
                </test>
                <out>
                    <chunk>
                    
                      <get-case-from pos="2">
                        <lit v="partitiu"/>
                      </get-case-from>
                      <lit-tag v="part"/>      
                                            
                      <lit v="{^de"/>
                      <lit-tag v="pr"/>
                      <lit v="$"/>
                      <b/>
                      <lit v="^le"/>    
                          <lit-tag v="det.def.mf.pl"/>
                      <lit v="$}"/>
                        
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="partadj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="2" part="lem"/>
                                <lit v="partnom_adj"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="2" part="nbr"/>
                            <lit-tag v="sg"/>
                        </equal>
                        
                        <not>
                           <in caseless="yes">
                            <clip pos="1" part="lem"/>
                            <list n="prde"/>
                           </in>
                        </not>
                    </and>
                </test>
                <out>
                    <chunk>
                      <get-case-from pos="2">
                        <lit v="partitiu"/>
                      </get-case-from>
                      <lit-tag v="part"/>      
                                            
                      <lit v="{^de"/>
                      <lit-tag v="pr"/>
                      <lit v="$"/>
                      <b/>
                      <lit v="^le"/>    
                          <lit-tag v="det.def"/>
                      <clip pos="2" part="gen"/>
                      <lit-tag v="sg"/>
                      <lit v="$}"/>
                            
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>

        <out>
            <chunk>
                <clip pos="2" part="lem"/>
                <clip pos="2" part="tags"/>
                <clip pos="2" part="chcontent"/>
            </chunk>
            <b pos="2"/>
            <chunk>
                <clip pos="3" part="lem"/>
                <clip pos="3" part="tags"/>
                <clip pos="3" part="chcontent"/>
            </chunk>
            <b pos="3"/>
        </out>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="nom"/>
                            </equal>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>

                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="part"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="4" part="nbr"/>
                            <lit-tag v="pl"/>
                        </equal>
                        
                        <not>
                           <in caseless="yes">
                            <clip pos="1" part="lem"/>
                            <list n="prde"/>
                           </in>
                        </not>
                    </and>
                </test>
                <out>
                    <chunk>
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="4">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>                        
                            <get-case-from pos="4">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def.mf.pl"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="partadj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="partnom_adj"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="4" part="nbr"/>
                            <lit-tag v="sg"/>
                        </equal>
                        
                        <not>
                           <in caseless="yes">
                            <clip pos="1" part="lem"/>
                            <list n="prde"/>
                           </in>
                        </not>
                    </and>
                </test>
                <out>
                    <chunk>
                    
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="4">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>                        
                            <get-case-from pos="4">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def"/>
                            <clip pos="4" part="gen"/>
                            <lit-tag v="sg"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <out>
            <chunk>
                <clip pos="4" part="lem"/>
                <clip pos="4" part="tags"/>
                <clip pos="4" part="chcontent"/>
            </chunk>
        </out>
    </action>
</rule>


<rule comment="REGLA: SV adv SN cnjcoo SN">
    <pattern>
        <pattern-item n="SV"/>
        <pattern-item n="adv"/>
        <pattern-item n="SN"/>
        <pattern-item n="cnjcoo"/>
        <pattern-item n="SN"/>
    </pattern>
    <action>
    <call-macro n="posa_subj">
        <with-param pos="1"/>
    </call-macro>
        <out>
            <chunk>
                <clip pos="1" part="lem"/>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
            </chunk>
            <b pos="1"/>
            <chunk>
                <clip pos="2" part="lem"/>
                <clip pos="2" part="tags"/>
                <clip pos="2" part="chcontent"/>
            </chunk>
            <b pos="2"/>
        </out>

        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="nom"/>
                            </equal>

                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>


                        </or>
                        <equal>
                            <clip pos="3" part="nbr"/>
                            <lit-tag v="pl"/>
                        </equal>
                        
                    </and>
                </test>
                <out>
                    <chunk>
                    
                      <get-case-from pos="3">
                        <lit v="partitiu"/>
                      </get-case-from>
                      <lit-tag v="part"/>      
                                            
                      <lit v="{^de"/>
                      <lit-tag v="pr"/>
                      <lit v="$"/>
                      <b/>
                      <lit v="^le"/>    
                          <lit-tag v="det.def.mf.pl"/>
                      <lit v="$}"/>
                        
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="partadj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="partnom_adj"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="3" part="nbr"/>
                            <lit-tag v="sg"/>
                        </equal>
                        
                    </and>
                </test>
                <out>
                    <chunk>
                      <get-case-from pos="3">
                        <lit v="partitiu"/>
                      </get-case-from>
                      <lit-tag v="part"/>      
                                            
                      <lit v="{^de"/>
                      <lit-tag v="pr"/>
                      <lit v="$"/>
                      <b/>
                      <lit v="^le"/>    
                          <lit-tag v="det.def"/>
                      <clip pos="3" part="gen"/>
                      <lit-tag v="sg"/>
                      <lit v="$}"/>
                            
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>

        <out>
            <chunk>
                <clip pos="3" part="lem"/>
                <clip pos="3" part="tags"/>
                <clip pos="3" part="chcontent"/>
            </chunk>
            <b pos="3"/>
            <chunk>
                <clip pos="4" part="lem"/>
                <clip pos="4" part="tags"/>
                <clip pos="4" part="chcontent"/>
            </chunk>
            <b pos="4"/>
        </out>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="5" part="lem"/>
                                <lit v="nom"/>
                            </equal>
                            <equal>
                                <clip pos="5" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="5" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>

                            <equal>
                                <clip pos="5" part="lem"/>
                                <lit v="part"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="5" part="nbr"/>
                            <lit-tag v="pl"/>
                        </equal>
                        
                    </and>
                </test>
                <out>
                    <chunk>
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="5">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>                        
                            <get-case-from pos="5">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def.mf.pl"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="5" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="5" part="lem"/>
                                <lit v="partadj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="5" part="lem"/>
                                <lit v="partnom_adj"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="5" part="nbr"/>
                            <lit-tag v="sg"/>
                        </equal>
                    </and>
                </test>
                <out>
                    <chunk>
                    
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="5">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>                        
                            <get-case-from pos="5">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def"/>
                            <clip pos="5" part="gen"/>
                            <lit-tag v="sg"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <out>
            <chunk>
                <clip pos="5" part="lem"/>
                <clip pos="5" part="tags"/>
                <clip pos="5" part="chcontent"/>
            </chunk>
        </out>
    </action>
</rule>



<rule comment="REGLA: SV ADV SN"> 
    <pattern>
        <pattern-item n="SV"/>
        <pattern-item n="adv"/>
        <pattern-item n="SN"/>
    </pattern>
    <action>
      <call-macro n="posa_subj">
        <with-param pos="1"/>
      </call-macro>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="nom"/>
                            </equal>

                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>


                        </or>
                        <equal>
                            <clip pos="3" part="nbr"/>
                            <lit-tag v="pl"/>
                        </equal>
                    </and>
                </test>
                <out>
                    <chunk>
                        <clip pos="1" part="lem"/>
                        <clip pos="1" part="tags"/>
                        <clip pos="1" part="chcontent"/>
                    </chunk>
                    <b pos="1"/>
                    <chunk>
                        <clip pos="2" part="lem"/>
                        <clip pos="2" part="tags"/>
                        <clip pos="2" part="chcontent"/>
                    </chunk>
                    <b pos="2"/>
                    <chunk>
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="3">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>
                            <get-case-from pos="3">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def.mf.pl"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>

                    <chunk>
                        <clip pos="3" part="lem"/>
                        <clip pos="3" part="tags"/>
                        <clip pos="3" part="chcontent"/>
                    </chunk>


                </out>
            </when>
            <otherwise>
                <choose>
                    <when>
                        <test>
                            <and>
                                <or>
                                    <equal>
                                        <clip pos="3" part="lem"/>
                                        <lit v="part"/>
                                    </equal>
                                    <equal>
                                        <clip pos="3" part="lem"/>
                                        <lit v="partadj_nom"/>
                                    </equal>
                                    <equal>
                                        <clip pos="3" part="lem"/>
                                        <lit v="partnom_adj"/>
                                    </equal>
                                </or>                
                                <equal>
                                    <clip pos="3" part="nbr"/>
                                    <lit-tag v="sg"/>
                                </equal>                
                            </and>
                        </test>
                        <out>
                            <chunk>
                                <clip pos="1" part="lem"/>
                                <clip pos="1" part="tags"/>
                                <clip pos="1" part="chcontent"/>
                            </chunk>
                            <b pos="1"/>
                            <chunk>
                                <clip pos="2" part="lem"/>
                                <clip pos="2" part="tags"/>
                                <clip pos="2" part="chcontent"/>
                            </chunk>
                            <b pos="2"/>
                            <chunk>
                                <lit v="partitiu"/>
                                    <lit-tag v="part"/>
                                    <lit v="{^"/>
                                    <get-case-from pos="3">
                                        <lit v="de"/>
                                    </get-case-from>
                                    <lit-tag v="pr"/>
                                    <lit v="$ ^"/>
                                    <get-case-from pos="3">
                                        <lit v="le"/>
                                    </get-case-from>
                                    <lit-tag v="det.def"/>
                                    <clip pos="3" part="gen"/>
                                    <lit-tag v="sg"/>
                                <lit v="$}"/>
                            </chunk>
                            <b/>

                            <chunk>
                                <clip pos="3" part="lem"/>
                                <clip pos="3" part="tags"/>
                                <clip pos="3" part="chcontent"/>
                            </chunk>


                        </out>
                    </when>
                    <otherwise>

                        <out>
                            <chunk>
                                <clip pos="1" part="lem"/>
                                <clip pos="1" part="tags"/>
                                <clip pos="1" part="chcontent"/>
                            </chunk>
                            <b pos="1"/>
                            <chunk>
                                <clip pos="2" part="lem"/>
                                <clip pos="2" part="tags"/>
                                <clip pos="2" part="chcontent"/>
                            </chunk>
                            <b pos="2"/>
                            <chunk>
                                <clip pos="3" part="lem"/>
                                <clip pos="3" part="tags"/>
                                <clip pos="3" part="chcontent"/>
                            </chunk>
                        </out>
                    </otherwise>
                </choose>
            </otherwise>
        </choose>
    </action>
</rule>

<rule comment="REGLA: ADV SV"> 
    <pattern>
        <pattern-item n="adv"/>
        <pattern-item n="SV"/>
    </pattern>
    <action>
        <out>
            <chunk>
                <get-case-from pos="2">
                <clip pos="1" part="lem"/>
                </get-case-from>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
            </chunk>
            <b pos="1"/>
                </out>
        <call-macro n="posa_subj">
            <with-param pos="2"/>
        </call-macro>
                <out>
            <chunk>
                <clip pos="2" part="lem"/>
                <clip pos="2" part="tags"/>
                <clip pos="2" part="chcontent"/>
            </chunk>
        </out>
    </action>
</rule>

<rule comment="REGLA: ADV SV SN"> 
    <pattern>
        <pattern-item n="adv"/>
        <pattern-item n="SV"/>
        <pattern-item n="SN"/>
    </pattern>
    <action>
        <out>
            <chunk>
                <get-case-from pos="2">
                <clip pos="1" part="lem"/>
                </get-case-from>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
            </chunk>
            <b pos="1"/>
                </out>
        <call-macro n="posa_subj">
            <with-param pos="2"/>
        </call-macro>
                <out>
            <chunk>
                <clip pos="2" part="lem"/>
                <clip pos="2" part="tags"/>
                <clip pos="2" part="chcontent"/>
            </chunk>
            <b pos="2"/>
        </out>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="nom"/>
                            </equal>

                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="3" part="nbr"/>
                            <lit-tag v="pl"/>
                        </equal>
                    </and>
                </test>
                <out>
                    <chunk>
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="3">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>
                            <get-case-from pos="3">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def.mf.pl"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="partadj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="partnom_adj"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="3" part="nbr"/>
                            <lit-tag v="sg"/>
                        </equal>
                    </and>
                </test>
                <out>
                    <chunk>
                    
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="3">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>
                            <get-case-from pos="3">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def"/>
                            <clip pos="3" part="gen"/>
                            <lit-tag v="sg"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <out>
            <chunk>
                <clip pos="3" part="lem"/>
                <clip pos="3" part="tags"/>
                <clip pos="3" part="chcontent"/>
            </chunk>
        </out>

    </action>
</rule>

<rule comment="REGLA: ADV SV SN ADV_neg"> 
    <pattern>
        <pattern-item n="adv"/>
        <pattern-item n="SV"/>
        <pattern-item n="SN"/>
        <pattern-item n="adv"/>
    </pattern>
    <action>
        <call-macro n="posa_subj">
            <with-param pos="2"/>
        </call-macro>
        <out>
            <chunk>
                <get-case-from pos="2">
                <clip pos="1" part="lem"/>
                </get-case-from>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
            </chunk>
            <b pos="1"/>
            <chunk>
                <clip pos="2" part="lem"/>
                <clip pos="2" part="tags"/>
                <clip pos="2" part="chcontent"/>
            </chunk>
            <b pos="2"/>
            <chunk>
                <clip pos="4" part="lem"/>
                <clip pos="4" part="tags"/>
                <clip pos="4" part="chcontent"/>
            </chunk>
            <b pos="3"/>
        </out>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="nom"/>
                            </equal>

                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>


                        </or>
                        <equal>
                            <clip pos="3" part="nbr"/>
                            <lit-tag v="pl"/>
                        </equal>
                    </and>
                </test>
                <out>
                    <chunk>
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="3">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>
                            <get-case-from pos="3">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def.mf.pl"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="partadj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="3" part="lem"/>
                                <lit v="partnom_adj"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="3" part="nbr"/>
                            <lit-tag v="sg"/>
                        </equal>
                    </and>
                </test>
                <out>
                    <chunk>
                    
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="3">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>
                            <get-case-from pos="3">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def"/>
                            <clip pos="3" part="gen"/>
                            <lit-tag v="sg"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <out>
            <chunk>
                <clip pos="3" part="lem"/>
                <clip pos="3" part="tags"/>
                <clip pos="3" part="chcontent"/>
            </chunk>
        </out>

    </action>
</rule>


<rule comment="REGLA: ADV SV ADV SN"> 
    <pattern>
        <pattern-item n="adv"/>
        <pattern-item n="SV"/>
        <pattern-item n="adv"/>
        <pattern-item n="SN"/>
    </pattern>
    <action>
        <call-macro n="posa_subj">
            <with-param pos="2"/>
        </call-macro>
        <out>
            <chunk>
                <get-case-from pos="2">
                <clip pos="1" part="lem"/>
                </get-case-from>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
            </chunk>
            <b pos="1"/>
            <chunk>
                <clip pos="2" part="lem"/>
                <clip pos="2" part="tags"/>
                <clip pos="2" part="chcontent"/>
            </chunk>
            <b pos="2"/>
            <chunk>
                <clip pos="3" part="lem"/>
                <clip pos="3" part="tags"/>
                <clip pos="3" part="chcontent"/>
            </chunk>
            <b pos="3"/>
        </out>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="nom"/>
                            </equal>

                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>


                        </or>
                        <equal>
                            <clip pos="4" part="nbr"/>
                            <lit-tag v="pl"/>
                        </equal>
                    </and>
                </test>
                <out>
                    <chunk>
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="4">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>
                            <get-case-from pos="4">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def.mf.pl"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="partadj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="4" part="lem"/>
                                <lit v="partnom_adj"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="4" part="nbr"/>
                            <lit-tag v="sg"/>
                        </equal>
                    </and>
                </test>
                <out>
                    <chunk>
                    
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="4">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>
                            <get-case-from pos="4">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def"/>
                            <clip pos="4" part="gen"/>
                            <lit-tag v="sg"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <out>
            <chunk>
                <clip pos="4" part="lem"/>
                <clip pos="4" part="tags"/>
                <clip pos="4" part="chcontent"/>
            </chunk>
        </out>

    </action>
</rule>

<rule comment="REGLA: SA VPART vbcop punt">
    <pattern>
        <pattern-item n="SA"/>
        <pattern-item n="VPART"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="punt"/>
    </pattern>
    <action>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
            <call-macro n="posa_subj2">
                <with-param pos="3"/>
            </call-macro>
    <out>
        <chunk>
                    <get-case-from pos="2">
            <clip pos="3" part="lem"/>
                    </get-case-from>
            <clip pos="3" part="tags"/>
            <clip pos="3" part="chcontent"/>
        </chunk>
        <b pos="1"/>
        <chunk>
                    <get-case-from pos="2">
            <clip pos="1" part="lem"/>
                    </get-case-from>
            <clip pos="1" part="tags"/>
            <clip pos="1" part="chcontent"/>
        </chunk>
        <b pos="2"/>
        <chunk>
            <clip pos="4" part="lem"/>
            <clip pos="4" part="tags"/>
            <clip pos="4" part="chcontent"/>
        </chunk>
    </out>
</action>
</rule>

<rule comment="REGLA: SA vbcop punt">
    <pattern>
        <pattern-item n="SA"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="punt"/>
    </pattern>
    <action>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
        <call-macro n="posa_subj2">
                <with-param pos="2"/>
            </call-macro>
    <out>
        <chunk>
                    <get-case-from pos="2">
            <clip pos="2" part="lem"/>
                    </get-case-from>
            <clip pos="2" part="tags"/>
            <clip pos="2" part="chcontent"/>
        </chunk>
        <b pos="1"/>
        <chunk>
                    <get-case-from pos="2">
            <clip pos="1" part="lem"/>
                    </get-case-from>
            <clip pos="1" part="tags"/>
            <clip pos="1" part="chcontent"/>
        </chunk>
        <b pos="2"/>
        <chunk>
            <clip pos="3" part="lem"/>
            <clip pos="3" part="tags"/>
            <clip pos="3" part="chcontent"/>
        </chunk>
    </out>
</action>
</rule>

<rule comment="REGLA: SA vbcop SN punt">
    <pattern>
        <pattern-item n="SA"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="SN"/>
        <pattern-item n="punt"/>
    </pattern>
    <action>
    <call-macro n="concord_sa">
        <with-param pos="3"/>
        <with-param pos="1"/>
    </call-macro>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <out>
        <chunk>
                    <get-case-from pos="1">
            <clip pos="3" part="lem"/>
                    </get-case-from>
            <clip pos="3" part="tags"/>
            <clip pos="3" part="chcontent"/>
        </chunk>
        <b pos="1"/>
        <chunk>
                    
                    <get-case-from pos="3">
            <clip pos="2" part="lem"/>
                    </get-case-from>
            <clip pos="2" part="tags"/>
            <clip pos="2" part="chcontent"/>
        </chunk>
        <b pos="2"/>
        <chunk>
                    <get-case-from pos="3">
            <clip pos="1" part="lem"/>
                    </get-case-from>
            <clip pos="1" part="tags"/>
            <clip pos="1" part="chcontent"/>
        </chunk>
    </out>
</action>
</rule>    

<rule comment="REGLA: SN querel SV vbcop SA">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="QUEREL"/>
        <pattern-item n="SV"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="SA"/>
    </pattern>
    <action>
    <call-macro n="concord_sa">
        <with-param pos="1"/>
        <with-param pos="5"/>
    </call-macro>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <out>
    <chunk>
        <clip pos="1" part="lem"/>
        <clip pos="1" part="tags"/>
        <clip pos="1" part="chcontent"/>
    </chunk>
    <b pos="1"/>
    </out>
    <choose> <!--mirem si el SN Ã©s el subj de la subordinada-->
        <when>
            <test>
            <or>
                <and>
                    <equal caseless="yes">
                    <clip pos="1" part="lem"/>
                    <lit v="prnperssubj"/>
                </equal>
                <equal>
                    <clip pos="3" part="pers"/>
                    <clip pos="1" part="pers"/>
                </equal>
                <equal>
                    <clip pos="3" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
            <and>
                <not>
                    <equal caseless="yes">
                        <clip pos="1" part="lem"/>
                        <lit v="prnperssubj"/>
                    </equal>
                </not>
                <equal>
                    <clip pos="3" part="pers"/>
                    <lit-tag v="p3"/>
                </equal>
                <equal>
                    <clip pos="3" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
        </or>
    </test>
            <out> <!--si Ã©s que sÃ­, el rel serÃ  "qui" i no "que"-->
                <chunk>
                    <lit v="qui"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
            <b pos="3"/>
            </out>
        </when>
        <otherwise><!--si Ã©s que no, el rel serÃ  "que" i caldrÃ  posar subjecte al verb-->
            <out>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
            </out>
            <call-macro n="posa_subj2">
                <with-param pos="3"/>
            </call-macro>
            <out>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
            <b pos="3"/>
            </out>
        </otherwise>
    </choose>            
    <choose> <!-- mirem si el SN Ã©s el subj de la pral-->
        <when>
            <test>
                <not>
                    <or>
                    <and>
                        <equal caseless="yes">
                            <clip pos="1" part="lem"/>
                            <lit v="prnperssubj"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="pers"/>
                            <clip pos="1" part="pers"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="nbr"/>
                            <clip pos="1" part="nbr"/>
                        </equal>
                    </and>
                    <and>
                            <equal>
                                <clip pos="4" part="pers"/>
                                <lit-tag v="p3"/>
                            </equal>
                            <equal>
                                <clip pos="4" part="nbr"/>
                                <clip pos="1" part="nbr"/>
                            </equal>
                        </and>
                    </or>
                </not>
            </test>
         <!--si no l'Ã©s, cal posar un subj al SV pral-->
            <call-macro n="posa_subj2">
                <with-param pos="4"/>
            </call-macro>
        </when>
    </choose>
    <out>
        <chunk>
            <clip pos="4" part="lem"/>
            <clip pos="4" part="tags"/>
            <clip pos="4" part="chcontent"/>
        </chunk>
    </out>
    <out>
        <b pos="4"/>
        <chunk>
            <clip pos="5" part="whole"/>
        </chunk>
    </out>
</action>
</rule>    

<rule comment="REGLA: SN vbcop ADV SA">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="adv"/>
        <pattern-item n="SA"/>
    </pattern>
    <action>
    <call-macro n="concord_sa">
        <with-param pos="1"/>
        <with-param pos="4"/>
    </call-macro>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <out>
        <chunk>
            <clip pos="1" part="lem"/>
            <clip pos="1" part="tags"/>
            <clip pos="1" part="chcontent"/>
        </chunk>
        <b pos="1"/>
        <chunk>
            <clip pos="2" part="lem"/>
            <clip pos="2" part="tags"/>
            <clip pos="2" part="chcontent"/>
        </chunk>
        <b pos="2"/>
        <chunk>
            <clip pos="3" part="lem"/>
            <clip pos="3" part="tags"/>
            <clip pos="3" part="chcontent"/>
        </chunk>
        <b pos="3"/>
        <chunk>
            <clip pos="4" part="whole"/>
        </chunk>
    </out>
</action>
</rule>    

<rule comment="REGLA: SN querel SV vbcop adv SA">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="QUEREL"/>
        <pattern-item n="SV"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="adv"/>
        <pattern-item n="SA"/>
    </pattern>
    <action>
    <call-macro n="concord_sa">
        <with-param pos="1"/>
        <with-param pos="6"/>
    </call-macro>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <out>
    <chunk>
        <clip pos="1" part="lem"/>
        <clip pos="1" part="tags"/>
        <clip pos="1" part="chcontent"/>
    </chunk>
    <b pos="1"/>
    </out>
    <choose> <!--mirem si el SN Ã©s el subj de la subordinada-->
        <when>
            <test>
            <or>
                <and>
                    <equal caseless="yes">
                    <clip pos="1" part="lem"/>
                    <lit v="prnperssubj"/>
                </equal>
                <equal>
                    <clip pos="3" part="pers"/>
                    <clip pos="1" part="pers"/>
                </equal>
                <equal>
                    <clip pos="3" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
            <and>
                <not>
                    <equal caseless="yes">
                        <clip pos="1" part="lem"/>
                        <lit v="prnperssubj"/>
                    </equal>
                </not>
                <equal>
                    <clip pos="3" part="pers"/>
                    <lit-tag v="p3"/>
                </equal>
                <equal>
                    <clip pos="3" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
        </or>
    </test>
            <out> <!--si Ã©s que sÃ­, el rel serÃ  "qui" i no "que"-->
                <chunk>
                    <lit v="qui"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
            <b pos="3"/>
            </out>
        </when>
        <otherwise><!--si Ã©s que no, el rel serÃ  "que" i caldrÃ  posar subjecte al verb-->
            <out>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
            </out>
            <call-macro n="posa_subj2">
                <with-param pos="3"/>
            </call-macro>
            <out>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
            <b pos="3"/>
            </out>
        </otherwise>
    </choose>            
    <choose> <!-- mirem si el SN Ã©s el subj de la pral-->
        <when>
            <test>
                <not>
                    <or>
                    <and>
                        <equal caseless="yes">
                            <clip pos="1" part="lem"/>
                            <lit v="prnperssubj"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="pers"/>
                            <clip pos="1" part="pers"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="nbr"/>
                            <clip pos="1" part="nbr"/>
                        </equal>
                    </and>
                    <and>
                            <equal>
                                <clip pos="4" part="pers"/>
                                <lit-tag v="p3"/>
                            </equal>
                            <equal>
                                <clip pos="4" part="nbr"/>
                                <clip pos="1" part="nbr"/>
                            </equal>
                        </and>
                    </or>
                </not>
            </test>
         <!--si no l'Ã©s, cal posar un subj al SV pral-->
            <call-macro n="posa_subj2">
                <with-param pos="4"/>
            </call-macro>
        </when>
    </choose>
    <out>
        <chunk>
            <clip pos="4" part="lem"/>
            <clip pos="4" part="tags"/>
            <clip pos="4" part="chcontent"/>
        </chunk>
    </out>
    <out>
        <b pos="4"/>
        <chunk>
            <clip pos="5" part="whole"/>
        </chunk>
        <b pos="5"/>
        <chunk>
            <clip pos="6" part="whole"/>
        </chunk>
    </out>
</action>
</rule>    

<rule comment="REGLA: SN vbcop SN">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="SN"/>
    </pattern>
    <action>
    <call-macro n="concord_sn">
        <with-param pos="1"/>
        <with-param pos="3"/>
    </call-macro>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <out>
        <chunk>
            <clip pos="1" part="lem"/>
            <clip pos="1" part="tags"/>
            <clip pos="1" part="chcontent"/>
        </chunk>
        <b pos="1"/>
        <chunk>
            <clip pos="2" part="lem"/>
            <clip pos="2" part="tags"/>
            <clip pos="2" part="chcontent"/>
        </chunk>
        <b pos="2"/>
    </out>
    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="3" part="lem"/>
                            <lit v="nom"/>
                        </equal>

                        <equal>
                            <clip pos="3" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="3" part="lem"/>
                            <lit v="adj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="3" part="lem"/>
                            <lit v="nom_adj"/>
                        </equal>
                    </or>
                    <equal>
                        <clip pos="3" part="nbr"/>
                        <lit-tag v="pl"/>
                    </equal>
                </and>
            </test>
            <out>
                <chunk>
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="3">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="3">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def.mf.pl"/>
                    <lit v="$}"/>
                </chunk>
                <b/>
            </out>
        </when>
    </choose>
    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="3" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="3" part="lem"/>
                            <lit v="partadj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="3" part="lem"/>
                            <lit v="partnom_adj"/>
                        </equal>
                    </or>
                    <equal>
                        <clip pos="3" part="nbr"/>
                        <lit-tag v="sg"/>
                    </equal>
                </and>
            </test>
            <out>
                <chunk>
                
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="3">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="3">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def"/>
                        <clip pos="3" part="gen"/>
                        <lit-tag v="sg"/>
                    <lit v="$}"/>
                </chunk>
                <b/>
            </out>
        </when>
    </choose>
    <out>
        <chunk>
            <clip pos="3" part="whole"/>
        </chunk>
    </out>
</action>
</rule>    

<rule comment="REGLA: SN querel SV vbcop SN">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="QUEREL"/>
        <pattern-item n="SV"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="SN"/>
    </pattern>
    <action>
    <call-macro n="concord_sn">
        <with-param pos="1"/>
        <with-param pos="5"/>
    </call-macro>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <out>
    <chunk>
        <clip pos="1" part="lem"/>
        <clip pos="1" part="tags"/>
        <clip pos="1" part="chcontent"/>
    </chunk>
    <b pos="1"/>
    </out>
    <choose> <!--mirem si el SN Ã©s el subj de la subordinada-->
        <when>
            <test>
            <or>
                <and>
                    <equal caseless="yes">
                    <clip pos="1" part="lem"/>
                    <lit v="prnperssubj"/>
                </equal>
                <equal>
                    <clip pos="3" part="pers"/>
                    <clip pos="1" part="pers"/>
                </equal>
                <equal>
                    <clip pos="3" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
            <and>
                <not>
                    <equal caseless="yes">
                        <clip pos="1" part="lem"/>
                        <lit v="prnperssubj"/>
                    </equal>
                </not>
                <equal>
                    <clip pos="3" part="pers"/>
                    <lit-tag v="p3"/>
                </equal>
                <equal>
                    <clip pos="3" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
        </or>
    </test>
            <out> <!--si Ã©s que sÃ­, el rel serÃ  "qui" i no "que"-->
                <chunk>
                    <lit v="qui"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
            <b pos="3"/>
            </out>
        </when>
        <otherwise><!--si Ã©s que no, el rel serÃ  "que" i caldrÃ  posar subjecte al verb-->
            <out>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
            </out>
            <call-macro n="posa_subj2">
                <with-param pos="3"/>
            </call-macro>
            <out>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
            <b pos="3"/>
            </out>
        </otherwise>
    </choose>            
    <choose> <!-- mirem si el SN Ã©s el subj de la pral-->
        <when>
            <test>
                <not>
                    <or>
                    <and>
                        <equal caseless="yes">
                            <clip pos="1" part="lem"/>
                            <lit v="prnperssubj"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="pers"/>
                            <clip pos="1" part="pers"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="nbr"/>
                            <clip pos="1" part="nbr"/>
                        </equal>
                    </and>
                    <and>
                            <equal>
                                <clip pos="4" part="pers"/>
                                <lit-tag v="p3"/>
                            </equal>
                            <equal>
                                <clip pos="4" part="nbr"/>
                                <clip pos="1" part="nbr"/>
                            </equal>
                        </and>
                    </or>
                </not>
            </test>
         <!--si no l'Ã©s, cal posar un subj al SV pral-->
            <call-macro n="posa_subj2">
                <with-param pos="4"/>
            </call-macro>
        </when>
    </choose>
    <out>
        <chunk>
            <clip pos="4" part="lem"/>
            <clip pos="4" part="tags"/>
            <clip pos="4" part="chcontent"/>
        </chunk>
        <b pos="4"/>
    </out>
    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="nom"/>
                        </equal>

                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="adj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="nom_adj"/>
                        </equal>
                    </or>
                    <equal>
                        <clip pos="5" part="nbr"/>
                        <lit-tag v="pl"/>
                    </equal>
                </and>
            </test>
            <out>
                <chunk>
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="5">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="5">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def.mf.pl"/>
                    <lit v="$}"/>
                </chunk>
                <b/>
            </out>
        </when>
    </choose>
    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="partadj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="partnom_adj"/>
                        </equal>
                    </or>
                    <equal>
                        <clip pos="5" part="nbr"/>
                        <lit-tag v="sg"/>
                    </equal>
                </and>
            </test>
            <out>
                <chunk>
                
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="5">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="5">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def"/>
                        <clip pos="5" part="gen"/>
                        <lit-tag v="sg"/>
                    <lit v="$}"/>
                </chunk>
                <b/>
            </out>
        </when>
    </choose>
    <out>


        <chunk>
            <clip pos="5" part="whole"/>
        </chunk>
    </out>
</action>
</rule>    

    
<rule comment="REGLA: SN vbcop adv SN">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="adv"/>
        <pattern-item n="SN"/>
    </pattern>
    <action>
    <call-macro n="concord_sn">
        <with-param pos="1"/>
        <with-param pos="4"/>
    </call-macro>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <out>
        <chunk>
            <clip pos="1" part="lem"/>
            <clip pos="1" part="tags"/>
            <clip pos="1" part="chcontent"/>
        </chunk>
        <b pos="1"/>
        <chunk>
            <clip pos="2" part="lem"/>
            <clip pos="2" part="tags"/>
            <clip pos="2" part="chcontent"/>
        </chunk>
        <b pos="2"/>
        <chunk>
            <clip pos="3" part="lem"/>
            <clip pos="3" part="tags"/>
            <clip pos="3" part="chcontent"/>
        </chunk>
        <b pos="3"/>
    </out>

    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="4" part="lem"/>
                            <lit v="nom"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="lem"/>
                            <lit v="adj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="lem"/>
                            <lit v="nom_adj"/>
                        </equal>
                    </or>
                    <equal>
                        <clip pos="4" part="nbr"/>
                        <lit-tag v="pl"/>
                    </equal>
                </and>
            </test>
            <out>
                <chunk>
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="4">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="4">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def.mf.pl"/>
                    <lit v="$}"/>
                </chunk>
                <b/>
            </out>
        </when>
    </choose>
    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="4" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="lem"/>
                            <lit v="partadj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="lem"/>
                            <lit v="partnom_adj"/>
                        </equal>
                    </or>

                    <equal>
                        <clip pos="4" part="nbr"/>
                        <lit-tag v="sg"/>
                    </equal>
                </and>
            </test>
            <out>
                <chunk>
                
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="4">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="4">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def"/>
                        <clip pos="4" part="gen"/>
                        <lit-tag v="sg"/>
                    <lit v="$}"/>
                </chunk>
                <b/>
            </out>
        </when>
    </choose>
    <out>
        <chunk>
            <clip pos="4" part="lem"/>
            <clip pos="4" part="tags"/>
            <clip pos="4" part="chcontent"/>
        </chunk>
    </out>
</action>
</rule>    

<rule comment="REGLA: SN querel SV vbcop adv SN">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="QUEREL"/>
        <pattern-item n="SV"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="adv"/>
        <pattern-item n="SN"/>
    </pattern>
    <action>
        <call-macro n="concord_sn">
            <with-param pos="1"/>
            <with-param pos="6"/>
        </call-macro>
        <call-macro n="assigna_gen_nbr">
            <with-param pos="1"/>
        </call-macro>
        <out>
            <chunk>
                <clip pos="1" part="lem"/>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
            </chunk>
            <b pos="1"/>
        </out>
        <choose> <!--mirem si el SN Ã©s el subj de la subordinada-->
            <when>
                <test>
                    <or>
                        <and>
                            <equal caseless="yes">
                            <clip pos="1" part="lem"/>
                            <lit v="prnperssubj"/>
                        </equal>
                        <equal>
                            <clip pos="3" part="pers"/>
                            <clip pos="1" part="pers"/>
                        </equal>
                        <equal>
                            <clip pos="3" part="nbr"/>
                            <clip pos="1" part="nbr"/>
                        </equal>
                    </and>
                    <and>
                        <not>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="prnperssubj"/>
                            </equal>
                        </not>
                        <equal>
                            <clip pos="3" part="pers"/>
                            <lit-tag v="p3"/>
                        </equal>
                        <equal>
                            <clip pos="3" part="nbr"/>
                            <clip pos="1" part="nbr"/>
                        </equal>
                    </and>
                </or>
            </test>
            <out> <!--si Ã©s que sÃ­, el rel serÃ  "qui" i no "que"-->
                <chunk>
                    <lit v="qui"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
            </out>
        </when>
        <otherwise><!--si Ã©s que no, el rel serÃ  "que" i caldrÃ  posar subjecte al verb-->
            <out>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
            </out>
            <call-macro n="posa_subj2">
                <with-param pos="3"/>
            </call-macro>
            <out>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
            </out>
        </otherwise>
    </choose>            
    <choose> <!-- mirem si el SN Ã©s el subj de la pral-->
        <when>
            <test>
                <not>
                    <or>
                        <and>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="prnperssubj"/>
                            </equal>
                            <equal>
                                <clip pos="4" part="pers"/>
                                <clip pos="1" part="pers"/>
                            </equal>
                            <equal>
                                <clip pos="4" part="nbr"/>
                                <clip pos="1" part="nbr"/>
                            </equal>
                        </and>
                        <and>
                                <equal>
                                    <clip pos="4" part="pers"/>
                                    <lit-tag v="p3"/>
                                </equal>
                                <equal>
                                    <clip pos="4" part="nbr"/>
                                    <clip pos="1" part="nbr"/>
                                </equal>
                            </and>
                        </or>
                    </not>
                </test>
            <!--si no l'Ã©s, cal posar un subj al SV pral-->
                <call-macro n="posa_subj2">
                    <with-param pos="4"/>
                </call-macro>
            </when>
        </choose>
        <out>
            <chunk>
                <clip pos="4" part="lem"/>
                <clip pos="4" part="tags"/>
                <clip pos="4" part="chcontent"/>
            </chunk>
        </out>
        <out>
            <b pos="4"/>
            <chunk>
                <clip pos="5" part="whole"/>
            </chunk>
            <b pos="5"/>
        </out>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="6" part="lem"/>
                                <lit v="nom"/>
                            </equal>

                            <equal>
                                <clip pos="6" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="6" part="lem"/>
                                <lit v="adj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="6" part="lem"/>
                                <lit v="nom_adj"/>
                            </equal>
                        </or>
                        <equal>
                            <clip pos="6" part="nbr"/>
                            <lit-tag v="pl"/>
                        </equal>
                    </and>
                </test>
                <out>
                    <chunk>
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="6">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>
                            <get-case-from pos="6">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def.mf.pl"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <choose>
            <when>
                <test>
                    <and>
                        <or>
                            <equal>
                                <clip pos="6" part="lem"/>
                                <lit v="part"/>
                            </equal>
                            <equal>
                                <clip pos="6" part="lem"/>
                                <lit v="partadj_nom"/>
                            </equal>
                            <equal>
                                <clip pos="6" part="lem"/>
                                <lit v="partnom_adj"/>
                            </equal>
                        </or>
                    
                        <equal>
                            <clip pos="6" part="nbr"/>
                            <lit-tag v="sg"/>
                        </equal>
                    </and>
                </test>
                <out>
                    <chunk>
                    
                        <lit v="partitiu"/>
                            <lit-tag v="part"/>
                            <lit v="{^"/>
                            <get-case-from pos="6">
                                <lit v="de"/>
                            </get-case-from>
                            <lit-tag v="pr"/>
                            <lit v="$ ^"/>
                            <get-case-from pos="6">
                                <lit v="le"/>
                            </get-case-from>
                            <lit-tag v="det.def"/>
                            <clip pos="6" part="gen"/>
                            <lit-tag v="sg"/>
                        <lit v="$}"/>
                    </chunk>
                    <b/>
                </out>
            </when>
        </choose>
        <out>
            <chunk>
                <clip pos="6" part="whole"/>
            </chunk>
        </out>
    </action>
</rule>    

<rule comment="REGLA: SN vbcop SN querel SV">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="SN"/>
        <pattern-item n="QUEREL"/>
        <pattern-item n="SV"/>
    </pattern>
    <action>
    <call-macro n="concord_sn">
        <with-param pos="1"/>
        <with-param pos="3"/>
    </call-macro>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <out>
        <chunk>
            <clip pos="1" part="lem"/>
            <clip pos="1" part="tags"/>
            <clip pos="1" part="chcontent"/>
        </chunk>
        <b pos="1"/>
        <chunk>
            <clip pos="2" part="lem"/>
            <clip pos="2" part="tags"/>
            <clip pos="2" part="chcontent"/>
        </chunk>
        <b pos="2"/>
    </out>

    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="3" part="lem"/>
                            <lit v="nom"/>
                        </equal>

                        <equal>
                            <clip pos="3" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="3" part="lem"/>
                            <lit v="adj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="3" part="lem"/>
                            <lit v="nom_adj"/>
                        </equal>
                    </or>
                    <equal>
                        <clip pos="3" part="nbr"/>
                        <lit-tag v="pl"/>
                    </equal>
                </and>
            </test>
            <out>
                <chunk>
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="3">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="3">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def.mf.pl"/>
                    <lit v="$}"/>
                </chunk>
                <b/>
            </out>
        </when>
    </choose>
    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="3" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="3" part="lem"/>
                            <lit v="partadj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="3" part="lem"/>
                            <lit v="partnom_adj"/>
                        </equal>
                    </or>

                    <equal>
                        <clip pos="3" part="nbr"/>
                        <lit-tag v="sg"/>
                    </equal>
                </and>
            </test>
            <out>
                <chunk>
                
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="3">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="3">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def"/>
                        <clip pos="3" part="gen"/>
                        <lit-tag v="sg"/>
                    <lit v="$}"/>
                </chunk>
                <b/>
            </out>
        </when>
    </choose>

    <out>
        <chunk>
            <clip pos="3" part="whole"/>
        </chunk>
    </out>
    <choose> <!--mirem si el SN Ã©s el subj de la subordinada-->
        <when>
            <test>
            <or>
            <and>
                <equal caseless="yes">
                    <clip pos="3" part="lem"/>
                    <lit v="prnperssubj"/>
                </equal>
                <equal>
                    <clip pos="5" part="pers"/>
                    <clip pos="3" part="pers"/>
                </equal>
                <equal>
                    <clip pos="5" part="nbr"/>
                    <clip pos="3" part="nbr"/>
                </equal>
            </and>
            <and>
                <not>
                    <equal caseless="yes">
                        <clip pos="3" part="lem"/>
                        <lit v="prnperssubj"/>
                    </equal>
                </not>
                <equal>
                    <clip pos="5" part="pers"/>
                    <lit-tag v="p3"/>
                </equal>
                <equal>
                    <clip pos="5" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
        </or>
            </test>
            <out> <!--si Ã©s que sÃ­, el rel serÃ  "qui" i no "que"-->
                <b pos="3"/>
                <chunk>
                    <lit v="qui"/>
                    <clip pos="4" part="tags"/>
                    <clip pos="4" part="chcontent"/>
                </chunk>
                <b pos="4"/>
                <chunk>
                    <clip pos="5" part="lem"/>
                    <clip pos="5" part="tags"/>
                    <clip pos="5" part="chcontent"/>
                </chunk>
            </out>
        </when>
        <otherwise><!--si Ã©s que no, el rel serÃ  "que" i caldrÃ  posar subjecte al verb-->
            <out>
                <b pos="3"/>
                <chunk>
                    <clip pos="4" part="lem"/>
                    <clip pos="4" part="tags"/>
                    <clip pos="4" part="chcontent"/>
                </chunk>
                <b pos="4"/>
            </out>
            <call-macro n="posa_subj2">
                <with-param pos="5"/>
            </call-macro>
            <out>
                <chunk>
                    <clip pos="5" part="lem"/>
                    <clip pos="5" part="tags"/>
                    <clip pos="5" part="chcontent"/>
                </chunk>
            </out>
        </otherwise>
    </choose>
</action>
</rule>    

<rule comment="REGLA: SN vbcop adv SN querel SV">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="adv"/>
        <pattern-item n="SN"/>
        <pattern-item n="QUEREL"/>
        <pattern-item n="SV"/>
    </pattern>
    <action>
    <call-macro n="concord_sn">
        <with-param pos="1"/>
        <with-param pos="4"/>
    </call-macro>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <out>
        <chunk>
            <clip pos="1" part="lem"/>
            <clip pos="1" part="tags"/>
            <clip pos="1" part="chcontent"/>
        </chunk>
        <b pos="1"/>
        <chunk>
            <clip pos="2" part="lem"/>
            <clip pos="2" part="tags"/>
            <clip pos="2" part="chcontent"/>
        </chunk>
        <b pos="2"/>
        <chunk>
            <clip pos="3" part="lem"/>
            <clip pos="3" part="tags"/>
            <clip pos="3" part="chcontent"/>
        </chunk>
        <b pos="3"/>
    </out>

    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="4" part="lem"/>
                            <lit v="nom"/>
                        </equal>

                        <equal>
                            <clip pos="4" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="lem"/>
                            <lit v="adj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="lem"/>
                            <lit v="nom_adj"/>
                        </equal>


                    </or>
                    <equal>
                        <clip pos="4" part="nbr"/>
                        <lit-tag v="pl"/>
                    </equal>
                </and>
            </test>
            <out>
                <chunk>
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="4">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="4">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def.mf.pl"/>
                    <lit v="$}"/>
                </chunk>
                <b/>
            </out>
        </when>
    </choose>
    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="4" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="lem"/>
                            <lit v="partadj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="lem"/>
                            <lit v="partnom_adj"/>
                        </equal>
                    </or>
                    <equal>
                        <clip pos="4" part="nbr"/>
                        <lit-tag v="sg"/>
                    </equal>
                </and>
            </test>
            <out>
                <chunk>
                
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="4">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="4">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def"/>
                        <clip pos="3" part="gen"/>
                        <lit-tag v="sg"/>
                    <lit v="$}"/>
                </chunk>
                <b/>
            </out>
        </when>
    </choose>

    <out>
        <chunk>
            <clip pos="4" part="lem"/>
            <clip pos="4" part="tags"/>
            <clip pos="4" part="chcontent"/>
        </chunk>
    </out>
    <choose> <!--mirem si el SN Ã©s el subj de la subordinada-->
        <when>
            <test>
            <or>
            <and>
                <equal caseless="yes">
                    <clip pos="4" part="lem"/>
                    <lit v="prnperssubj"/>
                </equal>
                <equal>
                    <clip pos="6" part="pers"/>
                    <clip pos="4" part="pers"/>
                </equal>
                <equal>
                    <clip pos="6" part="nbr"/>
                    <clip pos="4" part="nbr"/>
                </equal>
            </and>
            <and>
                <not>
                    <equal caseless="yes">
                        <clip pos="4" part="lem"/>
                        <lit v="prnperssubj"/>
                    </equal>
                </not>
                <equal>
                    <clip pos="6" part="pers"/>
                    <lit-tag v="p3"/>
                </equal>
                <equal>
                    <clip pos="6" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
        </or>
            </test>
            <out> <!--si Ã©s que sÃ­, el rel serÃ  "qui" i no "que"-->
                <b pos="4"/>
                <chunk>
                    <lit v="qui"/>
                    <clip pos="5" part="tags"/>
                    <clip pos="5" part="chcontent"/>
                </chunk>
                <b pos="5"/>
                <chunk>
                    <clip pos="6" part="lem"/>
                    <clip pos="6" part="tags"/>
                    <clip pos="6" part="chcontent"/>
                </chunk>
            </out>
        </when>
        <otherwise><!--si Ã©s que no, el rel serÃ  "que" i caldrÃ  posar subjecte al verb-->
            <out>
                <b pos="4"/>
                <chunk>
                    <clip pos="5" part="lem"/>
                    <clip pos="5" part="tags"/>
                    <clip pos="5" part="chcontent"/>
                </chunk>
                <b pos="5"/>
            </out>
            <call-macro n="posa_subj2">
                <with-param pos="6"/>
            </call-macro>
            <out>
                <chunk>
                    <clip pos="6" part="lem"/>
                    <clip pos="6" part="tags"/>
                    <clip pos="6" part="chcontent"/>
                </chunk>
            </out>
        </otherwise>
    </choose>
</action>
</rule>    
    
<rule comment="REGLA: SN sprep vbcop SA">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="pr"/>
        <pattern-item n="SN"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="SA"/>
    </pattern>
    <action>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="3"/>
    </call-macro>
    <choose>
        <when>
            <test>
            <or>
            <and>
                <equal caseless="yes">
                    <clip pos="1" part="lem"/>
                    <lit v="prnperssubj"/>
                </equal>
                <equal>
                    <clip pos="4" part="pers"/>
                    <clip pos="1" part="pers"/>
                </equal>
                <equal>
                    <clip pos="4" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
            <and>
                <not>
                    <equal caseless="yes">
                        <clip pos="1" part="lem"/>
                        <lit v="prnperssubj"/>
                    </equal>
                </not>
                <equal>
                    <clip pos="4" part="pers"/>
                    <lit-tag v="p3"/>
                </equal>
                <equal>
                    <clip pos="4" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
        </or>
            </test>
            <out>
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
                <chunk>
                    <clip pos="4" part="lem"/>
                    <clip pos="4" part="tags"/>
                    <clip pos="4" part="chcontent"/>
                </chunk>
            </out>
        </when>
        <otherwise>
            <out>
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
            </out>
            <call-macro n="posa_subj2">
                <with-param pos="4"/>
            </call-macro>
            <out>
                <chunk>
                    <clip pos="4" part="lem"/>
                    <clip pos="4" part="tags"/>
                    <clip pos="4" part="chcontent"/>
                </chunk>
            </out>
        </otherwise>
    </choose>    
    <call-macro n="concord_sa">
        <with-param pos="1"/>
        <with-param pos="5"/>
    </call-macro>
    <out>
        <b pos="4"/>
            <chunk>
                <clip pos="5" part="lem"/>
                <clip pos="5" part="tags"/>
                <clip pos="5" part="chcontent"/>
            </chunk>
    </out>
</action>
</rule> 

<rule comment="REGLA: SN sprep vbcop adv SA">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="pr"/>
        <pattern-item n="SN"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="adv"/>
        <pattern-item n="SA"/>
    </pattern>
    <action>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="3"/>
    </call-macro>
    <choose>
        <when>
            <test>
            <or>
            <and>
                <equal caseless="yes">
                    <clip pos="1" part="lem"/>
                    <lit v="prnperssubj"/>
                </equal>
                <equal>
                    <clip pos="4" part="pers"/>
                    <clip pos="1" part="pers"/>
                </equal>
                <equal>
                    <clip pos="4" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
            <and>
                <not>
                    <equal caseless="yes">
                        <clip pos="1" part="lem"/>
                        <lit v="prnperssubj"/>
                    </equal>
                </not>
                <equal>
                    <clip pos="4" part="pers"/>
                    <lit-tag v="p3"/>
                </equal>
                <equal>
                    <clip pos="4" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
        </or>
            </test>
            <out>
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
                <chunk>
                    <clip pos="4" part="lem"/>
                    <clip pos="4" part="tags"/>
                    <clip pos="4" part="chcontent"/>
                </chunk>
            </out>
        </when>
        <otherwise>
            <out>
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
            </out>
            <call-macro n="posa_subj2">
                <with-param pos="4"/>
            </call-macro>
            <out>
                <chunk>
                    <clip pos="4" part="lem"/>
                    <clip pos="4" part="tags"/>
                    <clip pos="4" part="chcontent"/>
                </chunk>
            </out>
        </otherwise>
    </choose>    
    <call-macro n="concord_sa">
        <with-param pos="1"/>
        <with-param pos="6"/>
    </call-macro>
    <out>
        <b pos="4"/>
        <chunk>
            <clip pos="5" part="lem"/>
            <clip pos="5" part="tags"/>
            <clip pos="5" part="chcontent"/>
        </chunk>
        <b pos="5"/>
        <chunk>
            <clip pos="6" part="lem"/>
            <clip pos="6" part="tags"/>
            <clip pos="6" part="chcontent"/>
        </chunk>
    </out>
</action>
</rule> 

<rule comment="REGLA: SN sprep vbcop SN">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="pr"/>
        <pattern-item n="SN"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="SN"/>
    </pattern>
    <action>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="3"/>
    </call-macro>
    <choose>
        <when>
            <test>
                <or>
                    <and>
                        <equal caseless="yes">
                            <clip pos="1" part="lem"/>
                            <lit v="prnperssubj"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="pers"/>
                            <clip pos="1" part="pers"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="nbr"/>
                            <clip pos="1" part="nbr"/>
                        </equal>
                    </and>
                    <and>
                        <not>
                            <equal caseless="yes">
                                <clip pos="1" part="lem"/>
                                <lit v="prnperssubj"/>
                            </equal>
                        </not>
                        <equal>
                            <clip pos="4" part="pers"/>
                            <lit-tag v="p3"/>
                        </equal>
                        <equal>
                            <clip pos="4" part="nbr"/>
                            <clip pos="1" part="nbr"/>
                        </equal>
                    </and>
                </or>
            </test>
            <out>
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
                <chunk>
                    <clip pos="4" part="lem"/>
                    <clip pos="4" part="tags"/>
                    <clip pos="4" part="chcontent"/>
                </chunk>
            </out>
        </when>
        <otherwise>
            <out>
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
            </out>
            <call-macro n="posa_subj2">
                <with-param pos="4"/>
            </call-macro>
            <out>
                <chunk>
                    <clip pos="4" part="lem"/>
                    <clip pos="4" part="tags"/>
                    <clip pos="4" part="chcontent"/>
                </chunk>
            </out>
        </otherwise>
    </choose>    
    <call-macro n="concord_sn">
        <with-param pos="1"/>
        <with-param pos="5"/>
    </call-macro>
    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="nom"/>
                        </equal>

                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="adj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="nom_adj"/>
                        </equal>


                    </or>
                    <equal>
                        <clip pos="5" part="nbr"/>
                        <lit-tag v="pl"/>
                    </equal>
                </and>
            </test>
            <out>
                <b/>
                <chunk>
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="5">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="5">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def.mf.pl"/>
                    <lit v="$}"/>
                </chunk>
                
            </out>
        </when>
    </choose>
    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="partadj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="partnom_adj"/>
                        </equal>
                    </or>
                    <equal>
                        <clip pos="5" part="nbr"/>
                        <lit-tag v="sg"/>
                    </equal>
                </and>
            </test>
            <out>
                <b/>
                <chunk>
                
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="5">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="5">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def"/>
                        <clip pos="5" part="gen"/>
                        <lit-tag v="sg"/>
                    <lit v="$}"/>
                </chunk>
            </out>
        </when>
    </choose>

    <out>
        <b pos="4"/>
        <chunk>
            <clip pos="5" part="lem"/>
            <clip pos="5" part="tags"/>
            <clip pos="5" part="chcontent"/>
        </chunk>
    </out>
</action>
</rule> 

<rule comment="REGLA: SN sprep vbcop SN querel SV">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="pr"/>
        <pattern-item n="SN"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="SN"/>
        <pattern-item n="QUEREL"/>
        <pattern-item n="SV"/>
    </pattern>
    <action>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="3"/>
    </call-macro>
    <choose>
        <when>
            <test>
            <or>
            <and>
                <equal caseless="yes">
                    <clip pos="1" part="lem"/>
                    <lit v="prnperssubj"/>
                </equal>
                <equal>
                    <clip pos="4" part="pers"/>
                    <clip pos="1" part="pers"/>
                </equal>
                <equal>
                    <clip pos="4" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
            <and>
                <not>
                    <equal caseless="yes">
                        <clip pos="1" part="lem"/>
                        <lit v="prnperssubj"/>
                    </equal>
                </not>
                <equal>
                    <clip pos="4" part="pers"/>
                    <lit-tag v="p3"/>
                </equal>
                <equal>
                    <clip pos="4" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
        </or>
            </test>
            <out>
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
                <chunk>
                    <clip pos="4" part="lem"/>
                    <clip pos="4" part="tags"/>
                    <clip pos="4" part="chcontent"/>
                </chunk>
            </out>
        </when>
        <otherwise>
            <out>
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
            </out>
            <call-macro n="posa_subj2">
                <with-param pos="4"/>
            </call-macro>
            <out>
                <chunk>
                    <clip pos="4" part="lem"/>
                    <clip pos="4" part="tags"/>
                    <clip pos="4" part="chcontent"/>
                </chunk>
            </out>
        </otherwise>
    </choose>    
    <call-macro n="concord_sn">
        <with-param pos="1"/>
        <with-param pos="5"/>
    </call-macro>
    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="nom"/>
                        </equal>

                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="adj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="nom_adj"/>
                        </equal>


                    </or>
                    <equal>
                        <clip pos="5" part="nbr"/>
                        <lit-tag v="pl"/>
                    </equal>
                </and>
            </test>
            <out>
                <b/>
                <chunk>
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="5">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="5">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def.mf.pl"/>
                    <lit v="$}"/>
                </chunk>
            </out>
        </when>
    </choose>
    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="partadj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="5" part="lem"/>
                            <lit v="partnom_adj"/>
                        </equal>
                    </or>
                    <equal>
                        <clip pos="5" part="nbr"/>
                        <lit-tag v="sg"/>
                    </equal>
                </and>
            </test>
            <out>
                <b/>
                <chunk>
                
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="5">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="5">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def"/>
                        <clip pos="5" part="gen"/>
                        <lit-tag v="sg"/>
                    <lit v="$}"/>
                </chunk>
            </out>
        </when>
    </choose>
    <out>
        <b pos="4"/>
        <chunk>
            <clip pos="5" part="lem"/>
            <clip pos="5" part="tags"/>
            <clip pos="5" part="chcontent"/>
        </chunk>
    </out>
    <choose> <!--mirem si el SN Ã©s el subj de la subordinada-->
        <when>
            <test>
            <or>
            <and>
                <equal caseless="yes">
                    <clip pos="5" part="lem"/>
                    <lit v="prnperssubj"/>
                </equal>
                <equal>
                    <clip pos="7" part="pers"/>
                    <clip pos="5" part="pers"/>
                </equal>
                <equal>
                    <clip pos="7" part="nbr"/>
                    <clip pos="5" part="nbr"/>
                </equal>
            </and>
            <and>
                <not>
                    <equal caseless="yes">
                        <clip pos="5" part="lem"/>
                        <lit v="prnperssubj"/>
                    </equal>
                </not>
                <equal>
                    <clip pos="7" part="pers"/>
                    <lit-tag v="p3"/>
                </equal>
                <equal>
                    <clip pos="7" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
        </or>
            </test>
            <out> <!--si Ã©s que sÃ­, el rel serÃ  "qui" i no "que"-->
                <b pos="5"/>
                <chunk>
                    <lit v="qui"/>
                    <clip pos="6" part="tags"/>
                    <clip pos="6" part="chcontent"/>
                </chunk>
                <b pos="6"/>
                <chunk>
                    <clip pos="7" part="lem"/>
                    <clip pos="7" part="tags"/>
                    <clip pos="7" part="chcontent"/>
                </chunk>
            </out>
        </when>
        <otherwise><!--si Ã©s que no, el rel serÃ  "que" i caldrÃ  posar subjecte al verb-->
            <out>
                <b pos="5"/>
                <chunk>
                    <clip pos="6" part="lem"/>
                    <clip pos="6" part="tags"/>
                    <clip pos="6" part="chcontent"/>
                </chunk>
                <b pos="6"/>
            </out>
            <call-macro n="posa_subj2">
                <with-param pos="7"/>
            </call-macro>
            <out>
                <chunk>
                    <clip pos="7" part="lem"/>
                    <clip pos="7" part="tags"/>
                    <clip pos="7" part="chcontent"/>
                </chunk>
            </out>
        </otherwise>
    </choose>
</action>
</rule> 

<rule comment="REGLA: SN sprep vbcop adv SN">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="pr"/>
        <pattern-item n="SN"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="adv"/>
        <pattern-item n="SN"/>
    </pattern>
    <action>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="3"/>
    </call-macro>
    <choose>
        <when>
            <test>
            <or>
            <and>
                <equal caseless="yes">
                    <clip pos="1" part="lem"/>
                    <lit v="prnperssubj"/>
                </equal>
                <equal>
                    <clip pos="4" part="pers"/>
                    <clip pos="1" part="pers"/>
                </equal>
                <equal>
                    <clip pos="4" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
            <and>
                <not>
                    <equal caseless="yes">
                        <clip pos="1" part="lem"/>
                        <lit v="prnperssubj"/>
                    </equal>
                </not>
                <equal>
                    <clip pos="4" part="pers"/>
                    <lit-tag v="p3"/>
                </equal>
                <equal>
                    <clip pos="4" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
        </or>
            </test>
            <out>
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
                <chunk>
                    <clip pos="4" part="lem"/>
                    <clip pos="4" part="tags"/>
                    <clip pos="4" part="chcontent"/>
                </chunk>
            </out>
        </when>
        <otherwise>
            <out>
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
            </out>
            <call-macro n="posa_subj2">
                <with-param pos="4"/>
            </call-macro>
            <out>
                <chunk>
                    <clip pos="4" part="lem"/>
                    <clip pos="4" part="tags"/>
                    <clip pos="4" part="chcontent"/>
                </chunk>
            </out>
        </otherwise>
    </choose>    
    <call-macro n="concord_sn">
        <with-param pos="1"/>
        <with-param pos="6"/>
    </call-macro>
    <out>
        <b pos="4"/>
            <chunk>
                <clip pos="5" part="lem"/>
                <clip pos="5" part="tags"/>
                <clip pos="5" part="chcontent"/>
            </chunk>
        <b pos="5"/>
    </out>
    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="6" part="lem"/>
                            <lit v="nom"/>
                        </equal>

                        <equal>
                            <clip pos="6" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="6" part="lem"/>
                            <lit v="adj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="6" part="lem"/>
                            <lit v="nom_adj"/>
                        </equal>

                    </or>
                    <equal>
                        <clip pos="6" part="nbr"/>
                        <lit-tag v="pl"/>
                    </equal>
                </and>
            </test>
            <out>
                <chunk>
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="6">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="6">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def.mf.pl"/>
                    <lit v="$}"/>
                </chunk>
                <b/>
            </out>
        </when>
    </choose>
    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="6" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="6" part="lem"/>
                            <lit v="partadj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="6" part="lem"/>
                            <lit v="partnom_adj"/>
                        </equal>
                    </or>
                    <equal>
                        <clip pos="6" part="nbr"/>
                        <lit-tag v="sg"/>
                    </equal>
                </and>
            </test>
            <out>
                <chunk>
                
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="6">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="6">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def"/>
                        <clip pos="6" part="gen"/>
                        <lit-tag v="sg"/>
                    <lit v="$}"/>
                </chunk>
                <b/>
            </out>
        </when>
    </choose>
    <out>
        <chunk>
            <clip pos="6" part="lem"/>
            <clip pos="6" part="tags"/>
            <clip pos="6" part="chcontent"/>
        </chunk>
    </out>
</action>
</rule> 


<rule comment="REGLA: SN sprep vbcop adv SN querel SV">
    <pattern>
        <pattern-item n="SN"/>
        <pattern-item n="pr"/>
        <pattern-item n="SN"/>
        <pattern-item n="vbcop"/>
        <pattern-item n="adv"/>
        <pattern-item n="SN"/>
        <pattern-item n="QUEREL"/>
        <pattern-item n="SV"/>
    </pattern>
    <action>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="1"/>
    </call-macro>
    <call-macro n="assigna_gen_nbr">
        <with-param pos="3"/>
    </call-macro>
    <choose>
        <when>
            <test>
            <or>
            <and>
                <equal caseless="yes">
                    <clip pos="1" part="lem"/>
                    <lit v="prnperssubj"/>
                </equal>
                <equal>
                    <clip pos="4" part="pers"/>
                    <clip pos="1" part="pers"/>
                </equal>
                <equal>
                    <clip pos="4" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
            <and>
                <not>
                    <equal caseless="yes">
                        <clip pos="1" part="lem"/>
                        <lit v="prnperssubj"/>
                    </equal>
                </not>
                <equal>
                    <clip pos="4" part="pers"/>
                    <lit-tag v="p3"/>
                </equal>
                <equal>
                    <clip pos="4" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
        </or>
            </test>
            <out>
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
                <chunk>
                    <clip pos="4" part="lem"/>
                    <clip pos="4" part="tags"/>
                    <clip pos="4" part="chcontent"/>
                </chunk>
            </out>
        </when>
        <otherwise>
            <out>
                <chunk>
                    <clip pos="1" part="lem"/>
                    <clip pos="1" part="tags"/>
                    <clip pos="1" part="chcontent"/>
                </chunk>
                <b pos="1"/>
                <chunk>
                    <clip pos="2" part="lem"/>
                    <clip pos="2" part="tags"/>
                    <clip pos="2" part="chcontent"/>
                </chunk>
                <b pos="2"/>
                <chunk>
                    <clip pos="3" part="lem"/>
                    <clip pos="3" part="tags"/>
                    <clip pos="3" part="chcontent"/>
                </chunk>
                <b pos="3"/>
            </out>
            <call-macro n="posa_subj2">
                <with-param pos="4"/>
            </call-macro>
            <out>
                <chunk>
                    <clip pos="4" part="lem"/>
                    <clip pos="4" part="tags"/>
                    <clip pos="4" part="chcontent"/>
                </chunk>
            </out>
        </otherwise>
    </choose>    
    <call-macro n="concord_sn">
        <with-param pos="1"/>
        <with-param pos="6"/>
    </call-macro>
    <out>
        <b pos="4"/>
            <chunk>
                <clip pos="5" part="lem"/>
                <clip pos="5" part="tags"/>
                <clip pos="5" part="chcontent"/>
            </chunk>
        <b pos="5"/>
    </out>
    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="6" part="lem"/>
                            <lit v="nom"/>
                        </equal>

                        <equal>
                            <clip pos="6" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="6" part="lem"/>
                            <lit v="adj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="6" part="lem"/>
                            <lit v="nom_adj"/>
                        </equal>


                    </or>
                    <equal>
                        <clip pos="6" part="nbr"/>
                        <lit-tag v="pl"/>
                    </equal>
                </and>
            </test>
            <out>
                <chunk>
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="6">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="6">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def.mf.pl"/>
                    <lit v="$}"/>
                </chunk>
                <b/>
            </out>
        </when>
    </choose>
    <choose>
        <when>
            <test>
                <and>
                    <or>
                        <equal>
                            <clip pos="6" part="lem"/>
                            <lit v="part"/>
                        </equal>
                        <equal>
                            <clip pos="6" part="lem"/>
                            <lit v="partadj_nom"/>
                        </equal>
                        <equal>
                            <clip pos="6" part="lem"/>
                            <lit v="partnom_adj"/>
                        </equal>
                    </or>
                    <equal>
                        <clip pos="6" part="nbr"/>
                        <lit-tag v="sg"/>
                    </equal>
                </and>
            </test>
            <out>
                <chunk>
                
                    <lit v="partitiu"/>
                        <lit-tag v="part"/>
                        <lit v="{^"/>
                        <get-case-from pos="6">
                            <lit v="de"/>
                        </get-case-from>
                        <lit-tag v="pr"/>
                        <lit v="$ ^"/>
                        <get-case-from pos="6">
                            <lit v="le"/>
                        </get-case-from>
                        <lit-tag v="det.def"/>
                        <clip pos="6" part="gen"/>
                        <lit-tag v="sg"/>
                    <lit v="$}"/>
                </chunk>
                <b/>
            </out>
        </when>
    </choose>
    <out>
            <chunk>
                <clip pos="6" part="lem"/>
                <clip pos="6" part="tags"/>
                <clip pos="6" part="chcontent"/>
            </chunk>
    </out>
    <choose> <!--mirem si el SN Ã©s el subj de la subordinada-->
        <when>
            <test>
            <or>
            <and>
                <equal caseless="yes">
                    <clip pos="6" part="lem"/>
                    <lit v="prnperssubj"/>
                </equal>
                <equal>
                    <clip pos="8" part="pers"/>
                    <clip pos="6" part="pers"/>
                </equal>
                <equal>
                    <clip pos="8" part="nbr"/>
                    <clip pos="6" part="nbr"/>
                </equal>
            </and>
            <and>
                <not>
                    <equal caseless="yes">
                        <clip pos="6" part="lem"/>
                        <lit v="prnperssubj"/>
                    </equal>
                </not>
                <equal>
                    <clip pos="8" part="pers"/>
                    <lit-tag v="p3"/>
                </equal>
                <equal>
                    <clip pos="8" part="nbr"/>
                    <clip pos="1" part="nbr"/>
                </equal>
            </and>
        </or>
            </test>
            <out> <!--si Ã©s que sÃ­, el rel serÃ  "qui" i no "que"-->
                <b pos="6"/>
                <chunk>
                    <lit v="qui"/>
                    <clip pos="7" part="tags"/>
                    <clip pos="7" part="chcontent"/>
                </chunk>
                <b pos="7"/>
                <chunk>
                    <clip pos="8" part="lem"/>
                    <clip pos="8" part="tags"/>
                    <clip pos="8" part="chcontent"/>
                </chunk>
            </out>
        </when>
        <otherwise><!--si Ã©s que no, el rel serÃ  "que" i caldrÃ  posar subjecte al verb-->
            <out>
                <b pos="6"/>
                <chunk>
                    <clip pos="7" part="lem"/>
                    <clip pos="7" part="tags"/>
                    <clip pos="7" part="chcontent"/>
                </chunk>
                <b pos="7"/>
            </out>
            <call-macro n="posa_subj2">
                <with-param pos="8"/>
            </call-macro>
            <out>
                <chunk>
                    <clip pos="8" part="lem"/>
                    <clip pos="8" part="tags"/>
                    <clip pos="8" part="chcontent"/>
                </chunk>
            </out>
        </otherwise>
    </choose>
</action>
</rule> 



 <rule comment="REGLA: reset variables">
      <pattern>
    <pattern-item n="punt"/>
      </pattern>
      <action>
    <let>
      <var n="nombre"/>
      <lit-tag v="sg"/>
    </let>
    <let>
          <var n="nombre_subj"/>
      <lit v="no_assignat"/>
    </let> 
    <let>
          <var n="pers_subj"/>
      <lit-tag v="p3"/>
    </let>
    <let>
        <var n="subj_vist"/>
                <lit v="no"/>
    </let>
    <out>
      <chunk>
        <clip pos="1" part="whole"/>
      </chunk>
    </out>
      </action>
</rule>

 <rule>
      <pattern>
    <pattern-item n="VPART"/>
      </pattern>
      <action>
    <out>
          <b/>
    </out>
      </action>
</rule>


 <rule comment="regla: V_en_train SA SV">
      <pattern>
    <pattern-item n="V_en_train"/>
    <pattern-item n="SA"/>
    <pattern-item n="SV"/>
      </pattern>
      <action>
<!--
      <let>
        <clip pos="1" part="nbr"/>
        <clip pos="2" part="nbr"/>
      </let>
-->

        <call-macro n="posa_subj">
            <with-param pos="2"/>
        </call-macro>
            <out>
              <chunk>
              <get-case-from pos="3">
                <clip pos="3" part="whole"/>
              </get-case-from>
              </chunk>
              <b pos="1"/>
              <chunk>
              <get-case-from pos="3">
                <clip pos="1" part="whole"/>
              </get-case-from>
              </chunk>
              <b pos="2"/>
              <chunk>
                <clip pos="2" part="whole"/>
              </chunk>
            </out>

        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>

      </action>
</rule>


 <rule>
      <pattern>
    <pattern-item n="V_en_train"/>
    <pattern-item n="VPART"/>
    <pattern-item n="SV"/>
      </pattern>
      <action>

      <call-macro n="particle_concord2">
                        <with-param pos="2"/>
                        <with-param pos="3"/>
      </call-macro>

                <call-macro n="posa_subj">
                        <with-param pos="3"/>
                </call-macro>

            <out>
              <chunk>
<!--
              <get-case-from pos="1">
              </get-case-from>
-->
                <clip pos="3" part="whole"/>
              </chunk>
              <b pos="1"/>
              <chunk>
              <get-case-from pos="3">
                <clip pos="1" part="lem"/>
              </get-case-from>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
              </chunk>
            </out>

        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>

      </action>
</rule>






 <rule comment="REGLA: SV SN V_en_train">
      <pattern>
    <pattern-item n="SV"/>
    <pattern-item n="SN"/>
    <pattern-item n="V_en_train"/>
      </pattern>
      <action>
      <let>
        <clip pos="1" part="nbr"/>
        <clip pos="2" part="nbr"/>
      </let>
            <out>
              <chunk>
              <get-case-from pos="1">
                <clip pos="2" part="lem"/>
              </get-case-from>
                <clip pos="2" part="tags"/>
                <clip pos="2" part="chcontent"/>
<!--
              <get-case-from pos="1">
              </get-case-from>
                <clip pos="2" part="whole"/>
-->
              </chunk>
              <b pos="1"/>
              <chunk>
              <get-case-from pos="2">
                <clip pos="1" part="lem"/>
              </get-case-from>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
              </chunk>
              <b pos="2"/>
              <chunk>
                <clip pos="3" part="whole"/>
              </chunk>
            </out>

        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>

      </action>
</rule>




 <rule comment="REGLA: cnjcoo VPART SV">
      <pattern>
    <pattern-item n="cnjcoo"/>
    <pattern-item n="VPART"/>
    <pattern-item n="SV"/>
      </pattern>
      <action>
    <let>
        <var n="nombre_subj"/>
        <lit v="no_assignat"/>
    </let>
    <let>
        <var n="pers_subj"/>
        <lit-tag v="p3"/>
    </let>

        <let>
          <var n="subj_vist"/>
          <lit v="no"/>
        </let>
      <call-macro n="particle_concord2">
          <with-param pos="2"/>
          <with-param pos="3"/>
      </call-macro>
    <out>
      <chunk>
        <clip pos="1" part="whole"/>
      </chunk>
      <b pos="1"/>
        </out>
        <choose>
          <when>
            <test>
                <equal>
                  <clip pos="3" part="pers"/>
                  <lit-tag v="impers"/>
                </equal>
            </test>
            <out>
              <chunk>
                <lit v="que"/>
                <lit-tag v="CS"/>
                <lit v="{^que"/>
                <lit-tag v="cnjsub"/>
                <lit v="$}"/>
              </chunk>
              <b/>
            </out> 
            <call-macro n="posa_subj">
              <with-param pos="3"/>
            </call-macro>
          </when>
          <otherwise>
        <call-macro n="posa_subj">
          <with-param pos="3"/>
        </call-macro>
          </otherwise>
        </choose> 
    <out>
      <chunk>
        <clip pos="3" part="whole"/>
      </chunk>
    </out>
        <let>
          <var n="subj_vist"/>
          <lit v="yes"/>
        </let>
      </action>
    </rule>

    <rule comment="REGLA: VPART SV">
      <pattern>
    <pattern-item n="VPART"/>
    <pattern-item n="SV"/>
      </pattern>
      <action>
      <call-macro n="particle_concord2">
            <with-param pos="1"/>
            <with-param pos="2"/>
      </call-macro>
      <call-macro n="posa_subj">
                        <with-param pos="2"/>
      </call-macro>
        <choose>
          <when>
            <test>
              <equal caseless="yes">
                <clip pos="1" part="lem"/>
                <lit v="ne"/>
              </equal>
            </test>
            <out>
              <chunk>
              <lit v="adv{^ne"/>
              <lit-tag v="adv"/>
              <lit v="$}"/>
              </chunk>
              <b pos="1"/> 
              <chunk>
                <clip pos="2" part="whole"/>
              </chunk>
            </out>
          </when>
          <otherwise>
            <out>
              <chunk>
                <clip pos="2" part="whole"/>
              </chunk>
            </out>
          </otherwise>
        </choose>
        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>

      </action>
</rule>


 <rule comment="REGLA: SN VPART SV">
      <pattern>
    <pattern-item n="SN"/>
    <pattern-item n="VPART"/>
    <pattern-item n="SV"/>
      </pattern>
      <action>
<!--
        <call-macro n="concord_prnsubj_verb2"> 
          <with-param pos="1"/>
          <with-param pos="3"/>
        </call-macro>
-->
      <call-macro n="particle_concord2">
          <with-param pos="2"/>
          <with-param pos="3"/>
      </call-macro>
      <call-macro n="f_concord1"> <!-- This should not be necessary "ar serc’hed en em starde" -->
        <with-param pos="1"/>
      </call-macro>
    <out>
      <chunk>
        <clip pos="1" part="whole"/>
      </chunk>
      <b pos="1"/>
        </out>
        <choose>
          <when>
            <test>
              <and>
                <equal>
                  <clip pos="2" part="constituent"/>
                  <lit-tag v="subj"/>  
                </equal>
                <not>
                  <equal>
                    <clip pos="3" part="pers"/>
                    <lit-tag v="impers"/>
                  </equal>
                </not>
              </and>
            </test> 
            <let>
              <clip pos="3" part="nbr"/>
              <clip pos="1" part="nbr"/>
            </let>
          </when>
          <when>
            <test>
                <equal>
                  <clip pos="3" part="pers"/>
                  <lit-tag v="impers"/>
                </equal>
            </test>
            <out>
              <chunk>
                <lit v="que"/>
                <lit-tag v="CS"/>
                <lit v="{^que"/>
                <lit-tag v="cnjsub"/>
                <lit v="$}"/>
              </chunk>
              <b/>
            </out> 
            <call-macro n="posa_subj">
              <with-param pos="3"/>
            </call-macro>
          </when>
          <otherwise>
        <call-macro n="posa_subj">
          <with-param pos="3"/>
        </call-macro>
          </otherwise>
        </choose> 
    <out>
      <chunk>
        <clip pos="3" part="whole"/>
      </chunk>
    </out>
        <let>
          <var n="subj_vist"/>
          <lit v="yes"/>
        </let>
      </action>
    </rule>

    <rule comment="REGLA: falloir INF">
      <pattern>
    <pattern-item n="V_falloir"/>
    <pattern-item n="INF"/>
      </pattern>
      <action>
       <modify-case>
     <clip pos="2" part="lem"/>
     <lit v="aa"/>
  </modify-case>
 
            <out>
              <chunk>
                <clip pos="1" part="whole"/>
              </chunk>
              <b pos="1"/>
              <chunk>
                <clip pos="2" part="lem"/>
                <clip pos="2" part="tags"/>
                <clip pos="2" part="chcontent"/>
              </chunk>
            </out>

        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>

      </action>
</rule>


 <rule comment="REGLA: V_que SV SN">
      <pattern>
    <pattern-item n="V_que"/>
    <pattern-item n="SV"/>
    <pattern-item n="SN"/>
      </pattern>
      <action>
        <let>
          <clip pos="2" part="temps"/>
          <lit-tag v="prs"/>
        </let>
            <out>
              <chunk>
                <clip pos="1" part="whole"/>
              </chunk>
              <b pos="1"/>
              <chunk>
              <get-case-from pos="1">
                <clip pos="2" part="lem"/>
              </get-case-from>
                <clip pos="2" part="tags"/>
                <clip pos="2" part="chcontent"/>
              </chunk>
              <b pos="2"/>
              <chunk>
              <get-case-from pos="3">
                <clip pos="3" part="lem"/>
              </get-case-from>
                <clip pos="3" part="tags"/>
                <clip pos="3" part="chcontent"/>
              </chunk>
            </out>

        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>

      </action>
</rule>



 <rule comment="SV ANT PREP_à INF">
      <pattern>
    <pattern-item n="SV"/>
    <pattern-item n="ANT"/>
    <pattern-item n="PREP_à"/>
    <pattern-item n="INF"/>
      </pattern>
      <action>
            <out>
              <chunk>
                <clip pos="2" part="whole"/>
              </chunk>
              <b pos="1"/>
              <chunk>
                <get-case-from pos="4">
                <clip pos="1" part="lem"/>
                </get-case-from>
                <clip pos="1" part="tags"/>
                <clip pos="1" part="chcontent"/>
              </chunk>
              <b pos="2"/>
              <chunk>
                <clip pos="4" part="lem"/>
                <clip pos="4" part="tags"/>
                <clip pos="4" part="chcontent"/>
              </chunk>
            </out>

        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>

      </action>
</rule>


 <rule comment="V_que INF SN">
      <pattern>
    <pattern-item n="V_que"/>
    <pattern-item n="INF"/>
    <pattern-item n="SN"/>
      </pattern>
      <action>
        <call-macro n="verb_prs_from_prn_inf">
          <with-param pos="3"/>
          <with-param pos="2"/>
        </call-macro>
            <out>
              <chunk>
                <clip pos="1" part="whole"/>
              </chunk>
              <b pos="1"/>
              <chunk>
                <var n="verb_prs"/>
              </chunk>
              <b pos="2"/>
              <chunk>
                <clip pos="3" part="lem"/>
                <clip pos="3" part="tags"/>
                <clip pos="3" part="chcontent"/>
              </chunk>
            </out>

        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>

      </action>
</rule>


 <rule comment="regla: V_que SN INF">
      <pattern>
    <pattern-item n="V_que"/>
    <pattern-item n="SN"/>
    <pattern-item n="INF"/>
      </pattern>
      <action>
        <call-macro n="verb_prs_from_prn_inf">
          <with-param pos="2"/>
          <with-param pos="3"/>
        </call-macro>
            <out>
              <chunk>
                <clip pos="1" part="whole"/>
              </chunk>
              <b pos="1"/>
              <chunk>
                <get-case-from pos="3">
                  <clip pos="2" part="lem"/>
                </get-case-from>
                <clip pos="2" part="tags"/>
                <clip pos="2" part="chcontent"/>
              </chunk>
              <b pos="2"/>
              <chunk>
                <var n="verb_prs"/>
              </chunk>
            </out>

        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>

      </action>
</rule>



 <rule comment="regla: 'être temps que' SN INF">
      <pattern>
    <pattern-item n="V_être_temps_que"/>
    <pattern-item n="SN"/>
    <pattern-item n="INF"/>
      </pattern>
      <action>
        <call-macro n="verb_prs_from_prn_inf">
          <with-param pos="2"/>
          <with-param pos="3"/>
        </call-macro>
            <out>
              <chunk>
                <clip pos="1" part="whole"/>
              </chunk>
              <b pos="1"/>
              <chunk>
                <clip pos="2" part="whole"/>
              </chunk>
              <b pos="2"/>
              <chunk>
                <var n="verb_prs"/>
              </chunk>
            </out>

        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>

      </action>
</rule>

 <rule comment="regla: 'être temps de' inf">
      <pattern>
    <pattern-item n="V_être_temps_de"/>
    <pattern-item n="INF"/>
      </pattern>
      <action>
  <modify-case>
     <clip pos="2" part="lem"/>
     <lit v="aa"/>
  </modify-case>
            <out>
              <chunk>
                <clip pos="1" part="whole"/>
              </chunk>
              <b pos="1"/>
              <chunk>
                <clip pos="2" part="lem"/>
                <clip pos="2" part="tags"/>
                <clip pos="2" part="chcontent"/>
              </chunk>
            </out>

        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>

      </action>
</rule>

 <rule comment="REGLA: SV ADV">
      <pattern>
    <pattern-item n="SV"/>
    <pattern-item n="adv"/>
      </pattern>
      <action>
  <modify-case>
     <clip pos="2" part="lem"/>
     <lit v="aa"/>
  </modify-case>
                <call-macro n="posa_subj">
                        <with-param pos="1"/>
                </call-macro>
    <call-macro n="convert_tense">
      <with-param pos="1"/>
    </call-macro>

 
            <out>
              <chunk>
                <clip pos="1" part="whole"/>
              </chunk>
              <b pos="1"/>
              <chunk>
                <clip pos="2" part="lem"/>
                <clip pos="2" part="tags"/>
                <clip pos="2" part="chcontent"/>
              </chunk>
            </out>

        <let>
                <var n="subj_vist"/>
                <lit v="yes"/>
        </let>


      </action>
</rule>



 <rule comment="regla: num pr SN">
      <pattern>
    <pattern-item n="NUM"/>
    <pattern-item n="pr"/>
    <pattern-item n="SN"/>
      </pattern>
      <action>
      <let>
        <clip pos="1" part="gen"/>
        <clip pos="3" part="gen"/>
      </let>
            <out>
              <chunk>
                <clip pos="1" part="whole"/>
              </chunk>
              <b pos="1"/>
              <chunk>
                <clip pos="2" part="whole"/>
              </chunk>
              <b pos="2"/>
              <chunk>
                <clip pos="3" part="whole"/>
              </chunk>
            </out>

      </action>
</rule>




  </section-rules>
</interchunk>

<!-- 
<out><chunk><lit v="@@@"/></chunk></out>
-->
