<?xml version="1.0" encoding="utf-8"?>

<transfer default="chunk">


  <section-def-cats>
	<def-cat n="prn_personal"> 					<!--personal pronoun-->
	  <cat-item tags="prn.pers.*"/>
	</def-cat>
	<def-cat n="prn_possessive"> 					<!--possessive pronoun-->
	  <cat-item tags="prn.pos.*"/>
	  <cat-item tags="prn.pos"/>
	</def-cat>
	<def-cat n="prn_demonstrative"> 					<!--demonstrative pronoun-->
	  <cat-item tags="prn.dem.*"/>
	</def-cat>
	<def-cat n="prn_quantitative"> 					<!--quantitative pronoun-->
	  <cat-item tags="prn.qnt.*"/>
	</def-cat>
	<def-cat n="prn_interrogative"> 					<!--interrogative pronoun-->
	  <cat-item tags="prn.itg.*"/>
	</def-cat>
	<def-cat n="prn_indefinite"> 					<!--indefinite pronoun-->
	  <cat-item tags="prn.ind.*"/>
	</def-cat>
    <def-cat n="nom"> 					<!--noun-->
      <cat-item tags="n.*"/>
      <cat-item tags="np.*"/>
    </def-cat>
    <def-cat n="nom_ind"> 					<!--noun, wiðout article-->
      <cat-item tags="n.*.ind"/>
    </def-cat>
    <def-cat n="nom_def"> 					<!--noun, wið article-->
      <cat-item tags="n.*.def"/>
    </def-cat>
    <def-cat n="nom_sg_ind"> 					<!--noun, wiðout article-->
      <cat-item tags="n.*.sg.*.ind"/>
    </def-cat>
    <def-cat n="possessor"> 					<!--noun, np, pos prn, genitive, wið article - (possessor) -->
      <cat-item tags="n.*.gen.def"/>
      <cat-item tags="np.*.gen"/>
      <cat-item tags="np.*.gen.*"/>
      <cat-item tags="prn.pos.*"/>
      <cat-item tags="prn.pos"/>
    </def-cat>
    <def-cat n="nom_gen_def"> 					<!--noun genitive, wið article - (possessor) -->
      <cat-item tags="n.*.gen.def"/>
    </def-cat>
    <def-cat n="np_gen"> 					<!--noun genitive, wið article - (possessor) -->
      <cat-item tags="np.*.gen"/>
      <cat-item tags="np.*.gen.*"/>
    </def-cat>
    <def-cat n="nom_gen_ind"> 					<!--noun, genitive, without article -->
      <cat-item tags="n.*.gen.ind"/>
    </def-cat>
    <def-cat n="num"> 					<!--numeral-->
      <cat-item tags="num.*"/>
      <cat-item tags="num"/>
    </def-cat>
    <def-cat n="adj"> 					<!--adjective-->
      <cat-item tags="adj.*"/>
    </def-cat>
    <def-cat n="adj_def"> 					<!--adjective def, weak declension-->
      <cat-item tags="adj.*.def"/>
    </def-cat>
    <def-cat n="adj_ind"> 					<!--adjective indef, strong declension-->
      <cat-item tags="adj.*.ind"/>
    </def-cat>
 <def-cat n="adj_comp"> 					<!--adjective indef, strong declension-->
   <cat-item tags="adj.comp.*"/>
 </def-cat>
 <def-cat n="meira">
    <cat-item lemma="meira" tags="*"/>
 </def-cat>


   <def-cat n="inf"> 					<!--infinitive-->
      <cat-item tags="vblex.*.inf.*"/>
      <cat-item tags="vblex.*.inf"/>
      <cat-item tags="vbser.*.inf.*"/>
      <cat-item tags="vbser.*.inf"/>
      <cat-item tags="vbhaver.*.inf.*"/>
      <cat-item tags="vbhaver.*.inf"/>
      <cat-item tags="vbmod.*.inf.*"/>
      <cat-item tags="vbmod.*.inf"/>
      <cat-item tags="vaux.*.inf.*"/>
      <cat-item tags="vaux.*.inf"/>
    </def-cat>
   <def-cat n="supn"> 					<!--supine-->
      <cat-item tags="vblex.*.supn.*"/>
      <cat-item tags="vblex.*.supn"/>
      <cat-item tags="vbser.*.supn.*"/>
      <cat-item tags="vbser.*.supn"/>
      <cat-item tags="vbhaver.*.supn.*"/>
      <cat-item tags="vbhaver.*.supn"/>
      <cat-item tags="vbmod.*.supn.*"/>
      <cat-item tags="vbmod.*.supn"/>
      <cat-item tags="vaux.*.supn.*"/>
      <cat-item tags="vaux.*.supn"/>
    </def-cat>

   <def-cat n="pprs"> 					<!--present participle-->
      <cat-item tags="vblex.*.pprs.*"/>
      <cat-item tags="vblex.pprs"/>
      <cat-item tags="vbser.*.pprs.*"/>
      <cat-item tags="vbser.*.pprs"/>
      <cat-item tags="vbhaver.*.pprs.*"/>
      <cat-item tags="vbhaver.*.pprs"/>
      <cat-item tags="vbmod.*.pprs.*"/>
      <cat-item tags="vbmod.*.pprs"/>
      <cat-item tags="vaux.*.pprs.*"/>
      <cat-item tags="vaux.*.pprs"/>
    </def-cat>


    <def-cat n="vbhaver_inf"> 					<!--hafa infinitive-->
      <cat-item tags="vbhaver.*.inf"/>
      <cat-item tags="vbhaver.inf"/>
      <cat-item tags="vbhaver.inf.*"/>
    </def-cat>
    <def-cat n="vfin"> 					<!--finite verb-->
      <cat-item tags="vblex.*.pri.*"/>
      <cat-item tags="vblex.*.past.*"/>
      <cat-item tags="vblex.*.prs.*"/>
      <cat-item tags="vblex.*.pss.*"/>
      <cat-item tags="vbser.pri.*"/>
      <cat-item tags="vbser.past.*"/>
      <cat-item tags="vbser.prs.*"/>
      <cat-item tags="vbser.pss.*"/>
      <cat-item tags="vbhaver.pri.*"/>
      <cat-item tags="vbhaver.past.*"/>
      <cat-item tags="vbhaver.prs.*"/>
      <cat-item tags="vbhaver.pss.*"/>
      <cat-item tags="vbmod.pri.*"/>
      <cat-item tags="vbmod.past.*"/>
      <cat-item tags="vbmod.prs.*"/>
      <cat-item tags="vbmod.pss.*"/>
      <cat-item tags="vbmod.*.pri.*"/>
      <cat-item tags="vbmod.*.past.*"/>
      <cat-item tags="vbmod.*.prs.*"/>
      <cat-item tags="vbmod.*.pss.*"/>
      <cat-item tags="vaux.*.pri.*"/>
      <cat-item tags="vaux.*.past.*"/>
      <cat-item tags="vaux.*.prs.*"/>
      <cat-item tags="vaux.*.pss.*"/>
    </def-cat>
    <def-cat n="vcop"> 					<!--copula-->
      <cat-item tags="vbser.*"/>
    </def-cat>
    <def-cat n="vbhaver_fin"> 					<!--hafa finite verb-->
      <cat-item tags="vbhaver.pri.*"/>
      <cat-item tags="vbhaver.past.*"/>
      <cat-item tags="vbhaver.prs.*"/>
      <cat-item tags="vbhaver.pss.*"/>
    </def-cat>
    <def-cat n="vimp"> 					<!--imperative verb-->
      <cat-item tags="vblex.*.imp.*"/>
      <cat-item tags="vblex.*.imp"/>
      <cat-item tags="vbser.*.imp.*"/>
      <cat-item tags="vbser.*.imp"/>
      <cat-item tags="vbhaver.*.imp.*"/>
      <cat-item tags="vbhaver.*.imp"/>
      <cat-item tags="vbmod.*.imp.*"/>
      <cat-item tags="vbmod.*.imp"/>
      <cat-item tags="vaux.*.imp.*"/>
      <cat-item tags="vaux.*.imp"/>
    </def-cat>

  <def-cat n="pp">                           <!--pas participle -->
      <cat-item tags="vblex.*.pp.*"/>
      <cat-item tags="vblex.*.pp"/>
      <cat-item tags="vbser.*.pp.*"/>
      <cat-item tags="vbser.*.pp"/>
      <cat-item tags="vbhaver.*.pp.*"/>
      <cat-item tags="vbhaver.*.pp"/>
      <cat-item tags="vbmod.*.pp.*"/>
      <cat-item tags="vbmod.*.pp"/>
      <cat-item tags="vaux.*.pp.*"/>
      <cat-item tags="vaux.*.pp"/>
  </def-cat>

  <def-cat n="adv">   <!--upp: no comparison-->
     <cat-item tags="adv"/>
  </def-cat>

  <def-cat n="adv_comp">  <!-- adverbs ðat can have comp and sup: vel-->
     <cat-item tags="adv.pst"/>
     <cat-item tags="adv.comp"/>
     <cat-item tags="adv.sup"/>
  </def-cat>





	<def-cat n="geta">
    <cat-item lemma="geta" tags="vbmod.*"/>
	</def-cat>

	<def-cat n="en1">  								<!-- numeral 1 -->
    <cat-item lemma="einn" tags="num.*"/>
	</def-cat>
	<def-cat n="prn_sig_ref"> 					<!--reflexive pronoun sig-->
    <cat-item lemma="sig" tags="prn.ref.*"/>
	</def-cat>
	<def-cat n="prn_sjálfur_ref"> 					<!--reflexive pronoun sjálfur-->
    <cat-item lemma="sjálfur" tags="prn.ref.*"/>
	</def-cat>
	<def-cat n="prn_annan_ref"> 					<!--reflexive pronoun hver annan-->
    <cat-item lemma="hver annan" tags="prn.ref.*"/>
	</def-cat>
	<def-cat n="prn_possessive_hans"> 					<!--possessive pronoun hans-->
	    <cat-item lemma="hans" tags="prn.pos.*"/>
	</def-cat>
	<def-cat n="prn_interrogative_hvaða"> 					<!--itg pronoun hvaða-->
	    <cat-item lemma="hvaða" tags="prn.itg.*"/>
	</def-cat>

  </section-def-cats>

