<?xml version="1.0" encoding="utf-8"?>
<transfer default="chunk">
<section-def-cats>
<!-- compound lhs's are never genitive: -->
<def-cat n="ncmp">
<cat-item tags="n.*.cmp"/>
<cat-item tags="n.*.cmp.guio"/>
<cat-item tags="np.*.cmp"/>
<cat-item tags="np.*.cmp.guio"/>
</def-cat>
<def-cat n="nind">
<cat-item tags="n.*.*.ind"/>
<cat-item tags="n.*.*.ind.gen"/>
</def-cat>
<!-- n does not include compound lhs's: -->
<def-cat n="n_np">
<cat-item tags="n.*.cmp-split"/>
<cat-item tags="n.*.def"/>
<cat-item tags="n.*.ind"/>
<cat-item tags="n.*.acr"/>
<cat-item tags="n.*.sp"/>
<cat-item tags="n.*.gen"/>
<cat-item tags="np.*.cmp-split"/>
<cat-item tags="np.*.gen"/>
<cat-item tags="np.*.gen.guio"/>
<cat-item tags="np.top"/>
<cat-item tags="np.top.f"/>
<cat-item tags="np.top.m"/>
<cat-item tags="np.top.nt"/>
<cat-item tags="np.org"/>
<cat-item tags="np.org.f"/>
<cat-item tags="np.org.m"/>
<cat-item tags="np.org.nt"/>
<cat-item tags="np.ant"/>
<cat-item tags="np.ant.f"/>
<cat-item tags="np.ant.m"/>
<cat-item tags="np.ant.nt"/>
<cat-item tags="np.cgguess"/>
<cat-item tags="np.guess"/>
<cat-item tags="np.cog"/>
<cat-item tags="np.al"/>
<cat-item tags="np.attr"/>
</def-cat>
<def-cat n="nacr">
<cat-item tags="n.acr"/>
</def-cat>
<def-cat n="ndef">
<cat-item tags="n.*.*.def"/>
<cat-item tags="n.*.*.def.gen"/>
</def-cat>
<def-cat n="ngen">
<cat-item tags="n.*.*.*.gen"/>
</def-cat>
<def-cat n="det">
<cat-item tags="det.*"/>
</def-cat>
<def-cat n="prn">
<cat-item tags="prn.*"/>
</def-cat>
<def-cat n="detpos">
<cat-item tags="det.pos.*"/>
</def-cat>
<def-cat n="detnonpos">
<cat-item tags="det.def.*"/>
<cat-item tags="det.dem.*"/>
<cat-item tags="det.emph.*"/>
<cat-item tags="det.itg.*"/>
<cat-item tags="det.qnt.*"/>
</def-cat>
<def-cat n="posgen">
<cat-item tags="det.pos.*"/>
<cat-item tags="n.*.*.*.gen"/>
</def-cat>
<def-cat n="adj">
<cat-item tags="adj.*"/>
</def-cat>
<def-cat n="preadj-adv">
<cat-item lemma="ikke" tags="adv"/>
<cat-item lemma="for" tags="adv"/>
<cat-item lemma="altfor" tags="adv"/>
<cat-item lemma="forholdsvis" tags="adv"/>
<cat-item lemma="forhåpentlig" tags="adv"/>
<cat-item lemma="forholdsvis" tags="adv"/>
<cat-item lemma="hvor" tags="adv"/>
<cat-item lemma="kanon" tags="adv"/>
<cat-item lemma="sørpe" tags="adv"/>
<cat-item lemma="bom" tags="adv"/>
<cat-item lemma="dønn" tags="adv"/>
<cat-item lemma="eitrende" tags="adv"/>
<cat-item lemma="forhakkende" tags="adv"/>
<cat-item lemma="fullstendig" tags="adv"/>
<cat-item lemma="delvis" tags="adv"/>
</def-cat>
<def-cat n="adjind">
<cat-item tags="adj.*.*.*.ind"/>
<cat-item tags="adj.*.pl"/>
<cat-item tags="adj.comp.*"/>
<cat-item tags="adj.sint.comp.*"/>
<cat-item tags="adj.pprs"/> <!--hvor truende-->
</def-cat>
<def-cat n="adv">
<cat-item tags="adv"/>
</def-cat>
<def-cat n="infm">
<cat-item lemma="Ã¥" tags="part"/>
</def-cat>
<def-cat n="sin">
<cat-item lemma="sin" tags="det.pos.*"/>
</def-cat>
<def-cat n="måte">
<cat-item lemma="måte" tags="n.m.sg.ind"/>
</def-cat>
<def-cat n="vblex">
<cat-item tags="vblex.*"/>
</def-cat>
<def-cat n="vblexpp">
<cat-item tags="vblex.pp"/>
<cat-item tags="vblex.pp.*"/>
</def-cat>
<def-cat n="vblexinf">
<cat-item tags="vblex.inf"/>
</def-cat>
<def-cat n="vblexinfpass">
<cat-item tags="vblex.inf.pasv"/>
</def-cat>
<def-cat n="vblexpass">
<cat-item tags="vblex.*.pasv"/>
<cat-item tags="vblex.pstv.pres"/>
</def-cat>
<def-cat n="vblex_kan">
<cat-item lemma="kunne" tags="vblex.*"/>
</def-cat>
<def-cat n="vblex_bli">
<cat-item lemma="bli" tags="vblex.*"/>
<cat-item lemma="verte" tags="vblex.*"/>
</def-cat>
<def-cat n="vblex_brukt">
<cat-item lemma="bruke" tags="vblex.pp"/>
<cat-item lemma="bruke" tags="adj.pp.*"/>
<cat-item lemma="nytte" tags="vblex.pp"/>
<cat-item lemma="nytte" tags="adj.pp.*"/>
</def-cat>
</section-def-cats>
<section-def-attrs>
<def-attr n="a_nom">
<attr-item tags="n"/>
<attr-item tags="n.acr"/>
<attr-item tags="np"/>
<attr-item tags="np.top"/>
</def-attr>
<def-attr n="persona">
<attr-item tags="p1"/>
<attr-item tags="p2"/>
<attr-item tags="p3"/>
</def-attr>
<def-attr n="a_verb">
<attr-item tags="vblex"/>
<attr-item tags="vblex.pstv"/>
</def-attr>
<def-attr n="temps">
<attr-item tags="inf"/>
<attr-item tags="imp"/>
<attr-item tags="pres"/>
<attr-item tags="pret"/>
<attr-item tags="pp"/>
</def-attr>
<def-attr n="voice">
<attr-item tags="pasv"/>
</def-attr>
<def-attr n="a_det">
<attr-item tags="det"/>
<attr-item tags="det.emph"/>
<attr-item tags="det.dem"/>
<attr-item tags="det.itg"/>
<attr-item tags="det.qnt"/>
<attr-item tags="det.qnt.neg"/>
<attr-item tags="det.pos"/>
</def-attr>
<def-attr n="a_adj">
<attr-item tags="adj"/>
<attr-item tags="adj.pp"/>
<attr-item tags="adj.pprs"/>
<attr-item tags="adj.ord"/>
<attr-item tags="adj.sint"/>
</def-attr>
<def-attr n="grau">
<attr-item tags="pst"/>
<attr-item tags="comp"/>
<attr-item tags="sup"/>
</def-attr>
<def-attr n="gen">
<attr-item tags="m"/>
<attr-item tags="mf"/>
<attr-item tags="nt"/>
<attr-item tags="f"/>
<attr-item tags="GD"/>
</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="cas">
<attr-item tags="nom"/>
<attr-item tags="gen"/>
<attr-item tags="acc"/>
<attr-item tags="CD"/>
</def-attr>
<def-attr n="art">
<attr-item tags="def"/>
<attr-item tags="ind"/>
</def-attr>
</section-def-attrs>
<section-def-vars>
<def-var n="gen-prep"/>
<def-var n="caseFirstWord"/>
<def-var n="c_name" c="chunk name"/>
<def-var n="ntags"/>
<def-var n="aux"/>
<def-var n="blank"/>
<def-var n="grau_aux" c="lexical unit containing meir/mest if translating from sint to non-sint"/>
</section-def-vars>
<section-def-lists>
<def-list n="det_indef">
<!-- feels like these should have their own
sub-pos... «<det><dem> som kan ha <ind> etter seg på
bokmål» -->
<list-item v="denne"/>
<list-item v="disse"/>
<list-item v="dette"/>
<list-item v="den"/>
<list-item v="de"/>
</def-list>
</section-def-lists>
<section-def-macros>
<def-macro n="set_ntags" npar="1"
c="arg.1: noun. Puts tags of noun in ntags (for use as chunk tags)">
<let><var n="ntags"/><clip pos="1" side="tl" part="tags"/></let>
</def-macro>
<def-macro n="switch_cases" npar="2">
<choose>
<when>
<test><not>
<and>
<equal><clip pos="2" side="tl" part="lemh"/><lit v="De"/></equal>
<equal><clip pos="2" side="tl" part="a_det"/><lit-tag v="det.pos"/></equal>
<equal><clip pos="2" side="tl" part="persona"/><lit-tag v="p2"/></equal>
</and>
</not></test>
<let><var n="caseFirstWord"/><get-case-from pos="1"><clip pos="1" side="tl" part="lemh"/></get-case-from></let>
<let><clip pos="1" side="tl" part="lemh"/><get-case-from pos="2"><clip pos="1" side="tl" part="lemh"/></get-case-from></let>
<modify-case><clip pos="2" side="tl" part="lemh"/><var n="caseFirstWord"/></modify-case>
</when>
</choose>
</def-macro>
<def-macro n="set_caseFirstWord" npar="1">
<let><var n="caseFirstWord"/><get-case-from pos="1"><lit v="aa"/></get-case-from></let>
<modify-case><clip pos="1" side="tl" part="lemh"/><lit v="aa"/></modify-case>
</def-macro>
<def-macro n="set_caseFirstWord2" npar="2">
<!-- arg.1: possessed noun. arg.2: det.pos, gives typographic case -->
<choose>
<when>
<test><not>
<and>
<equal><clip pos="2" side="tl" part="lemh"/><lit v="De"/></equal>
<equal><clip pos="2" side="tl" part="a_det"/><lit-tag v="det.pos"/></equal>
<equal><clip pos="2" side="tl" part="persona"/><lit-tag v="p2"/></equal>
</and>
</not></test>
<let><var n="caseFirstWord"/><get-case-from pos="2"><lit v="aa"/></get-case-from></let>
<modify-case><clip pos="1" side="tl" part="lemh"/><lit v="aa"/></modify-case>
</when>
</choose>
</def-macro>
<!-- Macros which set concordance variables: -->
<def-macro n="set_gender1.adj" npar="1"
c="arg.1: adj">
<choose><when>
<test><or>
<equal><clip pos="1" side="tl" part="gen"/><lit-tag v="m"/></equal>
<equal><clip pos="1" side="tl" part="gen"/><lit-tag v="f"/></equal>
<equal><clip pos="1" side="tl" part="gen"/><lit-tag v="GD"/></equal>
</or></test>
<let><clip pos="1" side="tl" part="gen"/><lit-tag v="mf"/></let>
</when></choose>
</def-macro>
<def-macro n="set_gender2.n.adj" npar="2"
c="arg.1: noun, arg.2: adjective
Only take noun gender if adj is GD (in which case we may have adj.f in nn.dix),
or if noun has changed gender (if not GD, don't allow adj.f as target).
(We want to allow 'helt.nt svart.mf katt.m', no gender change nor GD on 'helt',
but o/w make sure adj corresponds: 'helt.nt forfatterskap => heil.mf forfattarskap')">
<choose><when>
<test><or>
<equal><clip pos="2" side="tl" part="gen"/><lit-tag v="GD"/></equal>
<and>
<not><equal><clip pos="1" side="sl" part="gen"/><clip pos="1" side="tl" part="gen"/></equal></not>
<not><equal><clip pos="1" side="tl" part="gen"/><lit-tag v="f"/></equal></not>
</and>
</or></test>
<let><clip pos="2" side="tl" part="gen"/><clip pos="1" side="tl" part="gen"/></let>
</when></choose>
<call-macro n="set_gender1.adj"><with-param pos="2"/></call-macro>
</def-macro>
<def-macro n="set_grau_aux1" npar="1"
c="arg.1: adjective
When translating from sint to non-sint, put «meir/mest» in grau_aux-variable.
Assumes c_name has been set!">
<choose>
<when>
<test><and>
<equal><clip pos="1" side="sl" part="a_adj"/><lit-tag v="adj.sint"/></equal>
<not><equal><clip pos="1" side="tl" part="a_adj"/><lit-tag v="adj.sint"/></equal></not>
<or>
<equal><clip pos="1" side="tl" part="grau"/><lit-tag v="comp"/></equal>
<equal><clip pos="1" side="tl" part="grau"/><lit-tag v="sup"/></equal>
</or>
</and></test>
<let>
<var n="grau_aux"/>
<concat>
<lit v="^mye"/>
<lit-tag v="adj"/>
<lit-tag v="sint"/>
<clip pos="1" side="tl" part="grau"/>
<lit-tag v="un"/>
<lit-tag v="sp"/>
</concat>
</let>
<choose><when>
<test><equal><clip pos="1" side="tl" part="grau"/><lit-tag v="sup"/></equal></test>
<append n="grau_aux"><lit-tag v="ind"/></append>
</when></choose>
<append n="grau_aux"><lit v="$ "/></append>
<let>
<var n="c_name"/>
<concat>
<lit v="adj_"/>
<var n="c_name"/>
</concat>
</let>
<choose>
<when>
<test><equal><clip pos="1" side="sl" part="art"/><lit-tag v="def"/></equal></test>
<let><clip pos="1" side="tl" part="tags"/><lit-tag v="adj.pst.un.sp.def"/></let>
</when>
<otherwise>
<let><clip pos="1" side="tl" part="tags"/><lit-tag v="adj.pst.nt.sg.ind"/></let>
</otherwise>
</choose>
</when>
<otherwise>
<let>
<var n="grau_aux"/><lit v=""/>
</let>
</otherwise>
</choose>
</def-macro>
<def-macro n="set_grau_aux2" npar="2"
c="arg.1: adjective arg.2: adjective
When translating from «meir/mest» non-sint to sint, remove «meir/mest», empty grau_aux-variable.
When translating from (first arg) sint to non-sint, put «meir/mest» in grau_aux-variable.
Assumes c_name has been set!">
<choose>
<when>
<test><and>
<equal><clip pos="1" side="tl" part="lemh"/><lit v="mykje"/></equal>
<or>
<equal><clip pos="1" side="tl" part="grau"/><lit-tag v="comp"/></equal>
<equal><clip pos="1" side="tl" part="grau"/><lit-tag v="sup"/></equal>
</or>
<not><equal><clip pos="2" side="sl" part="a_adj"/><lit-tag v="adj.sint"/></equal></not>
<equal><clip pos="2" side="tl" part="a_adj"/><lit-tag v="adj.sint"/></equal>
</and></test>
<!-- The second adj is synthetic, so copy tags from first adj: -->
<let><clip pos="2" side="tl" part="tags"/><clip pos="1" side="tl" part="tags"/></let>
<!-- And delete the first (meir/mest) adj: -->
<let><clip pos="1" side="tl" part="whole"/><lit v=""/></let>
<let><var n="grau_aux"/><lit v=""/></let>
</when>
<otherwise>
<!-- Or maybe we want to _add_ meir/mest: -->
<call-macro n="set_grau_aux1"><with-param pos="1"/></call-macro>
<!-- and fix tags on the second adj (but no new aux if only second adj is non-pst; TODO better) -->
<choose><when>
<test><and>
<equal><clip pos="2" side="sl" part="a_adj"/><lit-tag v="adj.sint"/></equal>
<not><equal><clip pos="2" side="tl" part="a_adj"/><lit-tag v="adj.sint"/></equal></not>
<or>
<equal><clip pos="2" side="tl" part="grau"/><lit-tag v="comp"/></equal>
<equal><clip pos="2" side="tl" part="grau"/><lit-tag v="sup"/></equal>
</or>
</and></test>
<choose>
<when>
<test><equal><clip pos="2" side="sl" part="art"/><lit-tag v="def"/></equal></test>
<let><clip pos="2" side="tl" part="tags"/><lit-tag v="adj.pst.un.sp.def"/></let>
</when>
<otherwise>
<let><clip pos="2" side="tl" part="tags"/><lit-tag v="adj.pst.nt.sg.ind"/></let>
</otherwise>
</choose>
</when></choose>
</otherwise>
</choose>
</def-macro>
</section-def-macros>
<section-rules>
<rule comment="VBLEX">
<pattern>
<pattern-item n="vblex"/>
</pattern>
<action>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<let><var n="c_name"/><lit v="vblex"/></let>
<choose><when>
<test><or>
<equal><clip pos="1" side="tl" part="lemh"/><lit v="bli"/></equal>
<equal><clip pos="1" side="tl" part="lemh"/><lit v="vere"/></equal>
</or></test>
<let><var n="c_name"/><lit v="aux"/></let>
</when></choose>
<out>
<chunk namefrom="c_name" case="caseFirstWord">
<tags><tag><clip pos="1" side="tl" part="tags"/></tag></tags>
<lu>
<clip pos="1" side="tl" part="lemh"/>
<clip pos="1" side="tl" part="tags"/>
<clip pos="1" side="tl" part="lemq"/>
</lu>
</chunk>
</out>
</action>
</rule>
<rule comment="INFM">
<pattern>
<pattern-item n="infm"/>
</pattern>
<action>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<out>
<chunk name="infm" case="caseFirstWord">
<tags>
<tag><clip pos="1" side="tl" part="tags"/></tag>
</tags>
<lu>
<clip pos="1" side="tl" part="whole"/>
</lu>
</chunk>
</out>
</action>
</rule>
<rule comment="ADV">
<pattern>
<pattern-item n="adv"/>
</pattern>
<action>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<out>
<chunk name="adv" case="caseFirstWord">
<tags>
<tag><clip pos="1" side="tl" part="tags"/></tag>
</tags>
<lu>
<clip pos="1" side="tl" part="whole"/>
</lu>
</chunk>
</out>
</action>
</rule>
<!-- Catch wrong bracketing: -->
<rule comment="preadj-ADV ADJIND
Ikkje: «altså kvinnelig [vektløfting]»">
<pattern>
<pattern-item n="preadj-adv"/>
<pattern-item n="adjind"/>
</pattern>
<action>
<!-- c_name setting after set_grau_aux since adv first in chunk -->
<call-macro n="set_gender1.adj"><with-param pos="2"/></call-macro>
<call-macro n="set_grau_aux1"><with-param pos="2"/></call-macro>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<choose>
<when>
<test>
<not><equal><var n="grau_aux"/><lit v=""/></equal></not>
</test>
<let><var n="c_name"/><lit v="adv_adj_adj"/></let>
</when>
<otherwise>
<let><var n="c_name"/><lit v="adv_adj"/></let>
</otherwise>
</choose>
<out>
<chunk namefrom="c_name" case="caseFirstWord">
<tags><tag><clip pos="2" side="tl" part="tags"/></tag></tags>
<lu><clip pos="1" side="tl" part="whole"/></lu>
<b pos="1"/>
<var n="grau_aux"/>
<lu>
<clip pos="2" side="tl" part="lemh"/>
<clip pos="2" side="tl" part="tags"/>
<clip pos="2" side="tl" part="lemq"/>
</lu>
</chunk>
</out>
</action>
</rule>
<!-- Nouns -->
<!-- N+ -->
<rule comment="N
Remove cas from lu, but put it in chunk">
<pattern>
<pattern-item n="n_np"/>
</pattern>
<action>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<call-macro n="set_ntags"><with-param pos="1"/></call-macro>
<out>
<chunk name="n" case="caseFirstWord">
<tags><tag><var n="ntags"/></tag></tags>
<lu><clip pos="1" side="tl" part="whole"/></lu>
</chunk>
</out>
</action>
</rule>
<rule comment="NCMP N: ytelse ytelse => ytingsyting
Remove the space that pretransfer added">
<pattern>
<pattern-item n="ncmp"/>
<pattern-item n="n_np"/>
</pattern>
<action>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<call-macro n="set_ntags"><with-param pos="2"/></call-macro>
<out>
<chunk name="n_n" case="caseFirstWord">
<tags><tag><var n="ntags"/></tag></tags>
<lu><clip pos="1" side="tl" part="whole"/></lu>
<lu><clip pos="2" side="tl" part="whole"/></lu>
</chunk>
</out>
</action>
</rule>
<rule comment="NCMP NCMP N: Falk lands krigen => Falklandskrigen">
<pattern>
<pattern-item n="ncmp"/>
<pattern-item n="ncmp"/>
<pattern-item n="n_np"/>
</pattern>
<action>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<call-macro n="set_ntags"><with-param pos="3"/></call-macro>
<out>
<chunk name="n_n_n" case="caseFirstWord">
<tags><tag><var n="ntags"/></tag></tags>
<lu><clip pos="1" side="tl" part="whole"/></lu>
<lu><clip pos="2" side="tl" part="whole"/></lu>
<lu><clip pos="3" side="tl" part="whole"/></lu>
</chunk>
</out>
</action>
</rule>
<rule comment="NCMP NCMP NCMP N">
<pattern>
<pattern-item n="ncmp"/>
<pattern-item n="ncmp"/>
<pattern-item n="ncmp"/>
<pattern-item n="n_np"/>
</pattern>
<action>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<call-macro n="set_ntags"><with-param pos="4"/></call-macro>
<out>
<chunk name="n_n_n_n" case="caseFirstWord">
<tags><tag><var n="ntags"/></tag></tags>
<lu><clip pos="1" side="tl" part="whole"/></lu>
<lu><clip pos="2" side="tl" part="whole"/></lu>
<lu><clip pos="3" side="tl" part="whole"/></lu>
<lu><clip pos="4" side="tl" part="whole"/></lu>
</chunk>
</out>
</action>
</rule>
<!-- ADJ N+ -->
<rule comment="ADJ N">
<pattern>
<pattern-item n="adj"/>
<pattern-item n="n_np"/>
</pattern>
<action>
<!-- TODO: add this when it's accepted in trunk/apertium: -->
<!-- <exception> -->
<!-- <test> -->
<!-- <and> -->
<!-- <equal><clip pos="1" side="tl" part="art"/><lit-tag v="ind"/></equal> -->
<!-- <equal><clip pos="2" side="tl" part="art"/><lit-tag v="def"/></equal> -->
<!-- </and> -->
<!-- </test> -->
<!-- </exception> -->
<let><var n="c_name"/><lit v="adj_n"/></let>
<call-macro n="set_gender2.n.adj"><with-param pos="2"/><with-param pos="1"/></call-macro>
<call-macro n="set_grau_aux1"><with-param pos="1"/></call-macro>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<call-macro n="set_ntags"><with-param pos="2"/></call-macro>
<out>
<chunk namefrom="c_name" case="caseFirstWord">
<tags><tag><var n="ntags"/></tag></tags>
<var n="grau_aux"/>
<lu>
<clip pos="1" side="tl" part="lemh"/>
<clip pos="1" side="tl" part="tags"/>
<clip pos="1" side="tl" part="lemq"/>
</lu>
<b pos="1"/>
<lu><clip pos="2" side="tl" part="whole"/></lu>
</chunk>
</out>
</action>
</rule>
<rule comment="ADJ NCMP N">
<pattern>
<pattern-item n="adj"/>
<pattern-item n="ncmp"/>
<pattern-item n="n_np"/>
</pattern>
<action>
<let><var n="c_name"/><lit v="adj_n_n"/></let>
<call-macro n="set_gender2.n.adj"><with-param pos="3"/><with-param pos="1"/></call-macro>
<call-macro n="set_grau_aux1"><with-param pos="1"/></call-macro>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<call-macro n="set_ntags"><with-param pos="3"/></call-macro>
<out>
<chunk namefrom="c_name" case="caseFirstWord">
<tags><tag><var n="ntags"/></tag></tags>
<var n="grau_aux"/>
<lu>
<clip pos="1" side="tl" part="lemh"/>
<clip pos="1" side="tl" part="tags"/>
<clip pos="1" side="tl" part="lemq"/>
</lu>
<b pos="1"/>
<lu><clip pos="2" side="tl" part="whole"/></lu>
<lu><clip pos="3" side="tl" part="whole"/></lu>
</chunk>
</out>
</action>
</rule>
<rule comment="ADJ NCMP NCMP N">
<pattern>
<pattern-item n="adj"/>
<pattern-item n="ncmp"/>
<pattern-item n="ncmp"/>
<pattern-item n="n_np"/>
</pattern>
<action>
<let><var n="c_name"/><lit v="adj_n_n_n"/></let>
<call-macro n="set_gender2.n.adj"><with-param pos="4"/><with-param pos="1"/></call-macro>
<call-macro n="set_grau_aux1"><with-param pos="1"/></call-macro>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<call-macro n="set_ntags"><with-param pos="4"/></call-macro>
<out>
<chunk namefrom="c_name" case="caseFirstWord">
<tags><tag><var n="ntags"/></tag></tags>
<var n="grau_aux"/>
<lu>
<clip pos="1" side="tl" part="lemh"/>
<clip pos="1" side="tl" part="tags"/>
<clip pos="1" side="tl" part="lemq"/>
</lu>
<b pos="1"/>
<lu><clip pos="2" side="tl" part="whole"/></lu>
<lu><clip pos="3" side="tl" part="whole"/></lu>
<lu><clip pos="4" side="tl" part="whole"/></lu>
</chunk>
</out>
</action>
</rule>
<rule comment="ADJ NCMP NCMP NCMP N">
<pattern>
<pattern-item n="adj"/>
<pattern-item n="ncmp"/>
<pattern-item n="ncmp"/>
<pattern-item n="ncmp"/>
<pattern-item n="n_np"/>
</pattern>
<action>
<let><var n="c_name"/><lit v="adj_n_n_n_n"/></let>
<call-macro n="set_gender2.n.adj"><with-param pos="5"/><with-param pos="1"/></call-macro>
<call-macro n="set_grau_aux1"><with-param pos="1"/></call-macro>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<call-macro n="set_ntags"><with-param pos="5"/></call-macro>
<out>
<chunk namefrom="c_name" case="caseFirstWord">
<tags><tag><var n="ntags"/></tag></tags>
<var n="grau_aux"/>
<lu>
<clip pos="1" side="tl" part="lemh"/>
<clip pos="1" side="tl" part="tags"/>
<clip pos="1" side="tl" part="lemq"/>
</lu>
<b pos="1"/>
<lu><clip pos="2" side="tl" part="whole"/></lu>
<lu><clip pos="3" side="tl" part="whole"/></lu>
<lu><clip pos="4" side="tl" part="whole"/></lu>
<lu><clip pos="5" side="tl" part="whole"/></lu>
</chunk>
</out>
</action>
</rule>
<!-- ADJ ADJ N+ -->
<rule comment="ADJ ADJ N">
<pattern>
<pattern-item n="adj"/>
<pattern-item n="adj"/>
<pattern-item n="n_np"/>
</pattern>
<action>
<let><var n="c_name"/><lit v="adj_adj_n"/></let>
<call-macro n="set_gender2.n.adj"><with-param pos="3"/><with-param pos="1"/></call-macro>
<call-macro n="set_gender2.n.adj"><with-param pos="3"/><with-param pos="2"/></call-macro>
<call-macro n="set_grau_aux2"><with-param pos="1"/><with-param pos="2"/></call-macro>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<call-macro n="set_ntags"><with-param pos="3"/></call-macro>
<choose><when>
<!-- set_grau_aux2 may have removed the first adj: -->
<test><equal><clip pos="1" side="tl" part="whole"/><lit v=""/></equal></test>
<let><var n="c_name"/><lit v="adj_n"/></let>
</when></choose>
<out>
<chunk namefrom="c_name" case="caseFirstWord">
<tags><tag><var n="ntags"/></tag></tags>
<var n="grau_aux"/>
<lu>
<clip pos="1" side="tl" part="lemh"/>
<clip pos="1" side="tl" part="tags"/>
<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="tags"/>
<clip pos="2" side="tl" part="lemq"/>
</lu>
<b pos="2"/>
<lu><clip pos="3" side="tl" part="whole"/></lu>
</chunk>
</out>
</action>
</rule>
<rule comment="ADJ ADJ NCMP N">
<pattern>
<pattern-item n="adj"/>
<pattern-item n="adj"/>
<pattern-item n="ncmp"/>
<pattern-item n="n_np"/>
</pattern>
<action>
<let><var n="c_name"/><lit v="adj_adj_n_n"/></let>
<call-macro n="set_gender2.n.adj"><with-param pos="4"/><with-param pos="1"/></call-macro>
<call-macro n="set_gender2.n.adj"><with-param pos="4"/><with-param pos="2"/></call-macro>
<call-macro n="set_grau_aux2"><with-param pos="1"/><with-param pos="2"/></call-macro>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<call-macro n="set_ntags"><with-param pos="4"/></call-macro>
<choose><when>
<!-- set_grau_aux2 may have removed the first adj: -->
<test><equal><clip pos="1" side="tl" part="whole"/><lit v=""/></equal></test>
<let><var n="c_name"/><lit v="adj_n_n"/></let>
</when></choose>
<out>
<chunk namefrom="c_name" case="caseFirstWord">
<tags><tag><var n="ntags"/></tag></tags>
<var n="grau_aux"/>
<lu>
<clip pos="1" side="tl" part="lemh"/>
<clip pos="1" side="tl" part="tags"/>
<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="tags"/>
<clip pos="2" side="tl" part="lemq"/>
</lu>
<b pos="2"/>
<lu><clip pos="3" side="tl" part="whole"/></lu>
<lu><clip pos="4" side="tl" part="whole"/></lu>
</chunk>
</out>
</action>
</rule>
<rule comment="ADJ ADJ NCMP NCMP N">
<pattern>
<pattern-item n="adj"/>
<pattern-item n="adj"/>
<pattern-item n="ncmp"/>
<pattern-item n="ncmp"/>
<pattern-item n="n_np"/>
</pattern>
<action>
<let><var n="c_name"/><lit v="adj_adj_n_n_n"/></let>
<call-macro n="set_gender2.n.adj"><with-param pos="5"/><with-param pos="1"/></call-macro>
<call-macro n="set_gender2.n.adj"><with-param pos="5"/><with-param pos="2"/></call-macro>
<call-macro n="set_grau_aux2"><with-param pos="1"/><with-param pos="2"/></call-macro>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<call-macro n="set_ntags"><with-param pos="5"/></call-macro>
<choose><when>
<!-- set_grau_aux2 may have removed the first adj: -->
<test><equal><clip pos="1" side="tl" part="whole"/><lit v=""/></equal></test>
<let><var n="c_name"/><lit v="adj_n_n_n"/></let>
</when></choose>
<out>
<chunk namefrom="c_name" case="caseFirstWord">
<tags><tag><var n="ntags"/></tag></tags>
<var n="grau_aux"/>
<lu>
<clip pos="1" side="tl" part="lemh"/>
<clip pos="1" side="tl" part="tags"/>
<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="tags"/>
<clip pos="2" side="tl" part="lemq"/>
</lu>
<b pos="2"/>
<lu><clip pos="3" side="tl" part="whole"/></lu>
<lu><clip pos="4" side="tl" part="whole"/></lu>
<lu><clip pos="5" side="tl" part="whole"/></lu>
</chunk>
</out>
</action>
</rule>
<rule comment="ADJ ADJ NCMP NCMP NCMP N">
<pattern>
<pattern-item n="adj"/>
<pattern-item n="adj"/>
<pattern-item n="ncmp"/>
<pattern-item n="ncmp"/>
<pattern-item n="ncmp"/>
<pattern-item n="n_np"/>
</pattern>
<action>
<let><var n="c_name"/><lit v="adj_adj_n_n_n_n"/></let>
<call-macro n="set_gender2.n.adj"><with-param pos="6"/><with-param pos="1"/></call-macro>
<call-macro n="set_gender2.n.adj"><with-param pos="6"/><with-param pos="2"/></call-macro>
<call-macro n="set_grau_aux2"><with-param pos="1"/><with-param pos="2"/></call-macro>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<call-macro n="set_ntags"><with-param pos="6"/></call-macro>
<choose><when>
<!-- set_grau_aux2 may have removed the first adj: -->
<test><equal><clip pos="1" side="tl" part="whole"/><lit v=""/></equal></test>
<let><var n="c_name"/><lit v="adj_n_n_n_n"/></let>
</when></choose>
<out>
<chunk namefrom="c_name" case="caseFirstWord">
<tags><tag><var n="ntags"/></tag></tags>
<var n="grau_aux"/>
<lu>
<clip pos="1" side="tl" part="lemh"/>
<clip pos="1" side="tl" part="tags"/>
<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="tags"/>
<clip pos="2" side="tl" part="lemq"/>
</lu>
<b pos="2"/>
<lu><clip pos="3" side="tl" part="whole"/></lu>
<lu><clip pos="4" side="tl" part="whole"/></lu>
<lu><clip pos="5" side="tl" part="whole"/></lu>
<lu><clip pos="6" side="tl" part="whole"/></lu>
</chunk>
</out>
</action>
</rule>
<!-- ADJ, no noun -->
<rule comment="ADJ">
<pattern>
<pattern-item n="adj"/>
</pattern>
<action>
<let><var n="c_name"/><lit v="adj"/></let>
<call-macro n="set_gender1.adj"><with-param pos="1"/></call-macro>
<call-macro n="set_grau_aux1"><with-param pos="1"/></call-macro>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<out>
<chunk namefrom="c_name" case="caseFirstWord">
<tags><tag><clip pos="1" side="tl" part="tags"/></tag></tags>
<var n="grau_aux"/>
<lu>
<clip pos="1" side="tl" part="lemh"/>
<clip pos="1" side="tl" part="tags"/>
<clip pos="1" side="tl" part="lemq"/>
</lu>
</chunk>
</out>
</action>
</rule>
<rule comment="ADJ ADJ">
<pattern>
<pattern-item n="adj"/>
<pattern-item n="adj"/>
</pattern>
<action>
<let><var n="c_name"/><lit v="adj_adj"/></let>
<call-macro n="set_gender1.adj"><with-param pos="1"/></call-macro>
<call-macro n="set_gender1.adj"><with-param pos="2"/></call-macro>
<call-macro n="set_grau_aux2"><with-param pos="1"/><with-param pos="2"/></call-macro>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<choose><when>
<!-- set_grau_aux2 may have removed the first adj: -->
<test><equal><clip pos="1" side="tl" part="whole"/><lit v=""/></equal></test>
<let><var n="c_name"/><lit v="adj"/></let>
</when></choose>
<out>
<chunk namefrom="c_name" case="caseFirstWord">
<tags><tag><clip pos="2" side="tl" part="tags"/></tag></tags>
<var n="grau_aux"/>
<lu>
<clip pos="1" side="tl" part="lemh"/>
<clip pos="1" side="tl" part="tags"/>
<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="tags"/>
<clip pos="2" side="tl" part="lemq"/>
</lu>
</chunk>
</out>
</action>
</rule>
<!-- Other classes -->
<rule comment="DET">
<pattern>
<pattern-item n="det"/>
</pattern>
<action>
<choose>
<when>
<test><in caseless="yes"><clip pos="1" side="sl" part="lem"/><list n="det_indef"/></in></test>
<let><var n="c_name"/><lit v="detdd"/></let>
</when>
<when>
<test><equal caseless="yes"><clip pos="1" side="tl" part="lemh"/><lit v="sin"/></equal></test>
<let><var n="c_name"/><lit v="detsin"/></let>
</when>
<otherwise><let><var n="c_name"/><lit v="det"/></let></otherwise>
</choose>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<out>
<chunk namefrom="c_name" case="caseFirstWord">
<tags><tag><clip pos="1" side="tl" part="tags"/></tag></tags>
<lu><clip pos="1" side="tl" part="whole"/></lu>
</chunk>
</out>
</action>
</rule>
<rule comment="PRN">
<pattern>
<pattern-item n="prn"/>
</pattern>
<action>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<out>
<chunk name="prn" case="caseFirstWord">
<tags><tag><clip pos="1" side="tl" part="tags"/></tag></tags>
<lu><clip pos="1" side="tl" part="whole"/></lu>
</chunk>
</out>
</action>
</rule>
<!-- Idiomatic rules: -->
<rule comment="KAN BLI BRUKT">
<pattern>
<pattern-item n="vblex_kan"/>
<pattern-item n="vblex_bli"/>
<pattern-item n="vblex_brukt"/>
</pattern>
<action>
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro>
<choose c="merge blanks">
<when>
<test><equal><b pos="1"/><lit v=" "/></equal></test>
<let><var n="blank"/><b pos="2"/></let>
</when>
<when>
<test><equal><b pos="2"/><lit v=" "/></equal></test>
<let><var n="blank"/><b pos="1"/></let>
</when>
<otherwise>
<let><var n="blank"/><concat><b pos="1"/><b pos="2"/></concat></let>
</otherwise>
</choose>
<out>
<chunk name="aux" case="caseFirstWord">
<tags><tag><clip pos="1" side="tl" part="tags"/></tag></tags>
<lu>
<clip pos="1" side="tl" part="lemh"/>
<clip pos="1" side="tl" part="tags"/>
<clip pos="1" side="tl" part="lemq"/>
</lu>
</chunk>
<var n="blank"/>
<chunk name="vblex" case="caseFirstWord">
<tags>
<tag><lit-tag v="vblex"/></tag>
<tag><lit-tag v="inf"/></tag>
<tag><lit-tag v="pasv"/></tag>
</tags>
<lu>
<lit v="bruke"/>
<lit-tag v="vblex"/>
<lit-tag v="inf"/>
<lit-tag v="pasv"/>
</lu>
</chunk>
</out>
</action>
</rule>
</section-rules>
</transfer>