<?xml version="1.0" encoding="utf-8"?>
<!--
Danish Disambiguation Rules for LanguageTool Copyright (C) 2012 Henrik Bendt
See disambiguation.xsd for syntax.
-->
<rules lang="da" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="../../../../../../../../../languagetool-core/src/main/resources/org/languagetool/resource/disambiguation.xsd">
    <rulegroup id="sub-pron" name="pron+sub→sub">
    <rule>  <!-- To be removed when tag art (artikler) works-->
      <pattern>
        <token regexp="yes">en|et|den|det|de|nogle|noget|alle|ingen</token>
        <marker>
          <and>
            <token postag_regexp="yes" postag="pron:.*"/>
            <token postag_regexp="yes" postag="sub:.*"><exception negate_pos="yes"  postag_regexp="yes" postag="pron:.*|sub:.*"/></token>
          </and>
        </marker>
      </pattern>
      <disambig action="filter" postag="sub:.*"/>
      <example type="ambiguous" inputform="jeg[jeg/pron:sin:nom,jeg/sub:ube:sin:neu:nom]" outputform="jeg[jeg/sub:ube:sin:neu:nom]">Et <marker>jeg</marker> er interresant.</example>
      <example type="untouched">Hvem er du?</example>
      <example type="untouched">Hunden løb hurtigt.</example>
      <example type="untouched">Et stort jeg kan være i alle mennesker.</example>
      <example type="untouched">Et, jeg er beskriver en selv, to, noget andet.</example>
    </rule>
    <rule>  
      <pattern>
        <token postag_regexp="yes" postag="pron:.*"><exception negate_pos="yes" postag_regexp="yes" postag="pron:.*"/></token>
        <marker>
          <and>
            <token postag_regexp="yes" postag="pron:.*"/>
            <token postag_regexp="yes" postag="sub:.*"><exception negate_pos="yes"  postag_regexp="yes" postag="pron:.*|sub:.*"/></token>
          </and>
        </marker>
      </pattern>
      <disambig action="filter" postag="sub:.*"/>
      <example type="ambiguous" inputform="jeg[jeg/pron:sin:nom,jeg/sub:ube:sin:neu:nom]" outputform="jeg[jeg/sub:ube:sin:neu:nom]">Mig <marker>jeg</marker> er meget interessant.</example>
      <example type="untouched">Kan jeg springe langt?</example>
      <example type="untouched">Hunden løb hurtigt.</example>
      <example type="untouched">Jeg kan hoppe højt.</example>
    </rule>
    <!-- Mangler nogle ord tagget som artikler (eks. 'en')
    <rule>  
      <pattern>
        <token postag="art"/>
        <marker>
          <and>
            <token postag_regexp="yes" postag="pron:.*"/>
            <token postag_regexp="yes" postag="sub:.*"><exception negate_pos="yes" postag="pron:.*|sub:.*" postag_regexp="yes"/></token>
          </and>
        </marker>
      </pattern>
      <disambig postag="sub:.*"></disambig>
    </rule> --><!-- Mangler adjektiver!!! Som lille
    <rule>
      <pattern>
        <token regexp="yes">en|et|den|det|de|nogle|noget|alle|ingen</token>
        <token postag_regexp="yes" postag="adj:.*" skip="-1"><exception scope="next" negate_pos="yes" postag_regexp="yes" postag="adj:.*|sub:.*"/></token>
        <marker>
          <and>
            <token postag_regexp="yes" postag="pron:.*"/>
            <token postag_regexp="yes" postag="sub:.*"><exception negate_pos="yes" postag="pron:.*|sub:.*" postag_regexp="yes"/></token>
          </and>
        </marker>
      </pattern>
      <disambig action="filter" postag="sub:.*"/>
      <example type="ambiguous" inputform="jeg[jeg/sub:ube:sin:neu:nom, jeg/pron:sin:nom]" outputform="jeg[jeg/sub:ube:sin:neu:nom]">Et lille <marker>jeg</marker> kan også være interessant.</example>
      <example type="untouched">Hvem er du?</example>
      <example type="untouched">Hunden løb hurtigt.</example>
      <example type="untouched">En stor hund kan være stor.</example>
    </rule>-->
  </rulegroup>
  <rulegroup id="sub-ver" name="sub+ver→sub"> <!-- Verbum må ikke være passiv! "En spørger er/kan/gør/vil...", "Et jeg er/kan/gør/vil/skal..." -->
    <rule>
      <pattern>
        <token regexp="yes">en|et|den|det|de|nogle|noget|alle|ingen</token> <!-- evt. udskift m. bestemt type ord, når et sådan er tagget - udksift med 'art'! -->
        <marker>
          <and>
            <token postag_regexp="yes" postag="ver:.*"/>
            <token postag_regexp="yes" postag="sub:.*"><exception negate_pos="yes" postag_regexp="yes" postag="ver:.*|sub:.*"/></token>
          </and>
        </marker>
        <token postag_regexp="yes" postag="ver:.*"><exception postag_regexp="yes" postag="ver:.*:pas"/></token>
      </pattern>
      <disambig action="filter" postag="sub:.*"/>
      <example type="ambiguous" inputform="skal[skal/sub:ube:sin:utr:nom,skulle/ver:præ:akt]" outputform="skal[skal/sub:ube:sin:utr:nom]">En <marker>skal</marker> er spist af en fugl.</example>
      <example type="untouched">Hvem er du?</example>
      <example type="untouched">Hunden løb hurtigt.</example>
      <example type="untouched">En hund kan være alle størrelser.</example>
      <example type="untouched">En skal blive noget stort.</example>
    </rule> 
    <rule>
      <pattern>
        <token regexp="yes">en|et|den|det|de|nogle|noget|alle|ingen</token>
        <token postag_regexp="yes" postag="adj:.*" skip="-1"><exception scope="next" negate_pos="yes" postag_regexp="yes" postag="adj:.*|sub:.*|ver:.*"/></token>
        <marker>
          <and>
            <token postag_regexp="yes" postag="ver:.*"/>
            <token postag_regexp="yes" postag="sub:.*"><exception negate_pos="yes" postag_regexp="yes" postag="ver:.*|sub:.*"/></token>
          </and>
        </marker>
        <token postag_regexp="yes" postag="ver:.*"><exception postag_regexp="yes" postag="ver:.*:pas"/></token>
      </pattern>
      <disambig action="filter" postag="sub:.*"/> 
      <example type="ambiguous" inputform="skal[skal/sub:ube:sin:utr:nom,skulle/ver:præ:akt]" outputform="skal[skal/sub:ube:sin:utr:nom]">En stor <marker>skal</marker> er spist.</example>
      <example type="ambiguous" inputform="skal[skal/sub:ube:sin:utr:nom,skulle/ver:præ:akt]" outputform="skal[skal/sub:ube:sin:utr:nom]">En lille stor <marker>skal</marker> er interesseret i hvad du siger.</example>
      <example type="untouched">Hvem er du?</example>
      <example type="untouched">Hunden løb hurtigt.</example>
      <example type="untouched">En hund kan være alle størrelser.</example>
      <example type="untouched">En lille hund er lille.</example>
    </rule>
    <rule>
      <pattern>
          <token postag_regexp="yes" postag="sub:.*:gen|pro:.*"/>
        <marker>
          <and>
            <token postag_regexp="yes" postag="ver:.*"/>
            <token postag_regexp="yes" postag="sub:.*"><exception negate_pos="yes" postag_regexp="yes" postag="ver:.*|sub:.*"/></token>
          </and>
        </marker>
        <token postag_regexp="yes" postag="ver:.*"><exception postag_regexp="yes" postag="ver:.*:pas|ver:inf:akt"/></token>
      </pattern>
      <disambig action="filter" postag="sub:.*"/>
      <example type="ambiguous" inputform="skal[skal/sub:ube:sin:utr:nom,skulle/ver:præ:akt]" outputform="skal[skal/sub:ube:sin:utr:nom]">Hundens <marker>skal</marker> skal fiske i havet.</example>
      <example type="ambiguous" inputform="skal[skal/sub:ube:sin:utr:nom,skulle/ver:præ:akt]" outputform="skal[skal/sub:ube:sin:utr:nom]">Min <marker>skal</marker> skal fiske i havet.</example>
      <example type="untouched">Vi skal fiske.</example>
      <example type="untouched">Du skal gå en tur.</example>
      <example type="untouched">Jeg skal skal gå.</example>
    </rule>
  </rulegroup>
  <rulegroup id="ver-sub" name="sub+ver→ver">
    <rule>
      <pattern>
          <token regexp="yes">en|et|den|det|de|nogle|noget|alle|ingen</token>
          <token postag_regexp="yes" postag="sub:.*"><exception postag_regexp="yes" postag="sub:.*:gen"/></token>
        <marker>
          <and>
            <token postag_regexp="yes" postag="ver:.*"/>
            <token postag_regexp="yes" postag="sub:.*"><exception negate_pos="yes" postag_regexp="yes" postag="ver:.*|sub:.*"/></token>
          </and>
        </marker>
        <token><exception postag_regexp="yes" postag="ver:.*"/></token>
      </pattern>
      <disambig action="filter" postag="ver:.*"/>
      <example type="ambiguous" inputform="skal[skal/sub:ube:sin:utr:nom,skulle/ver:præ:akt]" outputform="skal[skulle/ver:præ:akt]">En skal <marker>skal</marker> noget.</example>
      <example type="untouched">Hans skals skal er hård.</example>
    </rule>
    <rule>
      <pattern>
          <token postag_regexp="yes" postag="pron:.*|pro:.*|sub:.*:gen"/>
          <token postag_regexp="yes" postag="sub:.*"><exception postag_regexp="yes" postag="sub:.*:gen"/></token>
        <marker>
          <and>
            <token postag_regexp="yes" postag="ver:.*"/>
            <token postag_regexp="yes" postag="sub:ube:sin:utr:nom"><exception negate_pos="yes" postag_regexp="yes" postag="ver:.*|sub:ube:sin:utr:nom"/></token>
          </and>
        </marker>
      </pattern>
      <disambig action="filter" postag="ver:.*"/>
      <example type="ambiguous" inputform="skal[skal/sub:ube:sin:utr:nom,skulle/ver:præ:akt]" outputform="skal[skulle/ver:præ:akt]">Hans skal <marker>skal</marker> noget.</example>
      <example type="ambiguous" inputform="skal[skal/sub:ube:sin:utr:nom,skulle/ver:præ:akt]" outputform="skal[skulle/ver:præ:akt]">Min skal <marker>skal</marker> noget.</example>
      <example type="ambiguous" inputform="skal[skal/sub:ube:sin:utr:nom,skulle/ver:præ:akt]" outputform="skal[skulle/ver:præ:akt]">Hundens skal <marker>skal</marker> noget.</example>
      <example type="untouched">Hans skals skal er hård.</example>
    </rule>
    <rule>
      <pattern>
          <token postag_regexp="yes" postag="sub:.*|pron:.*|pro:.*"/>
        <marker>
          <and>
            <token postag_regexp="yes" postag="ver:.*"/>
            <token postag_regexp="yes" postag="sub:.*"><exception negate_pos="yes" postag_regexp="yes" postag="ver:.*|sub:.*"/></token>
          </and>
        </marker>
        <token postag="ver:inf:akt"><exception negate_pos="yes" postag="ver:inf:akt"/></token>
      </pattern>
      <disambig action="filter" postag="ver:.*"/>
      <example type="ambiguous" inputform="skal[skal/sub:ube:sin:utr:nom,skulle/ver:præ:akt]" outputform="skal[skulle/ver:præ:akt]">Vi <marker>skal</marker> fiske.</example>
      <example type="untouched">En skal er hård.</example>
      <example type="untouched">Du skal gå en tur.</example>
    </rule>
    <rule>
      <pattern>
        <marker>
          <and>
            <token postag_regexp="yes" postag="ver:.*"/>
            <token postag_regexp="yes" postag="sub:.*"><exception negate_pos="yes" postag_regexp="yes" postag="ver:.*|sub:.*"/></token>
          </and>
        </marker>
        <token postag_regexp="yes" postag="sub:.*"><exception negate_pos="yes" postag_regexp="yes" postag="sub:.*"/></token>
      </pattern>
      <disambig action="filter" postag="ver:.*"/>
      <example type="ambiguous" inputform="skal[skal/sub:ube:sin:utr:nom,skulle/ver:præ:akt]" outputform="skal[skulle/ver:præ:akt]">Udenfor <marker>skal</marker> hunden snakke med ham.</example>
      <example type="untouched">Vi skal fiske.</example>
      <example type="untouched">Du skal gå en tur.</example>
    </rule>
    <rule>
      <pattern>
        <marker>
          <and>
            <token postag_regexp="yes" postag="ver:.*"/>
            <token postag_regexp="yes" postag="sub:.*"><exception negate_pos="yes" postag_regexp="yes" postag="ver:.*|sub:.*"/><exception postag_regexp="yes" postag="sub:bes:.*"/></token>
          </and>
        </marker>
        <token postag_regexp="yes" postag="pron:.*"/>
        <token postag_regexp="yes" postag="ver:.*|art:.*"><exception negate_pos="yes" postag_regexp="yes" postag="ver:.*|art:.*"/></token>
      </pattern>
      <disambig action="filter" postag="ver:.*"/>
      <example type="ambiguous" inputform="Skal[skal/sub:ube:sin:utr:nom,skulle/ver:præ:akt]" outputform="Skal[skulle/ver:præ:akt]"><marker>Skal</marker> jeg sejle til dig?</example>
      <example type="untouched">Vi skal fiske.</example>
      <example type="untouched">En skal jeg kender er hård.</example>
    </rule>
    <rule>
      <pattern>
        <token postag_regexp="yes" postag="sub:.*"><exception postag_regexp="yes" postag="sub:.*:gen"/></token>
        <marker>
          <and>
            <token postag_regexp="yes" postag="ver:.*"/>
            <token postag_regexp="yes" postag="sub:.*"><exception negate_pos="yes" postag_regexp="yes" postag="ver:.*|sub:.*"/><exception postag_regexp="yes" postag="sub:bes:.*"/></token>
          </and>
        </marker>
        <token postag_regexp="yes" postag="pron:.*"/>
        <token postag_regexp="yes" postag="ver:.*|art:.*"><exception negate_pos="yes" postag_regexp="yes" postag="ver:.*|art:.*"/></token>
      </pattern>
      <disambig action="filter" postag="ver:.*"/>
      <example type="ambiguous" inputform="skal[skal/sub:ube:sin:utr:nom,skulle/ver:præ:akt]" outputform="skal[skulle/ver:præ:akt]">Hunden <marker>skal</marker> jeg sejle til.</example>
      <example type="untouched">Vi skal fiske.</example>
      <example type="untouched">En skal jeg kender er hård.</example>
      <example type="untouched">Hundens skal jeg kender fra tidligere, er hård.</example>
    </rule>
    <rule>
      <pattern>
        <token postag_regexp="yes" postag="sub:.*"><exception postag_regexp="yes" postag="sub.*:gen"/></token>
        <marker>
          <and>
            <token postag_regexp="yes" postag="ver:.*"/>
            <token postag_regexp="yes" postag="sub:.*"><exception negate_pos="yes" postag_regexp="yes" postag="ver:.*|sub:.*"/><exception postag_regexp="yes" postag="sub:bes:.*"/></token>
          </and>
        </marker>
        <token postag_regexp="yes" postag="pron:.*"/>
      </pattern>
      <disambig action="filter" postag="ver:.*"/>
      <example type="ambiguous" inputform="skal[skal/sub:ube:sin:utr:nom,skulle/ver:præ:akt]" outputform="skal[skulle/ver:præ:akt]">Portvin <marker>skal</marker> jeg også se på.</example>
      <example type="untouched">Vi skal fiske.</example>
      <example type="untouched">En skal jeg kender er hård.</example>
    </rule>
  </rulegroup>
  <rulegroup id="pron-sub" name="pron+sub→pron">
    <rule>
      <pattern>
        <marker>
          <and>
            <token postag_regexp="yes" postag="pron:.*"/>
            <token postag_regexp="yes" postag="sub:.*"><exception negate_pos="yes" postag_regexp="yes" postag="pron:.*|sub:.*"/></token>
          </and>
        </marker>  
        <token postag_regexp="yes" postag="ver:.*"/>
        <token><exception postag_regexp="yes" postag="ver:.*"/></token>
      </pattern>
      <disambig action="filter" postag="pron:.*"/>
      <example type="ambiguous" inputform="Jeg[jeg/pron:sin:nom,jeg/sub:ube:sin:neu:nom]" outputform="Jeg[jeg/pron:sin:nom]"><marker>Jeg</marker> er mig!</example>
      <example type="untouched">Du kan gøre det.</example>
      <example type="untouched">Dette er urørt!</example>
      <example type="untouched">Jeg skal fisker i havet</example> <!-- "Jeg" skal udskiftes med "En" når "en" er tagget -->
    </rule> 
  </rulegroup>
</rules>