<!--#######################################################################################-->

  <section-def-attrs>
	<def-attr n="a_prn"> 							<!--PRONOUN-->
	  <attr-item tags="prn.pers"/>
	  <attr-item tags="prn.ref"/>
	  <attr-item tags="prn.pos"/>
	  <attr-item tags="prn.dem"/>
	  <attr-item tags="prn.ind"/>
	  <attr-item tags="prn.qnt"/>
	  <attr-item tags="prn.def"/>
	  <attr-item tags="prn.itg"/>
	  <attr-item tags="prn.rel"/>
	</def-attr>
    <def-attr n="a_adj"> 							<!--ADJECTIVE-->
      <attr-item tags="adj"/>
     <attr-item tags="adj.ord"/>
     <attr-item tags="adj.sint"/>
     <attr-item tags="adj.unsint"/>
    </def-attr>
  <def-attr n="a_np">
    <attr-item tags="np"/>
  </def-attr>
    <def-attr n="a_nom"> 							<!--NOUN-->
      <attr-item tags="n"/>
      <attr-item tags="np"/>
      <attr-item tags="np.al"/>
      <attr-item tags="np.ant"/>
      <attr-item tags="np.top"/>
      <attr-item tags="np.org"/>
      <attr-item tags="np.cog"/>
    </def-attr>
    <def-attr n="a_verb"> 							<!--VERB-->
      <attr-item tags="vblex"/>
      <attr-item tags="vbmod"/>
      <attr-item tags="vaux"/>
      <attr-item tags="vbser"/>
      <attr-item tags="vbhaver"/>
    </def-attr>
    <def-attr n="a_vblex"> 							<!--VERB-->
      <attr-item tags="vblex.inf"/>
    </def-attr>
    <def-attr n="a_num"> 							<!--NUMERAL-->
      <attr-item tags="num"/>
    </def-attr>
    <def-attr n="gen"> 								<!--GENDER-->
      <attr-item tags="m"/>
      <attr-item tags="f"/>
      <attr-item tags="nt"/>
      <attr-item tags="ut"/>
      <attr-item tags="mf"/>
      <attr-item tags="mfn"/>
      <attr-item tags="GD"/>
    </def-attr>
    <def-attr n="cas"> 								<!--CASE-->
      <attr-item tags="nom"/>
      <attr-item tags="acc"/>
      <attr-item tags="dat"/>
      <attr-item tags="gen"/>
								<!--CASE  FOR PRONOUNS NOMINATIVE/OBLIQ-->
	  <attr-item tags="subj"/>
	  <attr-item tags="obj"/>
	</def-attr>
    <def-attr n="grau"> 							<!--COMPARISON-->
      <attr-item tags="pst"/>
      <attr-item tags="comp"/>
      <attr-item tags="sup"/>
    </def-attr>
    <def-attr n="pers"> 							<!--PERSON-->
      <attr-item tags="p1"/>
      <attr-item tags="p2"/>
      <attr-item tags="p3"/>
    </def-attr>
    <def-attr n="grau_tags">
      <attr-item tags="sint"/>
      <attr-item tags="unsint"/>
    </def-attr>
    <def-attr n="voz"> 								<!--VOICE-->
      <attr-item tags="actv"/>
      <attr-item tags="pasv"/>
      <attr-item tags="midv"/>
    </def-attr>
    <def-attr n="nbr"> 								<!--NUMBER-->
      <attr-item tags="sg"/>
      <attr-item tags="pl"/>
      <attr-item tags="sp"/>
      <attr-item tags="ND"/>
    </def-attr>
    <def-attr n="defnes"> 							<!--DEFINITENESS-->
      <attr-item tags="ind"/>
      <attr-item tags="def"/>
    </def-attr>
    <def-attr n="temps"> 							<!--TENSE-->
      <attr-item tags="inf"/>
      <attr-item tags="supn"/>
      <attr-item tags="imp"/>
      <attr-item tags="prs"/>
      <attr-item tags="pri"/>
      <attr-item tags="pres"/>
      <attr-item tags="past"/>
      <attr-item tags="pss"/>
      <attr-item tags="pp"/>
      <attr-item tags="pprs"/>
    </def-attr>
  </section-def-attrs>

  <section-def-vars>
    <def-var n="number"/>
    <def-var n="genere"/>
	<def-var n="caseFirstWord"/>
  	<def-var n="EOS" v="true"/>
  </section-def-vars>

<!--#######################################################################################-->
<!--###################				MACROS				###################################-->
<!--#######################################################################################-->

  <section-def-macros>
	
    <def-macro n="conv_case1" npar="1" > 						<!-- MACRO: convert acc/dat to nom -->	
      <choose>
        <when>
          <test>
            <or>
              <equal><clip pos="1" side="sl" part="cas"/><lit-tag v="acc"/></equal>
              <equal><clip pos="1" side="sl" part="cas"/><lit-tag v="dat"/></equal>
            </or>
          </test>
          <let>
            <clip pos="1" side="tl" part="cas"/>
            <lit-tag v="nom"/>
          </let>
        </when>
      </choose>
    </def-macro>

    <def-macro n="conv_case2" npar="1" > 						<!-- MACRO: convert acc/dat/gen to nom -->	
      <choose>
        <when>
          <test>
            <or>
              <equal><clip pos="1" side="sl" part="cas"/><lit-tag v="acc"/></equal>
              <equal><clip pos="1" side="sl" part="cas"/><lit-tag v="dat"/></equal>
              <equal><clip pos="1" side="sl" part="cas"/><lit-tag v="gen"/></equal>
            </or>
          </test>
          <let>
            <clip pos="1" side="tl" part="cas"/>
            <lit-tag v="nom"/>
          </let>
        </when>
      </choose>
    </def-macro>

	<def-macro n="conv_case_for_pronouns" npar="1" > 						<!-- MACRO: subject/object -->	
	  <choose>
	    <when>
	      <test>
	        <or>
	          <equal><clip pos="1" side="sl" part="cas"/><lit-tag v="acc"/></equal>
	          <equal><clip pos="1" side="sl" part="cas"/><lit-tag v="dat"/></equal>
	          <equal><clip pos="1" side="sl" part="cas"/><lit-tag v="gen"/></equal>
	        </or>
	      </test>
	      <let>
	        <clip pos="1" side="tl" part="cas"/>
	        <lit-tag v="obj"/>
	      </let>
	    </when>
	    <when>
	      <test>
	          <equal><clip pos="1" side="sl" part="cas"/><lit-tag v="nom"/></equal>
	      </test>
	      <let>
	        <clip pos="1" side="tl" part="cas"/>
	        <lit-tag v="subj"/>
	      </let>
	    </when>
	  </choose>
	</def-macro>

    <def-macro n="conv_gender_for_numerals" npar="1" > 	<!-- MACRO: convert gender for the numeral einn, 
																sing, pst: m/f => ut -->	
      <choose>
        <when>
          <test>
	            <or>
	              <equal><clip pos="1" side="sl" part="gen"/><lit-tag v="m"/></equal>
	              <equal><clip pos="1" side="sl" part="gen"/><lit-tag v="f"/></equal>
	            </or>
          </test>
          <let>
            <clip pos="1" side="tl" part="gen"/>
            <lit-tag v="ut"/>
          </let>
        </when> 		
	 </choose>
    </def-macro>



	<!-- MACRO: convert gender for pronouns (sjálfur), 
																sing: m/f => ut 
																pl, m, f, nt => mfn-->
    <def-macro n="conv_gender_for_reflexive_pronouns" npar="1" > 	
      <choose>
        <when>
          <test>
				<and>
	            	<or>
	              		<equal><clip pos="1" side="sl" part="gen"/><lit-tag v="m"/></equal>
	              		<equal><clip pos="1" side="sl" part="gen"/><lit-tag v="f"/></equal>
	            	</or>
          				<equal><clip pos="1" side="sl" part="nbr"/><lit-tag v="sg"/></equal>
				</and>
        	</test>
          <let>
            <clip pos="1" side="tl" part="gen"/>
            <lit-tag v="ut"/>
          </let>
        </when> 		
        <when>
          <test>
	              <equal><clip pos="1" side="sl" part="nbr"/><lit-tag v="pl"/></equal>
		   </test>
          <let>
            <clip pos="1" side="tl" part="gen"/>
            <lit-tag v="mfn"/>
          </let>
        </when> 		
	 </choose>
    </def-macro>


    <def-macro n="conv_gender_for_possessive_pronouns" npar="1" > 	
      <choose>
        <when>
          <test>
				<and>
	            	<or>
	              		<equal><clip pos="1" side="sl" part="gen"/><lit-tag v="m"/></equal>
	              		<equal><clip pos="1" side="sl" part="gen"/><lit-tag v="f"/></equal>
	            	</or>
          				<equal><clip pos="1" side="sl" part="nbr"/><lit-tag v="sg"/></equal>
				</and>
        	</test>
          <let>
            <clip pos="1" side="tl" part="gen"/>
            <lit-tag v="ut"/>
          </let>
        </when> 		
        <when>
          <test>
	              <equal><clip pos="1" side="sl" part="nbr"/><lit-tag v="pl"/></equal>
		   </test>
          <let>
            <clip pos="1" side="tl" part="gen"/>
            <lit-tag v="mfn"/>
          </let>
        </when> 		
        <when>
          <test>
				<and>
	              		<equal><clip pos="1" side="sl" part="gen"/><lit-tag v="mfn"/></equal>
          				<equal><clip pos="1" side="sl" part="nbr"/><lit-tag v="sp"/></equal>
				</and>
        	</test>
          <let>
            <clip pos="1" side="tl" part="gen"/>
            <lit-tag v="ut"/>
          </let>
          <let>
            <clip pos="1" side="tl" part="nbr"/>
            <lit-tag v="sg"/>
          </let>
        </when> 		
	 </choose>
    </def-macro>



    <def-macro n="conv_gender_for_quantitative_pronouns" npar="1" > 	
      <choose>
        <when>
          <test>
			<or>
	              <equal><clip pos="1" side="sl" part="nbr"/><lit-tag v="pl"/></equal>
	              <equal><clip pos="1" side="sl" part="defnes"/><lit-tag v="def"/></equal>
			</or>
		   </test>
          <let>
            <clip pos="1" side="tl" part="gen"/>
            <lit-tag v="mfn"/>
          </let>
        </when> 		
        <when>
          <test>
				<and>
	            	<or>
	              		<equal><clip pos="1" side="sl" part="gen"/><lit-tag v="m"/></equal>
	              		<equal><clip pos="1" side="sl" part="gen"/><lit-tag v="f"/></equal>
	            	</or>
          				<equal><clip pos="1" side="sl" part="nbr"/><lit-tag v="sg"/></equal>
				</and>
        	</test>
          <let>
            <clip pos="1" side="tl" part="gen"/>
            <lit-tag v="ut"/>
          </let>
        </when> 		
	 </choose>
    </def-macro>



    <def-macro n="conv_gender_for_adj" npar="1" > 	<!-- MACRO: convert gender for adj, 
																sing, pst: m/f => ut
																m/f/nt => mfn, for plural, comp, superlatives,  it might need revision -->	
      <choose>
        <when>
          <test>
	            <or>
	              <equal><clip pos="1" side="sl" part="defnes"/><lit-tag v="def"/></equal>
	              <equal><clip pos="1" side="sl" part="nbr"/><lit-tag v="pl"/></equal>
	              <equal><clip pos="1" side="sl" part="grau"/><lit-tag v="comp"/></equal>
	              <equal><clip pos="1" side="sl" part="grau"/><lit-tag v="sup"/></equal>
	            </or>
          </test>
          <let>
            <clip pos="1" side="tl" part="gen"/>
            <lit-tag v="mfn"/>
          </let>
        </when> 		
        <when>
          <test>
			<and>
	              <equal><clip pos="1" side="sl" part="nbr"/><lit-tag v="sg"/></equal>
	              <equal><clip pos="1" side="sl" part="grau"/><lit-tag v="pst"/></equal>
	              <equal><clip pos="1" side="sl" part="defnes"/><lit-tag v="ind"/></equal>
            	<or>
              		<equal><clip pos="1" side="sl" part="gen"/><lit-tag v="m"/></equal>
              		<equal><clip pos="1" side="sl" part="gen"/><lit-tag v="f"/></equal>
            	</or>
        	</and>
          </test>
          <let>
            <clip pos="1" side="tl" part="gen"/>
            <lit-tag v="ut"/>
          </let>
        </when>
	 </choose>
    </def-macro>



	<def-macro n="f_concord2" npar="2" >                                        

	     <choose>
	       <when>
	         <test>
	           <equal><clip pos="1" side="tl" part="nbr"/><lit-tag v="pl"/></equal>
	         </test>
	         	<let>
					<clip pos="2" side="tl" part="gen"/><lit-tag v="mfn"/>
				</let>
	       </when>
	       <when>
	         <test>
	           <equal><clip pos="1" side="tl" part="gen"/><lit-tag v="ut"/></equal>
	         </test>
	         	<let>
					<clip pos="2" side="tl" part="gen"/><lit-tag v="ut"/>
				</let>
	       </when>
	       <when>
	         <test>
	           <equal><clip pos="1" side="tl" part="gen"/><lit-tag v="nt"/></equal>
	         </test>
	         	<let>
					<clip pos="2" side="tl" part="gen"/><lit-tag v="nt"/>
				</let>
	       </when>
	     </choose>
	 </def-macro>




    <def-macro n="conv_number_for_adj" npar="1" > 	<!-- MACRO: convert number for adj, 
																pst, def = > sp
																comp, superlatives => sp -->	
      <choose>
        <when>
          <test>
			<or>
			<and>
	              <equal><clip pos="1" side="sl" part="grau"/><lit-tag v="pst"/></equal>
	              <equal><clip pos="1" side="sl" part="defnes"/><lit-tag v="def"/></equal>
        	</and>
            <equal><clip pos="1" side="sl" part="grau"/><lit-tag v="comp"/></equal>
            <equal><clip pos="1" side="sl" part="grau"/><lit-tag v="sup"/></equal>
    	    </or>
          </test>
          <let>
            <clip pos="1" side="tl" part="nbr"/>
            <lit-tag v="sp"/>
          </let>
        </when>
	 </choose>
    </def-macro>


    <def-macro n="conv_gender_for_pp" npar="1" > 	<!-- MACRO: convert gender for past participles, 
																sing: m/f => ut
																		nt => nt
																m/f/nt => mfn, for plural -->	
      <choose>
        <when>
          <test>
	            <or>
	              <equal><clip pos="1" side="sl" part="nbr"/><lit-tag v="pl"/></equal>
	              <equal><clip pos="1" side="sl" part="defnes"/><lit-tag v="def"/></equal>
	            </or>
          </test>
          <let>
            <clip pos="1" side="tl" part="gen"/>
            <lit-tag v="mfn"/>
          </let>
        </when> 		
        <when>
          <test>
            	<or>
              		<equal><clip pos="1" side="sl" part="gen"/><lit-tag v="m"/></equal>
              		<equal><clip pos="1" side="sl" part="gen"/><lit-tag v="f"/></equal>
            	</or>
          </test>
          <let>
            <clip pos="1" side="tl" part="gen"/>
            <lit-tag v="ut"/>
          </let>
        </when>
	 </choose>
    </def-macro>


    <def-macro n="conv_number_for_pp" npar="1" > 	<!-- MACRO: convert number for past participles, 
																def:  => sp           -->	
      <choose>
        <when>
          <test>
	              <equal><clip pos="1" side="sl" part="defnes"/><lit-tag v="def"/></equal>
          </test>
          <let>
            <clip pos="1" side="tl" part="nbr"/>
            <lit-tag v="sp"/>
          </let>
        </when> 		
	 </choose>
    </def-macro>



    <def-macro n="conv_temps1" npar="1"> 		<!-- MACRO: convert present/past indicative/subjunctive to present/past-->
      <choose>
        <when>
          <test>
            <or>
              <equal><clip pos="1" side="sl" part="temps"/><lit-tag v="prs"/></equal>
              <equal><clip pos="1" side="sl" part="temps"/><lit-tag v="pri"/></equal>
            </or>
          </test>
          <let>
            <clip pos="1" side="tl" part="temps"/>
            <lit-tag v="pres"/>
          </let>
        </when>

        <when>
          <test>
            <or>
              <equal><clip pos="1" side="sl" part="temps"/><lit-tag v="past"/></equal>
              <equal><clip pos="1" side="sl" part="temps"/><lit-tag v="pss"/></equal>
            </or>
          </test>
          <let>
            <clip pos="1" side="tl" part="temps"/>
            <lit-tag v="past"/>
          </let>
        </when>

      </choose>
    </def-macro>

    <def-macro n="conv_voice_mid_to_pas" npar="1"> 		<!-- MACRO: convert middle voice to passive voice (-s)-->
      <choose>
        <when>
          <test>
              <equal><clip pos="1" side="sl" part="voz"/><lit-tag v="midv"/></equal>
          </test>
          <let>
            <clip pos="1" side="tl" part="voz"/>
            <lit-tag v="pasv"/>
          </let>
        </when>
      </choose>
    </def-macro>

    <def-macro n="firstWord" npar="1">
      <choose>
        <when>
          <test>
              <equal>
                <clip pos="1" side="sl" part="a_np"/>    <!--from is-en, removed the acr part -->
                <lit v=""/>
              </equal>
          </test>
          <choose>
            <when>
              <test>
                <equal> 
                  <var n="EOS"/>
                  <lit v="true"/>
                </equal> 
              </test>
              <modify-case>
                <clip pos="1" side="tl" part="lem"/>
                <lit v="aa"/>
              </modify-case>
              <let>
                <var n="caseFirstWord"/>
                <lit v="Aa"/>
              </let>
            </when>
            <otherwise> 
              <let>
                <var n="caseFirstWord"/>
                <lit v="aa"/>
              </let>
            </otherwise>
          </choose>
        </when>
        <otherwise>
          <let>
            <var n="caseFirstWord"/>
            <lit v="aa"/>
          </let>
        </otherwise>
      </choose>
      <let>
        <var n="EOS"/>
        <lit v="false"/>
      </let>
  </def-macro>



  </section-def-macros>


<!--#######################################################################################-->
<!--###################				RULES				###################################-->
<!--#######################################################################################-->

  <section-rules>



	<rule comment="REGLA: GETA PP → KAN INF | get komið → kan komma">     <!-- does not work -->
	     <pattern>
	       <pattern-item n="geta"/>
	       <pattern-item n="pp"/>
	     </pattern>
	     <action>
	       <call-macro n="firstWord">                          
	         <with-param pos="1"/>
	       </call-macro>   
	       <call-macro n="conv_temps1"> <!--  -->
	         <with-param pos="1"/>
	       </call-macro>
	       <call-macro n="conv_voice_mid_to_pas"> <!--  -->
	         <with-param pos="1"/>
	       </call-macro>
	       <out>
	         <chunk name="get_komið" case="caseFirstWord">     
	           <tags>
	             <tag><lit-tag v="SV"/></tag>               

	              <!-- <clip pos="2" side="tl" part="a_verb"/>    -->    <!-- ????? tag for a_verb: MAYBE -->	
	              <tag><clip pos="1" side="tl" part="temps"/></tag>
	              <tag><clip pos="1" side="tl" part="voz"/></tag>
	            </tags>
	            <lu>
                 <clip pos="1" side="tl" part="lemh"/>
                 <clip pos="1" side="tl" part="a_verb"/>
                 <clip pos="1" side="tl" part="temps"/>
                 <clip pos="1" side="tl" part="lemq"/>
	            </lu>
	            <b pos="1"/>
	            <lu>
	              <clip pos="2" side="tl" part="lemh"/>
	              <clip pos="2" side="tl" part="a_verb"/>
	              <lit-tag v="inf"/>
	              <clip pos="2" side="tl" part="lemq"/>
	            </lu>
	          </chunk>
	        </out>
	     </action>
    </rule>



<!--also write noun possessive pronoun bókin hans → hans bok -->


<rule comment="REGLA: ADJ NOUN POSSESSOR → POSSESSOR ADJ NOUN | fallegi hestur stelpunnar → flickans vackra hest">   
	     <pattern>
	       <pattern-item n="adj_def"/>
	       <pattern-item n="nom_ind"/>
	       <pattern-item n="nom_gen_def"/>
	     </pattern>
	     <action>
	       <call-macro n="firstWord">                           
	         <with-param pos="1"/>
	       </call-macro>    
	       <call-macro n="conv_case2"> 
	         <with-param pos="1"/>
	       </call-macro>
	       <out>
	         <chunk name="adj_noun_poss" case="caseFirstWord">    
	           <tags>
	             <tag><lit-tag v="SN"/></tag>              
	              <tag><clip pos="2" side="tl" part="gen"/></tag>
	              <tag><clip pos="2" side="tl" part="nbr"/></tag>
	              <tag><clip pos="2" side="tl" part="defnes"/></tag>
	              <tag><clip pos="2" side="tl" part="cas"/></tag>
	            </tags>
	            <lu>
	              <clip pos="3" side="tl" part="lemh"/>
	              <clip pos="3" side="tl" part="a_nom"/>
	              <clip pos="3" side="tl" part="gen"/>
	              <clip pos="3" side="tl" part="nbr"/>
				  <lit-tag v="def"/>
				  <lit-tag v="gen"/>
	              <clip pos="3" side="tl" part="lemq"/>
	            </lu>
	            <b pos="1"/>              
	            <lu>
	              <clip pos="1" side="tl" part="lemh"/>
	              <clip pos="1" side="tl" part="a_adj"/>
	              <clip pos="1" side="tl" part="grau"/>
				  <lit-tag v="mfn"/>
				  <lit-tag v="sp"/>
				  <lit-tag v="def"/>
	              <clip pos="1" side="tl" part="lemq"/>
	            </lu>
	            <b pos="1"/>              
	            <lu>
	              <clip pos="2" side="tl" part="lemh"/>
	              <clip pos="2" side="tl" part="a_nom"/>
	              <clip pos="2" side="tl" part="gen" link-to="2"/>
	              <clip pos="2" side="tl" part="nbr" link-to="3"/>
				  <lit-tag v="ind"/>
				  <lit-tag v="nom"/>
	              <clip pos="2" side="tl" part="lemq"/>
	            </lu>
	          </chunk>
	        </out>
	     </action>
</rule>


    <rule comment="regla: adj nom defined | dýri bjórinn → det dyra ölet">     <!--CHECK!!!-->
	      <pattern>
	        <pattern-item n="adj_def"/>
	        <pattern-item n="nom_def"/>
	      </pattern>
	      <action>
	        <call-macro n="conv_case1">   						<!-- only for the noun???-->
	          <with-param pos="2"/>
	        </call-macro>
	       <call-macro n="conv_number_for_adj"> 
	         <with-param pos="1"/>
	       </call-macro>
	        <out>
	          <chunk name="adj_noun" case="caseFirstWord">
	            <tags>
	              <tag><lit-tag v="SN"/></tag>
	              <tag><clip pos="2" side="tl" part="gen"/></tag>
	              <tag><clip pos="2" side="tl" part="nbr"/></tag>
	              <tag><clip pos="2" side="tl" part="defnes"/></tag>
	              <tag><clip pos="2" side="tl" part="cas"/></tag>
	            </tags>
<!-- 				<lu>
 Here I need the pronoun den/det/de
<pardef n="d/en__prn">
  <e>       <p><l>en</l>        <r>en<s n="prn"/><s n="dem"/><s n="ut"/><s n="sg"/></r></p></e>
  <e>       <p><l>et</l>        <r>en<s n="prn"/><s n="dem"/><s n="nt"/><s n="sg"/></r></p></e>
  <e>       <p><l>e</l>         <r>en<s n="prn"/><s n="dem"/><s n="mfn"/><s n="pl"/></r></p></e>
</pardef>

	              <clip pos="1" side="tl" part="lemh"/>
	              <lit-tag v="prn"/>
	              <lit-tag v="dem"/>
	              <clip pos="2" side="tl" part="gen" link-to="2"/>
	              <clip pos="1" side="tl" part="nbr" link-to="3"/>
	              <clip pos="1" side="tl" part="lemq"/>             
	            </lu>     -->
	            <b pos="1"/>
	            <lu>
	              <clip pos="1" side="tl" part="lemh"/>
	              <clip pos="1" side="tl" part="a_adj"/>
	              <clip pos="1" side="tl" part="grau"/>
				  <lit-tag v="mfn"/>
	              <clip pos="1" side="tl" part="nbr"/>
	              <clip pos="2" side="tl" part="defnes" link-to="4"/>    <!-- pos 1 or 2 here????? -->
	              <clip pos="1" side="tl" part="lemq"/>
	            </lu>
	            <b pos="1"/>                                        <!-- pos 1 or 2 here????? -->
	            <lu>
	              <clip pos="2" side="tl" part="lemh"/>
	              <clip pos="2" side="tl" part="a_nom"/>
	              <clip pos="2" side="tl" part="gen" link-to="2"/>
	              <clip pos="2" side="tl" part="nbr" link-to="3"/>
	              <clip pos="2" side="tl" part="defnes" link-to="4"/>
	              <clip pos="2" side="tl" part="cas" link-to="5"/>
	              <clip pos="2" side="tl" part="lemq"/>
	            </lu>
	          </chunk>
	        </out>
	      </action>
	</rule>

    <rule comment="regla: adj nom (undef) | fallegur bjór → vackert öl">  <!-- works -->
	      <pattern>
	        <pattern-item n="adj_ind"/>
	        <pattern-item n="nom_ind"/>
	      </pattern>
	      <action>
	        <call-macro n="conv_case1">   	
	          <with-param pos="1"/>
	        </call-macro>
            <call-macro n="f_concord2">
              <with-param pos="2"/>
              <with-param pos="1"/>
            </call-macro>
	        <call-macro n="conv_case1">   	
	          <with-param pos="2"/>
	        </call-macro>
	        <out>
	          <chunk name="adj_nom" case="caseFirstWord">
	            <tags>
	              <tag><lit-tag v="SN"/></tag>
	              <tag><clip pos="2" side="tl" part="gen"/></tag>
	              <tag><clip pos="2" side="tl" part="nbr"/></tag>
	              <tag><clip pos="2" side="tl" part="defnes"/></tag>
	              <tag><clip pos="2" side="tl" part="cas"/></tag>
	            </tags>
	            <lu>
	              <clip pos="1" side="tl" part="lemh"/>
	              <clip pos="1" side="tl" part="a_adj"/>
	              <clip pos="1" side="tl" part="grau"/>
	              <clip pos="1" side="tl" part="gen"/>   
	              <clip pos="2" side="tl" part="nbr"/>
	              <clip pos="2" side="tl" part="defnes"/>     
	              <clip pos="1" side="tl" part="lemq"/>
	            </lu>
	            <b pos="1"/>
	            <lu>
	              <clip pos="2" side="tl" part="lemh"/>
	              <clip pos="2" side="tl" part="a_nom"/>
	              <clip pos="2" side="tl" part="gen" link-to="2"/>
	              <clip pos="2" side="tl" part="nbr" link-to="3"/>
	              <clip pos="2" side="tl" part="defnes" link-to="4"/>
	              <clip pos="2" side="tl" part="cas" link-to="5"/>
	              <clip pos="2" side="tl" part="lemq"/>
	            </lu>
	          </chunk>
	        </out>
	      </action>
	</rule>



    <rule comment="regla: num nom_gen (undef) | 1000 manns → 1000 menn">  
	      <pattern>
	        <pattern-item n="num"/>
	        <pattern-item n="nom_gen_ind"/>
	      </pattern>
	      <action>
	       <call-macro n="firstWord">                           
	         <with-param pos="1"/>
	       </call-macro>    
	        <out>
	          <chunk name="1000_MANNS" case="caseFirstWord">
	            <tags>
	              <tag><lit-tag v="SN"/></tag>
	              <tag><clip pos="2" side="tl" part="gen"/></tag>
	              <tag><lit-tag v="pl"/></tag>   <!-- by default -->
	              <tag><lit-tag v="ind"/></tag>   <!-- by default -->
	              <tag><lit-tag v="nom"/></tag>   <!-- by default -->
	            </tags>
	            <lu>
	              <clip pos="1" side="tl" part="lemh"/>
	              <clip pos="1" side="tl" part="a_num"/>
	              <clip pos="1" side="tl" part="gen"/>   
	              <clip pos="2" side="tl" part="nbr"/>
	              <clip pos="2" side="tl" part="defnes"/>     
	              <clip pos="1" side="tl" part="lemq"/>
	            </lu>
	            <b pos="1"/>
	            <lu>
	              <clip pos="2" side="tl" part="lemh"/>
	              <clip pos="2" side="tl" part="a_nom"/>
	              <clip pos="2" side="tl" part="gen" link-to="2"/>
	              <clip pos="2" side="tl" part="nbr" link-to="3"/>
	              <clip pos="2" side="tl" part="defnes" link-to="4"/>
	              <clip pos="2" side="tl" part="cas" link-to="5"/>
	              <clip pos="2" side="tl" part="lemq"/>
	            </lu>
	          </chunk>
	        </out>
	      </action>
	</rule>


<!-- er að skrifa → skriver -->


 



<rule comment="REGLA: NOUN POSSESSOR → POSSESSOR NOUN | hestur stelpunnar → flickans hest">   <!-- works! --> 
	     <pattern>
	       <pattern-item n="nom_ind"/>
	       <pattern-item n="nom_gen_def"/>
	     </pattern>
	     <action>
	       <call-macro n="firstWord">                           
	         <with-param pos="1"/>
	       </call-macro>    
	       <call-macro n="conv_case2"> 
	         <with-param pos="1"/>
	       </call-macro>
	       <out>
	         <chunk name="noun_poss" case="caseFirstWord">    
	           <tags>
	             <tag><lit-tag v="SN"/></tag>              
	              <!-- <clip pos="1" side="tl" part="a_nom"/>    -->    <!-- ????? tag for a_nom: MAYBE-->	
	              <tag><clip pos="1" side="tl" part="gen"/></tag>
	              <tag><clip pos="1" side="tl" part="nbr"/></tag>
	              <tag><clip pos="1" side="tl" part="defnes"/></tag>
	              <tag><clip pos="1" side="tl" part="cas"/></tag>
	            </tags>
	            <lu>
	              <clip pos="2" side="tl" part="lemh"/>
	              <clip pos="2" side="tl" part="a_nom"/>
	              <clip pos="2" side="tl" part="gen"/>
	              <clip pos="2" side="tl" part="nbr"/>
				  <lit-tag v="def"/>
				  <lit-tag v="gen"/>
	              <clip pos="2" side="tl" part="lemq"/>
	            </lu>
	            <b pos="1"/>              
	            <lu>
	              <clip pos="1" side="tl" part="lemh"/>
	              <clip pos="1" side="tl" part="a_nom"/>
	              <clip pos="1" side="tl" part="gen" link-to="2"/>
	              <clip pos="1" side="tl" part="nbr" link-to="3"/>
				  <lit-tag v="ind"/>
				  <lit-tag v="nom"/>
	              <clip pos="1" side="tl" part="lemq"/>
	            </lu>
	          </chunk>
	        </out>
	     </action>
</rule>

<rule comment="REGLA: NOUN POSSESSOR → POSSESSOR NOUN | náttúra Íslands → Islands natur">   <!-- works! --> 
	     <pattern>
	       <pattern-item n="nom_ind"/>
	       <pattern-item n="np_gen"/>
	     </pattern>
	     <action>
	       <call-macro n="firstWord">                           
	         <with-param pos="1"/>
	       </call-macro>    
	       <call-macro n="conv_case2"> 
	         <with-param pos="1"/>
	       </call-macro>
	       <out>
	         <chunk name="noun_poss" case="caseFirstWord">    
	           <tags>
	             <tag><lit-tag v="SN"/></tag>              
	              <!-- <clip pos="1" side="tl" part="a_nom"/>    -->    <!-- ????? tag for a_nom: MAYBE-->	
	              <tag><clip pos="1" side="tl" part="gen"/></tag>
	              <tag><clip pos="1" side="tl" part="nbr"/></tag>
	              <tag><clip pos="1" side="tl" part="defnes"/></tag>
	              <tag><clip pos="1" side="tl" part="cas"/></tag>
	            </tags>
	            <lu>
	              <clip pos="2" side="tl" part="lemh"/>
	              <clip pos="2" side="tl" part="a_nom"/>
	              <clip pos="2" side="tl" part="gen"/>
	              <clip pos="2" side="tl" part="nbr"/>
				  <lit-tag v="gen"/>
	              <clip pos="2" side="tl" part="lemq"/>
	            </lu>
	            <b pos="1"/>              
	            <lu>
	              <clip pos="1" side="tl" part="lemh"/>
	              <clip pos="1" side="tl" part="a_nom"/>
	              <clip pos="1" side="tl" part="gen" link-to="2"/>
	              <clip pos="1" side="tl" part="nbr" link-to="3"/>
				  <lit-tag v="ind"/>
				  <lit-tag v="nom"/>
	              <clip pos="1" side="tl" part="lemq"/>
	            </lu>
	          </chunk>
	        </out>
	     </action>
</rule>

<rule comment="REGLA: NOUN POSSESSOR → POSSESSOR NOUN | bókin hans → hans bók">   <!-- works! --> 
	     <pattern>
	       <pattern-item n="nom_def"/>
	       <pattern-item n="prn_possessive_hans"/>
	     </pattern>
	     <action>
	       <call-macro n="firstWord">                           
	         <with-param pos="1"/>
	       </call-macro>    
	       <call-macro n="conv_case2"> 
	         <with-param pos="1"/>
	       </call-macro>
	       <out>
	         <chunk name="noun_poss" case="caseFirstWord">    
	           <tags>
	             <tag><lit-tag v="SN"/></tag>              
	              <tag><clip pos="1" side="tl" part="gen"/></tag>
	              <tag><clip pos="1" side="tl" part="nbr"/></tag>
	              <tag><clip pos="1" side="tl" part="defnes"/></tag>
	              <tag><clip pos="1" side="tl" part="cas"/></tag>
	            </tags>
	            <lu>
	              <clip pos="2" side="tl" part="lemh"/>
	              <clip pos="2" side="tl" part="a_prn"/>
	              <clip pos="2" side="tl" part="gen"/>
	              <clip pos="2" side="tl" part="nbr"/>
	              <clip pos="2" side="tl" part="lemq"/>
	            </lu>
	            <b pos="1"/>              
	            <lu>
	              <clip pos="1" side="tl" part="lemh"/>
	              <clip pos="1" side="tl" part="a_nom"/>
	              <clip pos="1" side="tl" part="gen" link-to="2"/>
	              <clip pos="1" side="tl" part="nbr" link-to="3"/>
				  <lit-tag v="ind"/>
				  <lit-tag v="nom"/>
	              <clip pos="1" side="tl" part="lemq"/>
	            </lu>
	          </chunk>
	        </out>
	     </action>
</rule>

<rule comment="REGLA: NOUN POSSESSOR → POSSESSOR NOUN | bókin mín → minn bók">   <!-- works! --> 
	     <pattern>
	       <pattern-item n="nom_def"/>
	       <pattern-item n="prn_possessive"/>
	     </pattern>
	     <action>
	       <call-macro n="firstWord">                           
	         <with-param pos="1"/>
	       </call-macro>    
	       <call-macro n="conv_case2"> 
	         <with-param pos="1"/>
	       </call-macro>
	       <call-macro n="conv_gender_for_numerals"> 
	         <with-param pos="2"/>
	       </call-macro>
	       <out>
	         <chunk name="noun_poss" case="caseFirstWord">    
	           <tags>
	             <tag><lit-tag v="SN"/></tag>              
	              <tag><clip pos="1" side="tl" part="gen"/></tag>
	              <tag><clip pos="1" side="tl" part="nbr"/></tag>
	              <tag><clip pos="1" side="tl" part="defnes"/></tag>
	              <tag><clip pos="1" side="tl" part="cas"/></tag>
	            </tags>
	            <lu>
	              <clip pos="2" side="tl" part="lemh"/>
	              <clip pos="2" side="tl" part="a_prn"/>
	              <clip pos="2" side="tl" part="gen"/>
	              <clip pos="2" side="tl" part="nbr"/>
	              <clip pos="2" side="tl" part="lemq"/>
	            </lu>
	            <b pos="1"/>              
	            <lu>
	              <clip pos="1" side="tl" part="lemh"/>
	              <clip pos="1" side="tl" part="a_nom"/>
	              <clip pos="1" side="tl" part="gen" link-to="2"/>
	              <clip pos="1" side="tl" part="nbr" link-to="3"/>
				  <lit-tag v="ind"/>
				  <lit-tag v="nom"/>
	              <clip pos="1" side="tl" part="lemq"/>
	            </lu>
	          </chunk>
	        </out>
	     </action>
</rule>


    <rule comment="REGLA: NOUN  | hestur → hest">   <!-- works --> 
	     <pattern>
	       <pattern-item n="nom"/>
	     </pattern>
	     <action>
	       <call-macro n="firstWord">                           
	         <with-param pos="1"/>
	       </call-macro>    
	       <call-macro n="conv_case1"> 
	         <with-param pos="1"/>
	       </call-macro>
	       <out>
	         <chunk name="noun" case="caseFirstWord">    
	           <tags>
	             <tag><lit-tag v="SN"/></tag>              
	              <tag><clip pos="1" side="tl" part="gen"/></tag>
	              <tag><clip pos="1" side="tl" part="nbr"/></tag>
	              <tag><clip pos="1" side="tl" part="defnes"/></tag>
	              <tag><clip pos="1" side="tl" part="cas"/></tag>
	            </tags>
	            <lu>
	              <clip pos="1" side="tl" part="lemh"/>
	              <clip pos="1" side="tl" part="a_nom"/>
	              <clip pos="1" side="tl" part="gen"/>
	              <clip pos="1" side="tl" part="nbr"/>
	              <clip pos="1" side="tl" part="defnes"/>
	              <clip pos="1" side="tl" part="cas"/>
	              <clip pos="1" side="tl" part="lemq"/>
	            </lu>
	          </chunk>
	        </out>
	     </action>
	</rule>

<!--
	<rule comment="REGLA: ADJ_COMP  | fallegri → vackrare">   
		     <pattern>
		       <pattern-item n="adj_comp"/>
		     </pattern>
		     <action>
		       <call-macro n="firstWord">                           
		         <with-param pos="1"/>
		       </call-macro>    
		       <call-macro n="conv_case2"> 
		         <with-param pos="1"/>
		       </call-macro>
		       <call-macro n="conv_gender_for_adj"> 
		         <with-param pos="1"/>
		       </call-macro>
		       <call-macro n="conv_number_for_adj"> 
		         <with-param pos="1"/>
		       </call-macro>
		       <out>
		         <chunk name="FALLEGRI_COMP" case="caseFirstWord">    
		           <tags>
		             <tag><lit-tag v="SA"/></tag>              
		              <tag><clip pos="1" side="tl" part="grau"/></tag>
		              <tag><clip pos="1" side="tl" part="gen"/></tag>
		              <tag><clip pos="1" side="tl" part="nbr"/></tag>
		            </tags>
		            <lu>
		              <clip pos="1" side="tl" part="lemh"/>
		              <clip pos="1" side="tl" part="a_adj"/>
		              <clip pos="1" side="tl" part="grau"/>
		              <clip pos="1" side="tl" part="gen"/>
		              <clip pos="1" side="tl" part="nbr"/>
		              <clip pos="1" side="tl" part="lemq"/>
		            </lu>
		          </chunk>
		        </out>
		     </action>
	</rule>
-->

	<rule comment="REGLA: ADJ  | fallegur → vacker">   <!-- does work --> 
		     <pattern>
		       <pattern-item n="adj"/>
		     </pattern>
		     <action>
		       <call-macro n="firstWord">                           
		         <with-param pos="1"/>
		       </call-macro>    
		       <call-macro n="conv_case2"> 
		         <with-param pos="1"/>
		       </call-macro>
		       <call-macro n="conv_gender_for_adj"> 
		         <with-param pos="1"/>
		       </call-macro>
		       <call-macro n="conv_number_for_adj"> 
		         <with-param pos="1"/>
		       </call-macro>


		    <choose>
			
			
	         <when>
	           <test>
				<and>
	             <equal>
	               <clip pos="1" side="tl" part="a_adj"/>
	               <lit-tag v="adj.unsint"/>
	             </equal>
	             <equal>
	               <clip pos="1" side="sl" part="grau"/>
	               <lit-tag v="comp"/>
	             </equal>
				</and>
	           </test>
		       <out>
		         <chunk name="adj_comp_unsint" case="caseFirstWord">    <!--olämpligare - meira óviðeigandi --> 
		           <tags>
		             <tag><lit-tag v="SA"/></tag>     
		              <tag><clip pos="1" side="tl" part="grau"/></tag>
		              <tag><clip pos="1" side="tl" part="gen"/></tag>
		              <tag><clip pos="1" side="tl" part="nbr"/></tag>
		              <tag><lit-tag v="ind"/></tag>   <!-- is this correct??? -->
		            </tags>
		            <lu>
		              <lit v="mer"/>
		              <lit-tag v="adv"/>
		            </lu>
		            <b pos="0"/>
		            <lu>
		              <clip pos="1" side="tl" part="lemh"/>
		              <lit-tag v="adj"/>
		              <lit-tag v="pst"/>
<!--		              <clip pos="1" side="tl" part="gen" link-to="3"/>  
			              <clip pos="1" side="tl" part="nbr" link-to="4"/>  -->
					  <lit-tag v="ut"/>
    				  <lit-tag v="sg"/>
		              <lit-tag v="ind"/>        <!-- is this correct??? -->
		              <clip pos="1" side="tl" part="lemq"/>
		            </lu>
		          </chunk>
		         </out>
	         </when>
	         <when>
	           <test>
				<and>
	             <equal>
	               <clip pos="1" side="tl" part="a_adj"/>
	               <lit-tag v="adj.unsint"/>
	             </equal>
	             <equal>
	               <clip pos="1" side="sl" part="grau"/>
	               <lit-tag v="sup"/>
	             </equal>
				</and>
	           </test>
		       <out>
		         <chunk name="adj_sup_unsint" case="caseFirstWord">   <!--olämpligast - mest óviðeigandi --> 
		           <tags>
		             <tag><lit-tag v="SA"/></tag>     
		              <tag><clip pos="1" side="tl" part="grau"/></tag>
		              <tag><clip pos="1" side="tl" part="gen"/></tag>
		              <tag><clip pos="1" side="tl" part="nbr"/></tag>
		              <tag><lit-tag v="ind"/></tag>   <!-- is this correct??? -->
		            </tags>
		            <lu>
		              <lit v="mest"/>
		              <lit-tag v="adv"/>
		            </lu>
		            <b pos="0"/>
		            <lu>
		              <clip pos="1" side="tl" part="lemh"/>
		              <lit-tag v="adj"/>
		              <lit-tag v="pst"/>
<!--		              <clip pos="1" side="tl" part="gen" link-to="3"/>  
		              <clip pos="1" side="tl" part="nbr" link-to="4"/>  -->
					  <lit-tag v="ut"/>
					  <lit-tag v="sg"/>
		              <lit-tag v="ind"/>
		              <clip pos="1" side="tl" part="lemq"/>
		            </lu>
		          </chunk>
		         </out>
	         </when>
	

				         <when>
				           <test>
				             <equal>
				               <clip pos="1" side="tl" part="a_adj"/>
				               <lit-tag v="adj.ord"/>
				             </equal>
				           </test>
					       <out>
					         <chunk name="adj_ord" case="caseFirstWord">   <!--olämpligast - mest óviðeigandi --> 
					           <tags>
					             <tag><lit-tag v="SA"/></tag>     
					              <tag><clip pos="1" side="tl" part="gen"/></tag>
					              <tag><clip pos="1" side="tl" part="nbr"/></tag>
					            </tags>
					            <lu>
					              <clip pos="1" side="tl" part="lemh"/>
					              <lit-tag v="adj"/>
					              <lit-tag v="ord"/>
								  <lit-tag v="mfn"/>
								  <lit-tag v="sp"/>
					              <clip pos="1" side="tl" part="lemq"/>
					            </lu>
					          </chunk>
					         </out>
				         </when>

	
					         <when>
					           <test>
					             <equal>
					               <clip pos="1" side="tl" part="grau"/>
					               <lit-tag v="comp"/>
					             </equal>
					           </test>
						       <out>
						         <chunk name="adj_comp" case="caseFirstWord">    
						           <tags>
						             <tag><lit-tag v="SA"/></tag>              
						              <tag><clip pos="1" side="tl" part="grau"/></tag>
						              <tag><clip pos="1" side="tl" part="gen"/></tag>
						              <tag><clip pos="1" side="tl" part="nbr"/></tag>
						            </tags>
						            <lu>
						              <clip pos="1" side="tl" part="lemh"/>
						              <clip pos="1" side="tl" part="a_adj"/>
						              <clip pos="1" side="tl" part="grau"/>
						              <clip pos="1" side="tl" part="gen"/>
						              <clip pos="1" side="tl" part="nbr"/>
						              <clip pos="1" side="tl" part="lemq"/>
						            </lu>
						          </chunk>
						        </out>
					         </when>
			
					         <when>
					           <test>
					             <equal>
					               <clip pos="1" side="tl" part="grau"/>
					               <lit-tag v="sup"/>
					             </equal>
					           </test>
						       <out>
						         <chunk name="adj_sup" case="caseFirstWord">    
						           <tags>
						             <tag><lit-tag v="SA"/></tag>              
						              <tag><clip pos="1" side="tl" part="grau"/></tag>
						              <tag><clip pos="1" side="tl" part="gen"/></tag>
						              <tag><clip pos="1" side="tl" part="nbr"/></tag>
						              <tag><clip pos="1" side="tl" part="defnes"/></tag>
						            </tags>
						            <lu>
						              <clip pos="1" side="tl" part="lemh"/>
						              <clip pos="1" side="tl" part="a_adj"/>
						              <clip pos="1" side="tl" part="grau"/>
						              <clip pos="1" side="tl" part="gen"/>
						              <clip pos="1" side="tl" part="nbr"/>
						              <clip pos="1" side="tl" part="defnes"/>
						              <clip pos="1" side="tl" part="lemq"/>
						            </lu>
						          </chunk>
						        </out>
					         </when>
			
	
	
	
			<otherwise>
		       	<out>
		         <chunk name="adj" case="caseFirstWord">    
		           <tags>
		             <tag><lit-tag v="SA"/></tag>              
		              <!-- <clip pos="1" side="tl" part="a_adj"/>    -->    <!-- ????? tag for a_adj: MAYBE-->	
		              <tag><clip pos="1" side="tl" part="grau"/></tag>
		              <tag><clip pos="1" side="tl" part="gen"/></tag>
		              <tag><clip pos="1" side="tl" part="nbr"/></tag>
		              <tag><clip pos="1" side="tl" part="defnes"/></tag>
		            </tags>
		            <lu>
		              <clip pos="1" side="tl" part="lemh"/>
<!--		              <clip pos="1" side="tl" part="a_adj"/>    -->
					  <lit-tag v="adj"/>
		              <clip pos="1" side="tl" part="grau"/>
		              <clip pos="1" side="tl" part="gen"/>
		              <clip pos="1" side="tl" part="nbr"/>
		              <clip pos="1" side="tl" part="defnes"/>
		              <clip pos="1" side="tl" part="lemq"/>
		            </lu>
		          </chunk>
		        </out>
				</otherwise>
				</choose>
		     </action>
	</rule>


	<rule comment="REGLA: MEIRA ADJ  |  meira óskilgetinn → orättmättigare">   <!-- --> 
		     <pattern>
		       <pattern-item n="meira"/>
		       <pattern-item n="adj"/>
		     </pattern>
		     <action>
		       <call-macro n="firstWord">
		         <with-param pos="2"/>
		       </call-macro>
		       <call-macro n="conv_gender_for_adj">
		         <with-param pos="2"/>
		       </call-macro>
		       <call-macro n="conv_number_for_adj">
		         <with-param pos="2"/>
		       </call-macro>
		       <out>
		         <chunk name="meira_adj" case="caseFirstWord">    
		           <tags>
		             <tag><lit-tag v="SA"/></tag>              
		              <tag><clip pos="2" side="tl" part="grau"/></tag>
		              <tag><clip pos="2" side="tl" part="gen"/></tag>
		              <tag><clip pos="2" side="tl" part="nbr"/></tag>
		              <tag><clip pos="2" side="tl" part="defnes"/></tag>
		            </tags>
		            <lu>
		              <clip pos="2" side="tl" part="lemh"/>
		              <clip pos="2" side="tl" part="a_adj"/>
		              <lit-tag v="comp"/>
		              <clip pos="2" side="tl" part="gen" link-to="3"/>
		              <clip pos="2" side="tl" part="nbr" link-to="4"/>
		              <clip pos="2" side="tl" part="lemq"/>
		            </lu>
		          </chunk>
		        </out>
		     </action>
	</rule>








	<rule comment="regla: VCOP">    <!-- works -->
	      <pattern>
	        <pattern-item n="vcop"/>
	      </pattern>
	      <action>
	       <call-macro n="firstWord">                           
	         <with-param pos="1"/>
	       </call-macro>    
	        <call-macro n="conv_temps1">
	          <with-param pos="1"/>
	        </call-macro>
	        <out>
	          <chunk name="copula" case="caseFirstWord">
	            <tags>
	              <tag><lit-tag v="SVCOP"/></tag>
	              <tag><clip pos="1" side="tl" part="temps"/></tag>
	            </tags>
	            <lu>
	              <clip pos="1" side="tl" part="lemh"/>
	              <clip pos="1" side="tl" part="a_verb"/>
	              <clip pos="1" side="tl" part="temps"/>
	              <clip pos="1" side="tl" part="lemq"/>
	            </lu>
	          </chunk>
	        </out>
	      </action>
	 </rule>

<!--

Not working:

	<rule comment="regla: VINF | skrifa -> skriva">    
	      <pattern>
	        <pattern-item n="inf"/>
	      </pattern>
	      <action>
	        <out>
	          <chunk name="V_INF" case="caseFirstWord">
	            <tags>
	              <tag><lit-tag v="SV.INF"/></tag>
	              <tag><clip pos="1" side="tl" part="temps"/></tag>
	            </tags>
	            <lu>
	              <clip pos="1" side="tl" part="lemh"/>
	              <clip pos="1" side="tl" part="a_verb"/>
	              <clip pos="1" side="tl" part="temps"/>
	              <clip pos="1" side="tl" part="lemq"/>
	            </lu>
	          </chunk>
	        </out>
	      </action>
	 </rule>
--> 


   <rule comment="REGLA: UNDEF SG NOUN → INDEF_ART NOUN | hestur → en hest">     <!-- !!!still to be written!!!! -->
		     <pattern>
		       <pattern-item n="nom_sg_ind"/>
		     </pattern>
		     <action>
		       <call-macro n="firstWord">                            
		         <with-param pos="1"/>
		       </call-macro>    
		       <call-macro n="conv_temps1"> <!--  -->
		         <with-param pos="1"/>
		       </call-macro>
		       <call-macro n="conv_voice_mid_to_pas"> <!--  -->
		         <with-param pos="1"/>
		       </call-macro>
		       <out>
		         <chunk name="geta_komid" case="caseFirstWord">    
		           <tags>
		             <tag><lit-tag v="SV"/></tag>                

		              <!-- <clip pos="2" side="tl" part="a_verb"/>    -->    <!-- ????? tag for a_verb???-->	
		              <tag><clip pos="1" side="tl" part="temps"/></tag>
		              <tag><clip pos="1" side="tl" part="voz"/></tag>
		             <!-- <tag><clip pos="1" side="tl" part="nbr"/></tag>-->      <!-- ????? not in swedish-->
		            </tags>
		            <lu>
	                 <clip pos="1" side="tl" part="lemh"/>
	                 <clip pos="1" side="tl" part="a_verb"/>
	                 <clip pos="1" side="tl" part="temps"/>
	                 <clip pos="1" side="tl" part="lemq"/>
		            </lu>
		            <b pos="1"/>
		            <lu>
		              <clip pos="2" side="tl" part="lemh"/>
		              <clip pos="2" side="tl" part="a_verb"/>
		              <lit-tag v="inf"/>
		              <clip pos="2" side="tl" part="lemq"/>
		            </lu>
		          </chunk>
		        </out>
		     </action>
	</rule>

    <rule comment="regla: VERB_PP">
      <pattern>
        <pattern-item n="pp"/>
      </pattern>
      <action>
	      <call-macro n="conv_gender_for_pp"> 
	        <with-param pos="1"/>
	      </call-macro>
	      <call-macro n="conv_number_for_pp"> 
	        <with-param pos="1"/>
	      </call-macro>
        <out>
          <chunk name="verb_pp" case="caseFirstWord">
            <tags>
<!--              <tag><lit-tag v="SV.PP"/></tag>  -->
              	 <tag><lit-tag v="VERB_PP"/></tag>
             	 <tag><clip pos="1" side="tl" part="temps"/></tag>
	             <tag><clip pos="1" side="tl" part="gen"/></tag>
	             <tag><clip pos="1" side="tl" part="nbr"/></tag>
	             <tag><clip pos="1" side="tl" part="defnes"/></tag>
            </tags>
            <lu>
              <clip pos="1" side="tl" part="lemh"/>
              <clip pos="1" side="tl" part="a_verb"/>
              <clip pos="1" side="tl" part="temps"/>
              <clip pos="1" side="tl" part="gen" link-to="3"/>
              <clip pos="1" side="tl" part="nbr" link-to="4"/>
              <clip pos="1" side="tl" part="defnes" link-to="5"/>
              <clip pos="1" side="tl" part="lemq"/>
            </lu>
          </chunk>
        </out>
      </action>
    </rule>

<!--
	фран го откоментира  	FINITE VERB
-->
    <rule comment="regla: VFIN">
      <pattern>
        <pattern-item n="vfin"/>
      </pattern>
      <action>
        <call-macro n="conv_temps1">
          <with-param pos="1"/>
        </call-macro>
	    <call-macro n="conv_voice_mid_to_pas">                           
	         <with-param pos="1"/>
	    </call-macro>    
        <out>
          <chunk name="vfin" case="caseFirstWord">
            <tags>
              <tag><lit-tag v="SV.FIN"/></tag>
              <tag><clip pos="1" side="tl" part="voz"/></tag>
              <tag><clip pos="1" side="tl" part="temps"/></tag>
              <tag><clip pos="1" side="tl" part="pers"/></tag>
              <tag><clip pos="1" side="tl" part="nbr"/></tag>
            </tags>
            <lu>
              <clip pos="1" side="tl" part="lemh"/>
              <clip pos="1" side="tl" part="a_verb"/>
              <clip pos="1" side="tl" part="temps"/>
              <clip pos="1" side="tl" part="voz" link-to="3"/>
              <clip pos="1" side="tl" part="lemq"/>
            </lu>
          </chunk>
        </out>
      </action>
    </rule>


	<rule comment="REGLA: VERB_INF ">  
		     <pattern>
		       <pattern-item n="inf"/>
		     </pattern>
		     <action>
		       <call-macro n="firstWord">                           
		         <with-param pos="1"/>
		       </call-macro>    
		       <call-macro n="conv_voice_mid_to_pas">                           
		         <with-param pos="1"/>
		       </call-macro>    
								<!--INFINITVES að skrifa -> att skriva 
								needed to change the order of tags (actv.inf in Icelandic to inf.actv in Swedish)-->

			       <out>
			         <chunk name="verb_inf" case="caseFirstWord">   
			           <tags>
			             <tag><lit-tag v="V_INF"/></tag>     
		              	 <tag><clip pos="1" side="tl" part="temps"/></tag>
			             <tag><clip pos="1" side="tl" part="voz"/></tag>
			           </tags>
			           <lu>
			              <clip pos="1" side="tl" part="lemh"/>
			              <clip pos="1" side="tl" part="a_verb"/>
			              <clip pos="1" side="tl" part="temps"/>
			              <clip pos="1" side="tl" part="voz"/>
			              <clip pos="1" side="tl" part="lemq"/>
			            </lu>
			          </chunk>
			       </out>
		     </action>
	</rule>

	<rule comment="REGLA: VERB_SUPN">  
		     <pattern>
		       <pattern-item n="supn"/>
		     </pattern>
		     <action>
		       <call-macro n="firstWord">                           
		         <with-param pos="1"/>
		       </call-macro>    
		       <call-macro n="conv_voice_mid_to_pas">                           
		         <with-param pos="1"/>
		       </call-macro>    
								<!--supines skrifað -> skrivit 
								needed to change the order of tags (actv.inf in Icelandic to inf.actv in Swedish)-->

			       <out>
			         <chunk name="verb_supn" case="caseFirstWord">   
			           <tags>
			             <tag><lit-tag v="V_SUPN"/></tag>     
		              	 <tag><clip pos="1" side="tl" part="temps"/></tag>
			             <tag><clip pos="1" side="tl" part="voz"/></tag>
			           </tags>
			           <lu>
			              <clip pos="1" side="tl" part="lemh"/>
			              <clip pos="1" side="tl" part="a_verb"/>
			              <clip pos="1" side="tl" part="temps"/>
			              <clip pos="1" side="tl" part="voz"/>
			              <clip pos="1" side="tl" part="lemq"/>
			            </lu>
			          </chunk>
			       </out>
		     </action>
	</rule>


	<rule comment="REGLA: VERB_PPRS">  
		     <pattern>
		       <pattern-item n="pprs"/>
		     </pattern>
		     <action>
		       <call-macro n="firstWord">                           
		         <with-param pos="1"/>
		       </call-macro>    
			       <out>
			         <chunk name="verb_pprs" case="caseFirstWord">   
			           <tags>
			             <tag><lit-tag v="V_PPRS"/></tag>     
		              	 <tag><clip pos="1" side="tl" part="temps"/></tag>
			           </tags>
			           <lu>
			              <clip pos="1" side="tl" part="lemh"/>
			              <clip pos="1" side="tl" part="a_verb"/>
			              <clip pos="1" side="tl" part="temps"/>
			              <clip pos="1" side="tl" part="lemq"/>
			            </lu>
			          </chunk>
			       </out>
		     </action>
	</rule>


	<rule comment="REGLA: VERB_IMP">  
															<!-- imperative		-->
		     <pattern>
		       <pattern-item n="vimp"/>
		     </pattern>
		     <action>
		       <call-macro n="firstWord">                           
		         <with-param pos="1"/>
		       </call-macro>    
		       <call-macro n="conv_voice_mid_to_pas">                           
		         <with-param pos="1"/>
		       </call-macro>    
			       <out>
			         <chunk name="verb_imp" case="caseFirstWord">   
			           <tags>
			             <tag><lit-tag v="V_IMP"/></tag>     
		              	 <tag><clip pos="1" side="tl" part="temps"/></tag>
			           </tags>
			           <lu>
			              <clip pos="1" side="tl" part="lemh"/>
			              <clip pos="1" side="tl" part="a_verb"/>
			              <clip pos="1" side="tl" part="temps"/>
			              <clip pos="1" side="tl" part="lemq"/>
			            </lu>
			          </chunk>
			       </out>
		     </action>
	</rule>

    <rule comment="regla: num1">
      <pattern>
        <pattern-item n="en1"/>
      </pattern>
      <action>
		       <call-macro n="firstWord">
		         <with-param pos="1"/>
		       </call-macro>
		       <call-macro n="conv_gender_for_numerals">
		         <with-param pos="1"/>
		       </call-macro>
        <out>
          <chunk name="num1" case="caseFirstWord">
            <tags>
              <tag><lit-tag v="SN"/></tag>
              <tag><clip pos="1" side="tl" part="gen"/></tag>
              <tag><clip pos="1" side="tl" part="nbr"/></tag>
            </tags>
            <lu>
              <clip pos="1" side="tl" part="lemh"/>
              <clip pos="1" side="tl" part="a_num"/>
              <clip pos="1" side="tl" part="gen"/>
              <lit-tag v="3"/>
              <clip pos="1" side="tl" part="lemq"/>
            </lu>
          </chunk>
        </out>
      </action>
    </rule>


    <rule comment="regla: num">
      <pattern>
        <pattern-item n="num"/>
      </pattern>
      <action>
		       <call-macro n="firstWord">
		         <with-param pos="1"/>
		       </call-macro>
        <out>
          <chunk name="num" case="caseFirstWord">
            <tags>
              <tag><lit-tag v="SNUM"/></tag>
              <tag><clip pos="1" side="tl" part="gen"/></tag>
              <tag><clip pos="1" side="tl" part="nbr"/></tag>
              <tag><clip pos="1" side="tl" part="defnes"/></tag>
            </tags>
            <lu>
              <clip pos="1" side="tl" part="lemh"/>
              <clip pos="1" side="tl" part="a_num"/>
              <lit-tag v="mfn"/>
              <lit-tag v="3"/>
              <lit-tag v="4"/>
              <clip pos="1" side="tl" part="lemq"/>
            </lu>
          </chunk>
        </out>
      </action>
    </rule>

<!-- the number 1 einn -> en -->



	<rule comment="regla: prn_pers">
	  <pattern>
	    <pattern-item n="prn_personal"/>
	  </pattern>
	  <action>
		       <call-macro n="firstWord">
		         <with-param pos="1"/>
		       </call-macro>
		       <call-macro n="conv_case_for_pronouns">
		         <with-param pos="1"/>
		       </call-macro>
	    <out>
	      <chunk name="prn_pers" case="caseFirstWord">
	        <tags>
	          <tag><lit-tag v="PRN_PERS"/></tag>
	          <tag><clip pos="1" side="tl" part="cas"/></tag>
	          <tag><clip pos="1" side="tl" part="pers"/></tag>
	          <tag><clip pos="1" side="tl" part="gen"/></tag>
	          <tag><clip pos="1" side="tl" part="nbr"/></tag>
	        </tags>
	        <lu>
	          <clip pos="1" side="tl" part="lemh"/>
	          <clip pos="1" side="tl" part="a_prn"/>
              <clip pos="1" side="tl" part="cas"/>
              <clip pos="1" side="tl" part="pers"/>
              <clip pos="1" side="tl" part="gen"/>
              <clip pos="1" side="tl" part="nbr"/>
	          <clip pos="1" side="tl" part="lemq"/>
	        </lu>
	      </chunk>
	    </out>
	  </action>
	</rule>


	<rule comment="regla: prn_sig_ref">
	  <pattern>
	    <pattern-item n="prn_sig_ref"/>
	  </pattern>
	  <action>
		       <call-macro n="firstWord">
		         <with-param pos="1"/>
		       </call-macro>
	    <out>
	      <chunk name="prn_ref" case="caseFirstWord">
	        <tags>
	          <tag><lit-tag v="PRN_REF"/></tag>
	          <tag><clip pos="1" side="tl" part="pers"/></tag>
	          <tag><clip pos="1" side="tl" part="gen"/></tag>
	          <tag><clip pos="1" side="tl" part="nbr"/></tag>
	        </tags>
	        <lu>
	          <clip pos="1" side="tl" part="lemh"/>
	          <clip pos="1" side="tl" part="a_prn"/>
              <clip pos="1" side="tl" part="pers"/>
              <clip pos="1" side="tl" part="gen"/>
              <clip pos="1" side="tl" part="nbr"/>
	          <clip pos="1" side="tl" part="lemq"/>
	        </lu>
	      </chunk>
	    </out>
	  </action>
	</rule>

	<rule comment="regla: prn_sjálfur_ref">
	  <pattern>
	    <pattern-item n="prn_sjálfur_ref"/>
	  </pattern>
	  <action>
		       <call-macro n="firstWord">
		         <with-param pos="1"/>
		       </call-macro>
		       <call-macro n="conv_gender_for_reflexive_pronouns">
		         <with-param pos="1"/>
		       </call-macro>
	    <out>
	      <chunk name="prn_ref" case="caseFirstWord">
	        <tags>
	          <tag><lit-tag v="PRN_REF"/></tag>
	          <tag><clip pos="1" side="tl" part="gen"/></tag>
	          <tag><clip pos="1" side="tl" part="nbr"/></tag>
	        </tags>
	        <lu>
	          <clip pos="1" side="tl" part="lemh"/>
	          <clip pos="1" side="tl" part="a_prn"/>
              <clip pos="1" side="tl" part="gen"/>
              <clip pos="1" side="tl" part="nbr"/>
	          <clip pos="1" side="tl" part="lemq"/>
	        </lu>
	      </chunk>
	    </out>
	  </action>
	</rule>


	<rule comment="regla: prn_annan_ref">
	  <pattern>
	    <pattern-item n="prn_annan_ref"/>
	  </pattern>
	  <action>
		       <call-macro n="firstWord">
		         <with-param pos="1"/>
		       </call-macro>
	    <out>
	      <chunk name="prn_ref" case="caseFirstWord">
	        <tags>
	          <tag><lit-tag v="PRN_REF"/></tag>
              <tag><lit-tag v="mfn"/></tag>
              <tag><lit-tag v="pl"/></tag>
              <tag><lit-tag v="nom"/></tag>
	        </tags>
	        <lu>
	          <clip pos="1" side="tl" part="lemh"/>
	          <clip pos="1" side="tl" part="a_prn"/>
              <lit-tag v="mfn"/>
              <lit-tag v="pl"/>
              <lit-tag v="nom"/>
	          <clip pos="1" side="tl" part="lemq"/>
	        </lu>
	      </chunk>
	    </out>
	  </action>
	</rule>


	<rule comment="regla: prn_possesive_hans">
	  <pattern>
	    <pattern-item n="prn_possessive_hans"/>
	  </pattern>
	  <action>
		       <call-macro n="firstWord">
		         <with-param pos="1"/>
		       </call-macro>
	    <out>
	      <chunk name="poss_prn" case="caseFirstWord">
	        <tags>
	          <tag><lit-tag v="PRN_POSSESSIVE"/></tag>
	          <tag><clip pos="1" side="tl" part="cas"/></tag>
	          <tag><clip pos="1" side="tl" part="gen"/></tag>
	          <tag><clip pos="1" side="tl" part="nbr"/></tag>
	        </tags>
	        <lu>
	          <clip pos="1" side="tl" part="lemh"/>
	          <clip pos="1" side="tl" part="a_prn"/>
              <clip pos="1" side="tl" part="gen"/>
              <clip pos="1" side="tl" part="nbr"/>
	          <clip pos="1" side="tl" part="lemq"/>
	        </lu>
	      </chunk>
	    </out>
	  </action>
	</rule>


	<rule comment="regla: prn_possesive">
	  <pattern>
	    <pattern-item n="prn_possessive"/>
	  </pattern>
	  <action>
		       <call-macro n="firstWord">
		         <with-param pos="1"/>
		       </call-macro>
		       <call-macro n="conv_gender_for_possessive_pronouns">
		         <with-param pos="1"/>
		       </call-macro>
	    <out>
	      <chunk name="poss_prn" case="caseFirstWord">
	        <tags>
	          <tag><lit-tag v="PRN_POSSESSIVE"/></tag>
	          <tag><clip pos="1" side="tl" part="cas"/></tag>
	          <tag><clip pos="1" side="tl" part="gen"/></tag>
	          <tag><clip pos="1" side="tl" part="nbr"/></tag>
	        </tags>
	        <lu>
	          <clip pos="1" side="tl" part="lemh"/>
	          <clip pos="1" side="tl" part="a_prn"/>
              <clip pos="1" side="tl" part="gen"/>
              <clip pos="1" side="tl" part="nbr"/>
	          <clip pos="1" side="tl" part="lemq"/>
	        </lu>
	      </chunk>
	    </out>
	  </action>
	</rule>

	<rule comment="regla: prn_demonstrative">
	  <pattern>
	    <pattern-item n="prn_demonstrative"/>
	  </pattern>
	  <action>
		       <call-macro n="firstWord">
		         <with-param pos="1"/>
		       </call-macro>
		       <call-macro n="conv_gender_for_reflexive_pronouns">
		         <with-param pos="1"/>
		       </call-macro>
	    <out>
	      <chunk name="dem_prn" case="caseFirstWord">
	        <tags>
	          <tag><lit-tag v="PRN_DEMONSTRATIVE"/></tag>
	          <tag><clip pos="1" side="tl" part="gen"/></tag>
	          <tag><clip pos="1" side="tl" part="nbr"/></tag>
	        </tags>
	        <lu>
	          <clip pos="1" side="tl" part="lemh"/>
	          <clip pos="1" side="tl" part="a_prn"/>
              <clip pos="1" side="tl" part="gen"/>
              <clip pos="1" side="tl" part="nbr"/>
	          <clip pos="1" side="tl" part="lemq"/>
	        </lu>
	      </chunk>
	    </out>
	  </action>
	</rule>

	<rule comment="regla: prn_quantitative">
	  <pattern>
	    <pattern-item n="prn_quantitative"/>
	  </pattern>
	  <action>
		       <call-macro n="firstWord">
		         <with-param pos="1"/>
		       </call-macro>
		       <call-macro n="conv_gender_for_quantitative_pronouns">
		         <with-param pos="1"/>
		       </call-macro>
	    <out>
	      <chunk name="quant_prn" case="caseFirstWord">
	        <tags>
	          <tag><lit-tag v="PRN_QUANTITATIVE"/></tag>
	          <tag><clip pos="1" side="tl" part="gen"/></tag>
	          <tag><clip pos="1" side="tl" part="nbr"/></tag>
              <tag><lit-tag v="nom"/></tag>
	          <tag><clip pos="1" side="tl" part="defnes"/></tag>
	        </tags>
	        <lu>
	          <clip pos="1" side="tl" part="lemh"/>
	          <clip pos="1" side="tl" part="a_prn"/>
              <clip pos="1" side="tl" part="gen"/>
              <clip pos="1" side="tl" part="nbr"/>
              <lit-tag v="4"/>
              <clip pos="1" side="tl" part="defnes"/>
	          <clip pos="1" side="tl" part="lemq"/>
	        </lu>
	      </chunk>
	    </out>
	  </action>
	</rule>


<!-- a rule that transfers hvaða to vilken. One of the few cases where an Icelandic word is less morphologically complex than the Swedish one. I have chosen ut.sg as the default generation.-->
<rule comment="regla: prn_interrogative_hvaða">
  <pattern>
    <pattern-item n="prn_interrogative_hvaða"/>
  </pattern>
  <action>
	       <call-macro n="firstWord">
	         <with-param pos="1"/>
	       </call-macro>
    <out>
      <chunk name="itg_prn" case="caseFirstWord">
        <tags>
          <tag><lit-tag v="PRN_INTERROGATIVE"/></tag>
          <tag><lit-tag v="ut"/></tag>
          <tag><lit-tag v="sg"/></tag>
        </tags>
        <lu>
          <clip pos="1" side="tl" part="lemh"/>
          <clip pos="1" side="tl" part="a_prn"/>
          <lit-tag v="2"/>
          <lit-tag v="3"/>
          <clip pos="1" side="tl" part="lemq"/>
        </lu>
      </chunk>
    </out>
  </action>
</rule>


	<rule comment="regla: prn_interrogative">
	  <pattern>
	    <pattern-item n="prn_interrogative"/>
	  </pattern>
	  <action>
		       <call-macro n="firstWord">
		         <with-param pos="1"/>
		       </call-macro>
		       <call-macro n="conv_gender_for_reflexive_pronouns">
		         <with-param pos="1"/>
		       </call-macro>
		       <call-macro n="conv_case2">
		         <with-param pos="1"/>
		       </call-macro>
	    <out>
	      <chunk name="itg_prn" case="caseFirstWord">
	        <tags>
	          <tag><lit-tag v="PRN_INTERROGATIVE"/></tag>
	          <tag><clip pos="1" side="tl" part="gen"/></tag>
	          <tag><clip pos="1" side="tl" part="nbr"/></tag>
	          <tag><clip pos="1" side="tl" part="cas"/></tag>
	        </tags>
	        <lu>
	          <clip pos="1" side="tl" part="lemh"/>
	          <clip pos="1" side="tl" part="a_prn"/>
              <clip pos="1" side="tl" part="gen"/>
              <clip pos="1" side="tl" part="nbr"/>
              <clip pos="1" side="tl" part="cas"/>
	          <clip pos="1" side="tl" part="lemq"/>
	        </lu>
	      </chunk>
	    </out>
	  </action>
	</rule>

	<rule comment="regla: prn_indefinite">
	  <pattern>
	    <pattern-item n="prn_indefinite"/>
	  </pattern>
	  <action>
		       <call-macro n="firstWord">
		         <with-param pos="1"/>
		       </call-macro>
		       <call-macro n="conv_gender_for_possessive_pronouns">
		         <with-param pos="1"/>
		       </call-macro>
		       <call-macro n="conv_case2">
		         <with-param pos="1"/>
		       </call-macro>
	    <out>
	      <chunk name="indef_prn" case="caseFirstWord">
	        <tags>
	          <tag><lit-tag v="PRN_INDEFINITE"/></tag>
	          <tag><clip pos="1" side="tl" part="gen"/></tag>
	          <tag><clip pos="1" side="tl" part="nbr"/></tag>
	          <tag><clip pos="1" side="tl" part="cas"/></tag>
	        </tags>
	        <lu>
	          <clip pos="1" side="tl" part="lemh"/>
	          <clip pos="1" side="tl" part="a_prn"/>
              <clip pos="1" side="tl" part="gen"/>
              <clip pos="1" side="tl" part="nbr"/>
              <clip pos="1" side="tl" part="cas"/>
	          <clip pos="1" side="tl" part="lemq"/>
	        </lu>
	      </chunk>
	    </out>
	  </action>
	</rule>





    <!-- TO BE CHECKED!!!!-->

    <!-- Sintagmas nominales -->

<!--    <rule comment="regla: num">
      <pattern>
        <pattern-item n="num"/>
      </pattern>
      <action>
        <out>
          <chunk name="num" case="caseFirstWord">
            <tags>
              <tag><lit-tag v="SN"/></tag>
              <tag><clip pos="1" side="tl" part="gen"/></tag>
              <tag><clip pos="1" side="tl" part="nbr"/></tag>
            </tags>
            <lu>
              <clip pos="1" side="tl" part="lemh"/>
              <clip pos="1" side="tl" part="a_num"/>
              <clip pos="1" side="tl" part="gen" link-to="2"/>
              <clip pos="1" side="tl" part="nbr" link-to="3"/>
              <clip pos="1" side="tl" part="lemq"/>
            </lu>
          </chunk>
        </out>
      </action>
    </rule>


    <rule comment="regla: nom">
      <pattern>
        <pattern-item n="nom"/>
      </pattern>
      <action>
        <call-macro n="conv_case1">
          <with-param pos="1"/>
        </call-macro>
        <out>
          <chunk name="nom" case="caseFirstWord">
            <tags>
              <tag><lit-tag v="SN"/></tag> 
              <tag><clip pos="1" side="tl" part="gen"/></tag>
              <tag><clip pos="1" side="tl" part="nbr"/></tag>
              <tag><clip pos="1" side="tl" part="defnes"/></tag>
              <tag><clip pos="1" side="tl" part="cas"/></tag>
            </tags>
            <lu>
              <clip pos="1" side="tl" part="lemh"/>
              <clip pos="1" side="tl" part="a_nom"/>
              <clip pos="1" side="tl" part="gen" link-to="2"/>
              <clip pos="1" side="tl" part="nbr" link-to="3"/>
              <clip pos="1" side="tl" part="defnes" link-to="5"/>
              <clip pos="1" side="tl" part="cas" link-to="4"/>
              <clip pos="1" side="tl" part="lemq"/>
            </lu>
          </chunk>
        </out>
      </action>
    </rule>



    <rule comment="regla: inf">
      <pattern>
        <pattern-item n="inf"/>
      </pattern>
      <action>
        <out>
          <chunk name="inf" case="caseFirstWord">
            <tags>
              <tag><lit-tag v="SV.INF"/></tag>
              <tag><clip pos="1" side="tl" part="voz"/></tag>
            </tags>
            <lu>
              <clip pos="1" side="tl" part="lemh"/>
              <clip pos="1" side="tl" part="a_verb"/>
              <clip pos="1" side="tl" part="temps"/>
              <clip pos="1" side="tl" part="voz" link-to="3"/>
              <clip pos="1" side="tl" part="lemq"/>
            </lu>
          </chunk>
        </out>
      </action>
    </rule>

    <rule comment="regla: vbhaver_inf">
      <pattern>
        <pattern-item n="vbhaver_inf"/>
      </pattern>
      <action>
        <out>
          <chunk name="vfin" case="caseFirstWord">
            <tags>
              <tag><lit-tag v="SV.INF.actv"/></tag>
            </tags>
            <lu>
              <clip pos="1" side="tl" part="lemh"/>
              <clip pos="1" side="tl" part="a_verb"/>
              <clip pos="1" side="tl" part="temps"/>
              <lit-tag v="3"/>
              <clip pos="1" side="tl" part="lemq"/>
            </lu>
          </chunk>
        </out>
      </action>
    </rule>

    <rule comment="regla: vbhaver_fin">
      <pattern>
        <pattern-item n="vbhaver_fin"/>
      </pattern>
      <action>
        <call-macro n="conv_temps1">
          <with-param pos="1"/>
        </call-macro>
        <out>
          <chunk name="vfin" case="caseFirstWord">
            <tags>
              <tag><lit-tag v="SV.FIN.actv"/></tag>
              <tag><clip pos="1" side="tl" part="temps"/></tag>
              <tag><clip pos="1" side="tl" part="pers"/></tag>
              <tag><clip pos="1" side="tl" part="nbr"/></tag>
            </tags>
            <lu>
              <clip pos="1" side="tl" part="lemh"/>
              <clip pos="1" side="tl" part="a_verb"/>
              <clip pos="1" side="tl" part="temps"/>
              <lit-tag v="3"/>
              <clip pos="1" side="tl" part="lemq"/>
            </lu>
          </chunk>
        </out>
      </action>
    </rule>


    <rule comment="regla: vimp">
      <pattern>
        <pattern-item n="vimp"/>
      </pattern>
      <action>
        <call-macro n="conv_temps1">
          <with-param pos="1"/>
        </call-macro>
        <out>
          <chunk name="vfin" case="caseFirstWord">
            <tags>
              <tag><lit-tag v="SV.FIN"/></tag>
              <tag><clip pos="1" side="tl" part="voz"/></tag>
              <tag><clip pos="1" side="tl" part="temps"/></tag>
              <tag><clip pos="1" side="tl" part="pers"/></tag>
              <tag><clip pos="1" side="tl" part="nbr"/></tag>
            </tags>
            <lu>
              <clip pos="1" side="tl" part="lemh"/>
              <clip pos="1" side="tl" part="a_verb"/>
              <clip pos="1" side="tl" part="temps"/>
              <clip pos="1" side="tl" part="lemq"/>
            </lu>
          </chunk>
        </out>
      </action>
    </rule>
-->

  </section-rules>
</transfer>
