<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../../../../../../../../../languagetool-core/src/main/resources/org/languagetool/rules/print.xsl" title="Pretty print" ?>
<?xml-stylesheet type="text/css" href="../../../../../../../../../languagetool-core/src/main/resources/org/languagetool/rules/rules.css" title="Easy editing stylesheet" ?>

    <!--
 Portuguese (Portugal - prereform + postreform) - Grammar and Typo Rules for LanguageTool.
 Copyright © 2016-2021 Tiago F. Santos (tiagofsantos81@sapo.pt)
 Copyright © 2021 Marco A.G.Pinto (www.marcoagpinto.com)

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA

-->
  <!DOCTYPE rules [
    <!ENTITY meses_ano_abrev "jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez">
    <!ENTITY meses_ano "janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro">
    <!ENTITY dias_semana_abrev "seg|ter|qua|qui|sex|sáb|dom">
    <!ENTITY dias_semana "segunda|terça|quarta|quinta|sexta|sábado|domingo">
    <!ENTITY expressoes_de_tempo "(?:minuto|hora|dia|se(?:gundo|mana|mestre)|(?:bi|tri|quadri)mestre|ano|d(?:écada|ecénio)|mil[éê]nio|temp(?:o|orada)|época)s?|m(?:ês|eses)">

    <!ENTITY contracoes_MS "ao|do|dum|dele|deste|desse|daquele|disto|disso|daquilo|doutro|no|num|nele|nesse|neste|naquele|nisto|nisso|naquilo|noutro|pelo|algum|mo|to|lho">
    <!ENTITY contracoes_FS "à|da|duma|dela|desta|dessa|daquela|doutra|na|numa|nela|nessa|nesta|naquela|noutra|pela|alguma|ma|ta|lha">
    <!ENTITY contracoes_MP "aos|dos|duns|deles|destes|desses|daqueles|doutros|nos|nuns|neles|nesses|nestes|naqueles|noutros|pelos|alguns|mos|tos|lhos">
    <!ENTITY contracoes_FP "às|das|dumas|delas|destas|dessas|daquelas|doutras|nas|numas|nelas|nessas|nestas|naquelas|noutras|pelas|algumas|mas|tas|lhas">

    <!ENTITY hifen "[-‑]">

    <!ENTITY pronomes_retos "eu|tu|el[ea]s?|nós|vós">
    <!ENTITY pronomes_nao_ambiguos "ma|me|mo|mos|ta|te|to|tas|tes|tos|lha|lhe|lho|lhas|lhes|lhos|vos">
    <!ENTITY pronomes_ambiguos "[ao]s?|mas|nos|se">
    <!ENTITY art_detecao_paronimos "(?:(?:[mts](?:eu|ua)|minha|[nv]oss[ao])|(?:d|n|pel)?(?:outr)?[ao]|à|ao)s?|com|de(?:sde)?|em|entre|mediante|p(?:ara|erante|or)|s(em|obre)|trás|(alg|d|n)?(um(as?)?|uns)">

    <!ENTITY introduz_conjuntivo "(?:caso|conquanto|embora|que|quando|se|talvez|tomara)">

    <!ENTITY requer_crase "(?:a(?:cesso|(?:cessíve|gradáve)(l|is)|comodadad[ao]|costumad[ao]|nálog[ao])|benéfic[ao]|c(?:ontrári|ontígu[ao])|d(?:aqui|estinad[ao])|e(?:quivalente|xpost[ao])|f(ace|avoráv|i(?:el|éis))|h(?:abituad[ao]|omenage(m|ns)|orror)|i(?:dêntic[ao]|(?:gua|nsens[ií]ve)(l|is)|nferior(es)?)|n(?:ecessári[ao]|ociv[ao])|o(?:bediência|bediente)|p(?:(?:aralel|ropíci|róxim)[ao]|(?:refer[ií]ve|rejudicia)(l|is)|restes)|r(?:(?:elativ|estrit)[ao])|s(?:emelhante|ens[ií]ve(l|is)|entad[ao]|uperior(es)?)|visita)s?">
    <!ENTITY requer_crase_verbos "(?:a(:derir|gradar|ssistir|visar)|comparecer|des(?:agradar|obedecer)|equivaler|ir|p(?:ertencer|roceder)|obedecer|re(?:agir|correr|sponder)|suceder)">
    <!ENTITY verbos_auxiliares_part_passado "(?:ser|estar|ter|haver|ficar)">

    <!ENTITY pontos_cardeais "norte|sul|este|oeste|ocidente|oriente|nascente|poente|nordeste|sudeste|noroeste|sudoeste">
    <!ENTITY numero_por_extenso_CP "zero|três|quatro|cinco|seis|sete|oito|nove|dez|onze|doze|treze|catorze|quinze|dez[ae]sseis|dez[ae]ssete|dezoito|dezanove|vinte|trinta|quarenta|cinquenta|sessenta|setenta|oitenta|noventa|cem|mil">
    <!ENTITY numero_por_extenso_MS "um|(mi|bi|tri|quadri)lh?ião">
    <!ENTITY numero_por_extenso_FS "uma|dezena">
    <!ENTITY numero_por_extenso_MP "uns|dois|centos?|(duzent|trezent|quatrocent|quinhent|seiscent|setecent|oitocent|novecent)os|(mi|bi|tri|quadri)lh?i?ões">
    <!ENTITY numero_por_extenso_FP "umas|duas|dezenas|dúzias|centenas|(duzent|trezent|quatrocent|quinhent|seiscent|setecent|oitocent|novecent)as">

    <!ENTITY abreviaturas "(?:c(?:[bjpx]|o(?:[bqt]|n(?:s(?:e(?:[cq]|lh?)|t(?:el|r)?|uet)?|c(?:r(?:et)?|ess|l)?|f(?:e(?:it|d)|ls?)?|t(?:emp|ab|r)?|q(?:uil)?|d(?:ic)?|j(?:ug)?|hec|g)|m(?:b(?:in(?:at)?|ust)?|p(?:[lt]|a?r)?|e(?:nd|rc)|unic|dor|te)|r(?:[pv]|r(?:u(?:pt?|t)|esp)?|eogr?|ogr?)|s(?:m(?:o(?:gr?|l))?|ec)?|p(?:ul(?:at)?)?|l(?:omb|et|s)?|ord|gn)|a(?:[çbdfv]|t(?:a(?:rin|cr|l)|ó(?:pt?|l)|eg)?|l(?:[çd]|v(?:in)?|cogr?|igr?)|r(?:[dnpr]|t(?:ogr)?)|n(?:a(?:liz|d)|t)?|p(?:i[tx]|ac|t)?|us?|st)|i(?:[dgv]|n(?:[gz]|e[gm]|ol)?|r(?:urg|c)?|t(?:ol|t)?|en[ct]?|bern|ênc|cl)|r(?:i(?:m(?:inol)?|pt(?:og)?|st)|on(?:o[lm]|ôn)|esc|ust|éd|ôn)?|e(?:n(?:tr?|og)|r(?:âm|v)|lt?|s?t)?|h(?:a(?:nc(?:el)?|p)|i[ln]|ul)?|l(?:(?:ás?|a)s|i(?:ch|m)|ín)|u(?:l(?:in|t)?|t(?:el)?|rt)|(?:ál|ír)?c|(?:él|ya)t|ô[nv]|ênt?|óds?|fr?|vs?|âm|tv)|p(?:[fmp]|r(?:o(?:[cdmx]|v(?:[çb]|(?:in)?c|enç?|av)?|t(?:(?:es|é)t|o[cz])?|s(?:(?:té)?t|ôn|c)|p(?:ag|os|r)?|n(?:[úo]n)?|f(?:is?s)?|bl)|e(?:[ftv]|s(?:[ct]|id)?|c(?:ed|is)?|d(?:ic)?|p(?:os)?)|i(?:nc(?:ip)?|m(?:it)?|v)|á[ct]|ót)?|a(?:r(?:a(?:[gn]|ens|ib)|n(?:as)?|t(?:ic)?|ág|ôn|l)|l(?:eo(?:[bz]|nt(?:ol)?|gr?)|s)|t(?:r(?:[ôo]n)?|ol)|s(?:s[mrt]?|t)|ulist|g?g|q)?|e(?:[cjlq]|r(?:s(?:pect(?:iv)?)?|n(?:amb)?|f(?:um)?|ífr?|uv)|t(?:r(?:o(?:[lq]|gr?))?)?|d(?:iat|ag|ol|r)?|s[cqs]?|nt?)|o(?:s(?:(?:ses)?s|it)|l(?:í[ct]|in)?|t(?:am)?|[ér]t|pul|v)|s(?:i(?:c(?:o(?:(?:fis)?l|pat|gn)|an)?|q(?:uiat)?)|eud)|i(?:rot(?:[ée]c)?|s(?:ci)?c|auien|n[tx]|zz)|l(?:a(?:nej|t)|eb)?|u(?:b(?:lic)?|lv|g)|á(?:g[gs]?|tr)|g(?:to)?|[íd]l|t[os]|érs?|úbl?|ça?)|e(?:s(?:t(?:r(?:a(?:t(?:ég)?|ng)|ut)?|a(?:(?:tís)?t|d)|e(?:nogr?|reogr)|i[lm]|ét|on|ud)|p(?:e(?:c(?:i(?:alm|f)|t(?:rogr)?|íf)?|(?:leo)?l|t)|ir(?:it)?|ort)?|c(?:o(?:lást|c)|ult?|and|r)?|l(?:[ao]v)?|gr|ot|q)|x(?:p(?:l(?:o[rs]|et)?|er(?:im)?|ort|r)?|c(?:l(?:am)?|urs)|t(?:ens|rat)?|érc|ag|e)|n(?:[fgsx]|t(?:om(?:ol)?)?|c(?:[íi]cl)?|erg(?:ét)?|doc)|m(?:b(?:r(?:iol)?|al)?|p(?:r(?:és)?|ír)?|igr|ol)|t(?:n(?:o(?:l(?:og)?|gr?))?|i(?:m(?:ol)?|óp)|ol)|l(?:etr(?:o(?:[lmt]|din)|ôn)?|étr|ipt)|u(?:f(?:[êe]m|o[nr]|ôn)?|r)|c(?:l(?:es)?|o[ln]|d)|q(?:u(?:i[tv]|at))?|p(?:igr?|íst)|d(?:if|uc)?|fem|gíp|rud)|m(?:a(?:[jp]|r(?:[cgx]|(?:ti)?n|r(?:oq)?|inh?|anh|ít)|l(?:[gh]|a(?:c(?:ol)?|b))|g(?:n(?:[ei]t)?)?|t(?:ogros|ad|er)?|q(?:uinof)?|d(?:eir)?|i(?:úsc)?|ç(?:on)?|omet|nuf|sc)|e(?:t(?:a(?:f(?:ór|is)?|l(?:og|ur))|r(?:if|ol)?|á[ft]|eor|on)?|c(?:an(?:ogr)?|ân)?|r(?:c(?:ad)?|id)?|d(?:(?:ie)?v)?|m(?:or?)?|x(?:ic)?|ns)|i(?:c(?:ro(?:[glm]|fot|sc)|ol)|n(?:[gh]|úsc|er)|t(?:ôn|ol)?|st)|o(?:n(?:t(?:anh)?|ogr?)?|r(?:alid|f)|(?:çam)?b|e?d|ag|v)|u(?:seol|lt|n)|é(?:tr|d)|í(?:st|n)|á[qx]|Min|ús|ct|k)|t(?:e(?:r(?:m(?:o(?:d(?:inâm)?|m)|in(?:ol)?)?|a(?:p(?:êut)?|t(?:ol)?)|r(?:it)?)|c(?:n(?:o(?:gr?|l)|a)?|el|go|t)?|l(?:e(?:[fv]|c(?:om)?|gr?)|égr)?|mp(?:er)?|o[ls]|atr?|ô?n|st?)|r(?:a(?:ns(?:m(?:ont)?|(?:ob)?j|it|p)|b(?:alh)?|d(?:ic)?|t)|i(?:[btv]|m(?:est)?|g(?:on)?)|áf|op)?|o(?:p(?:o(?:[ln]|gr?)|ôn)|x(?:iol)?|rp|sc|n)|a(?:[bm]|(?:xi|r)d|ur(?:om)?|quigr|ng?|il)|i(?:p(?:o(?:gr|l))?|b(?:et)?|nt|r)|u(?:r(?:ism|c)?|n(?:is)?|p)|é(?:cn?|rm)|(?:êx|í)t|á[bt]|âm|óp|ôn|v)|s(?:[fgs]|i(?:d(?:er(?:o(?:téc|gr))?)?|m(?:b(?:[óo]l)?|pl)|n(?:[gt]|[ôo]n|éd)?|g(?:n(?:if)?|il)|l(?:v(?:ic)?|og)|s?t|b)|e(?:[lx]|r(?:[gv]|(?:ic)?ic|r(?:alh)?)|m(?:i(?:[cnt]|ol)|(?:ân|í)t)|p(?:tent)?|(?:ten)?t|c[rt]?|gs?|nt?|q?q)|u(?:b(?:j(?:unt)?|afls?|ord|var|st)|p(?:er[fl]|r[fls]|l)?|e?c|f?f|rr|j)|o(?:c(?:iol)?|v(?:iét)?|st|n)|a(?:[bcn]|p(?:at)?|gr|ls)|ân(?:s(?:cr)?)?|í(?:[lr]|mb|nt)|c(?:[hr]|ul)?|r(?:t?a)?|t(?:ac|o)|érv?|p?p|át|ól)|i(?:n(?:t(?:e(?:r(?:j(?:et)?|n(?:ac)?|r(?:og)?|amn)|gr|ns)|r(?:ans)?|j)?|d(?:o(?:ch|st|n)|i(?:an|v)|u(?:st|m)|e[ft]|úst)?|f(?:in(?:it)?|ant?|orm|er|l)?|v(?:e(?:st(?:ig)?|nç)|ariav)?|s(?:(?:ti)?t|cr|ep)?|c(?:oat|óg|s)?|gl?|us)|m(?:p(?:e(?:r(?:at|f)?|ss)|r(?:o[pr]|es)?|ort)?|i(?:gr|t))|r(?:r(?:eg)?|[ôo]n|a[nq]|l)|c(?:ono(?:gr?|l)|t)|lu(?:s(?:ion|tr)|m)|t(?:al(?:ian)?|ál)?|d(?:(?:ol)?ol|iot)|s(?:l(?:am)?|r)|b(?:ér|id)|[ou]g|at|gr)|f(?:[fgt]|o(?:[gsv]|t(?:o(?:an(?:ál)?|gr|m))?|r(?:m(?:ul)?|rag|t)|l(?:[hs]|cl?)?|n(?:ét|ol))?|i(?:s(?:[cl]|io(?:cr?|l)|pat)|to(?:ssoc|gr?|pat)|l(?:at|ol)?|g(?:ur|d)?|nl?)|r(?:a(?:(?:c?|n)c|g)|e(?:[gq]|nol)|ut(?:íf)?|ânc|ig)?|e(?:[mv]|r(?:r(?:ad|ov))?|n(?:[ôo]m)?|u?d|it)|a(?:rm(?:ac(?:ol)?)?|scs?|l?c|uv|m)|l(?:u(?:m(?:in)?|v)|oric|am|s)?|u(?:t(?:e?b|ur)?|lv|nd)|(?:s?|í)s|(?:ór)?m|áb)|d(?:e(?:[dv]|c(?:r(?:esc)?|l(?:in)?|or)?|s(?:e(?:mb|n)|cr?|in|us|p)?|m(?:o(?:nstr|cr?|gr?))?|p(?:r(?:ec)?|to?|s)?|f(?:in(?:it)?|ect)?|r(?:iv|m)|t(?:erm)?|ns)|i(?:[fr]|s(?:[cs]|fem|tr)|al(?:[ée]t)?|n(?:[âa]m)?|pl(?:om)?|d(?:át)?|m(?:in)?|[áo]?c)|o(?:g(?:m(?:át)?)?|c(?:um|s)?|m[íi]n)|a(?:[dt]|sim)|u(?:alid|r)|ra[mv]?|ó[lr]|pto|z)|h(?:i(?:p(?:o(?:(?:té)?t|c(?:or)?|l)|not(?:er)?|(?:ia|ó)t|érb|ál)|dr(?:o(?:[dm]|gr?|s?t)|ául)?|s(?:t(?:ol)?|p)|b(?:r(?:id)?)?|er(?:ôn)?|gr?|nd)|e(?:r(?:p(?:et(?:o(?:gr|l))?|ét)?|áld?|b)?|ort(?:ôn)?|lm(?:in)?|b[dr]|t)|o(?:m(?:o(?:[fn]|gr?)|eop|ôn)?|rt(?:ic)?|tent|nd?)|a(?:g(?:io(?:gr?|l))?|plol|st|b)|í(?:br?|p)|úng)|b(?:i(?:o(?:g(?:e(?:o(?:gr?)?|n)|ên|r)|t(?:ip(?:ol)?)?|q(?:uím)?|(?:di)?m|fís|l)|bl(?:i(?:o(?:[fl]|t(?:ec)?|gr?)|ôn))?|r(?:rel|m)|tr(?:ans)?|m(?:en)?|spd?|z)|o(?:l(?:iv)?|r[dgr]|êm|mb|t)|a(?:(?:lís)?t|ct(?:er)?|sq)|r(?:om(?:at)?|i[gt]|as|et)?|u(?:r(?:oc|l)|d)|e(?:ir|ng|rb)|á(?:lt|rb)|[bt]l|íbl?|úlg|m)|r(?:e(?:l(?:a(?:t(?:iv)?|ç)|ig|oj)?|s(?:t(?:r(?:it)?)?|ult)?|g(?:i(?:on|m)|ress)?|p(?:[aeo]rt|úb)?|c(?:ípr?|ip)?|t(?:rosp|ór)?|f(?:orm|l)?|d(?:uç)?|alid|vers|m)|a(?:dio(?:t(?:e[cr]|écn?)?|d(?:if)?|gr?|at|l)|c(?:ion)?|ll)|o(?:[dt]|mn)|u(?:[br]|ss)|i[bt]|úst|ád|g)|l(?:[blr]|i(?:[bg]|t(?:u(?:rg?|an)|o(?:gr?|l)|er(?:at)?)?|n(?:g(?:uíst)?)?|m(?:it)?|vr?)|a(?:t(?:oar|it)?|b(?:ora?t)?|p(?:id)?|n[çc]|u?d|ct|rg)|u(?:[gv]|(?:si)?t|n[df]|dol)|o(?:[cq]|g(?:íst)?|mb|ng)|e(?:g(?:isl)?|i?t|x)|í(?:ng|q)|égs?|tda|âm|óg)|g(?:e(?:o(?:[dln]|m(?:orf?)?|f(?:ís)?|g[nr]?)|n(?:eal|ét|ov)?|rm?|ôn)|r(?:a(?:f(?:o(?:sc|l))?|v)|oenl?|áf|d)?|l(?:ipto(?:[lt]|gr?)|o(?:tol|ss)|ót)|a(?:[rtv]|l(?:ic|v)?|[éu]l|sc)|u(?:at(?:em)?|in|tt|z)|in(?:ec(?:ol)?|ást)?|n(?:om)?|ó?t|ên|ír|ov)|o(?:r(?:t(?:o(?:gr(?:áf)?|p))?|n(?:it(?:ol)?)?|g(?:aniz)?|ig(?:i?n)?|d(?:in)?|ogr?|ôn|at)?|b(?:s(?:(?:te)?t|ol)?|ed|r)?|n(?:om(?:(?:ás|a)t)?|eol|ç)|f(?:t(?:alm)?|id)|c(?:ult?|ean|id)|u(?:r(?:iv)?|t)|p(?:tat|os|p)?|torr(?:in)?|dont|lig|str|z)|v(?:[bcl]|e(?:r(?:[bn]|s(?:if)?|os?s)|n(?:at|ez|d)?|l(?:oc)?|t(?:er)?|ct|g)|i(?:[gz]|t(?:ic|r)?|n(?:ic)?|dr?|ol)|o(?:[cgx]|l(?:[ls]|at)?)?|a(?:dm?|sc)|ul[cg])|n(?:o(?:[mv]|r(?:m(?:at)?|ueg)?|b(?:il)?|tic)|e(?:[gp]|o(?:guin|log|zel)|ut?r|erl)|a(?:[cpvz]|t(?:ur)?)|u(?:mism?|cl|tr)|i(?:cara)?g|áu[at]?|órd|úm)|a(?:[çagv]|d(?:[jm]|v(?:ers)?|it)|b(?:r(?:ev)?|s)|p(?:ass|rox)?|nt(?:on|r)?|r(?:ts?|om)|(?:tô)?m|lt|ss|ux)|u(?:n(?:i(?:[df]|v(?:ers)?))?|r(?:b(?:an)?|ol|ug)|t(?:ili[dt]|ópi|op)|cr(?:aí?n)?|lt|mb)|q(?:u(?:a(?:(?:n(?:ti)?|r)t|lif)?|i(?:nz(?:en)?|rom|mb)?|í(?:ch|m)?|est)|l)|j(?:u(?:[dln]|r(?:ispr?)?|st)|a(?:[mnpv]|rd(?:in)?)|o(?:[cg]|alh|rn)|es)|S(?:r(?:t?a|e)s|ubdiác|[ón]r|arg|áb)|z(?:o(?:o(?:t(?:[ée]c)?|l))?|end)|x(?:e(?:rogr?|nof)|i(?:log|n))|E(?:(?:mpree)?nd|XM[ªº]|xa|E)|I(?:l(?:mos?)?|nsc)|(?:Cato|Be)l|A(?:dmin|tt)|é(?:cl|tn)|R(?:esp|d)|T(?:rav|T)|í(?:nd|t)|D(?:rs|D)|Hares|Mrs?|ópt|Ltd|Jr|Pe|ca)">

    <!ENTITY precede_nome_proprio_F "(?:a(?:gência|ssociação|venida)|balneário|c(?:anção|o(?:lec?ção|ligação|ndecoração|pa))|d(?:esignadas?|istribuição|upla)|e(?:ditora|s(?:cola|tação))|f(?:amília|ragata|undação)|g(?:aleria|eração)|herdade|i(?:lha|niciativa|intitulada)|l(?:agoa|ei)|marca|novela|o(?:bra|rquestra)|praça|quinta|r(?:evista|ua)|s(?:aga|erra|érie|onda)|t(?:aça|empestade)|universidade|versão)">
    <!ENTITY precede_nome_proprio_M "(?:bairro|c(?:afé|oncurso|urso)|d(?:esigna(?:ção|dos?))|estilo|f(?:estival|ilme|undo|uracão)|g(?:alardão|énero|rupo)|i(?:mpério|nstituto|ntitulado)|jornal|l(?:ago|iceu|ivro)|m(?:onte|useu)|na(?:u|vio)|p(?:artido|r(?:|émio|ojec?to|ograma))|r(?:egistr?o|eino|elatório|io)|t(?:ema|ipo|eatro))">
    <!ENTITY ditongos_chineses "A(?:i|ng?|o)|B(?:(?:(?:(?:ai?|(?:ang?|ao))|ei)|(?:(?:eng?|i)|iang?))|(?:(?:iao|ie)|(?:ing?|(?:o|u))))|C(?:(?:(?:(?:ai?|(?:(?:(?:ang?|ao)|en?)|(?:eng|hai?)))|(?:(?:hang?|(?:hao|hen?))|(?:(?:heng|(?:(?:hi|hong)|hou))|(?:hua?|huai))))|(?:(?:huang?|(?:hui|hun))|huo))|(?:(?:(?:i|ong)|ou)|(?:(?:u|uan)|(?:ui|(?:un|uo)))))|D(?:(?:(?:ai?|(?:(?:(?:(?:ang?|ao)|ei?)|(?:eng?|ia?))|(?:iang?|(?:iao|ie))))|(?:ing|(?:(?:iu|ong)|ou)))|(?:(?:u|uan)|(?:ui|(?:un|uo))))|E(?:i|(?:ng?|r))|F(?:(?:an?|(?:ang|ei))|(?:eng?|(?:(?:iao|ou?)|u)))|G(?:(?:(?:ai?|ang?)|(?:(?:(?:ao|(?:ei?|eng?))|ong)|(?:(?:ou|ua?)|uai)))|(?:(?:uang?|ui)|(?:un|uo)))|H(?:(?:(?:(?:ai?|ang?)|(?:(?:ao|(?:ei?|eng?))|ong))|(?:(?:ou|ua?)|uai))|(?:(?:uang?|ui)|(?:un|uo)))|J(?:(?:(?:(?:ia?|(?:iang?|iao))|ie)|(?:(?:ing?|iong)|iu))|(?:(?:u|uan)|(?:ue|un)))|K(?:(?:(?:(?:ai?|ang?)|(?:(?:ao|(?:ei?|eng?))|ong))|(?:(?:ou|ua?)|uai))|(?:(?:uang?|ui)|(?:un|uo)))|L(?:(?:(?:(?:(?:ai?|ang?)|(?:(?:ao|(?:ei?|eng))|ia?))|(?:(?:iang?|iao)|ie))|(?:(?:(?:ing?|iu)|(?:ong|(?:ou|u)))|uan))|(?:(?:(?:(?:un|uo)|ü)|(?:üan|üe))|ün))|M(?:(?:(?:(?:(?:ai?|ang?)|ao)|(?:ei?|eng?))|(?:i|(?:ian|iao)))|(?:(?:ie|(?:(?:ing?|iu)|ou?))|u))|N(?:(?:(?:(?:(?:ai?|ang?)|ao)|(?:ei?|eng?))|(?:ia?|(?:iang?|iao)))|(?:(?:ie|(?:(?:ing?|iu)|ong))|(?:(?:ou|u)|(?:(?:uan|(?:un|uo))|üe?))))|Ou|P(?:(?:(?:(?:ai?|(?:ang?|ao))|ei)|(?:(?:eng?|i)|ian))|(?:(?:iao|ie)|(?:ing?|(?:ou?|u))))|Q(?:(?:ia?|(?:(?:(?:iang?|iao)|ie)|(?:ing?|iong)))|(?:(?:iu|(?:u|uan))|(?:ue|un)))|R(?:(?:(?:(?:ang?|ao)|en?)|(?:(?:eng|i)|(?:ong|(?:ou|ua?))))|(?:uan|(?:(?:ui|un)|uo)))|S(?:(?:(?:(?:(?:ai?|ang?)|(?:ao|(?:ei?|eng?)))|hai?)|(?:(?:(?:(?:hang?|hao)|hei?)|(?:heng?|hi))|(?:(?:hong|(?:hou|hua?))|(?:huai|(?:(?:huang?|hui)|hun)))))|(?:(?:huo|i)|(?:(?:(?:ong|(?:ou|u))|uan)|(?:(?:ui|un)|uo))))|T(?:(?:(?:(?:(?:ai?|ang?)|(?:ao|(?:ei?|eng)))|(?:i|(?:(?:(?:ian|iao)|ie)|(?:ing|ong))))|(?:ou|(?:u|uan)))|(?:ui|(?:un|uo)))|W(?:(?:(?:ai?|ang?)|ei)|(?:(?:eng?|o)|u))|X(?:(?:(?:(?:ia?|iang?)|iao)|(?:(?:ie|ing?)|(?:iong|(?:iu|u))))|(?:uan|(?:ue|un)))|Y(?:(?:(?:(?:ai?|(?:ang?|ao))|e)|(?:(?:in?|ing)|o))|(?:(?:(?:ong|ou)|(?:u|(?:uan|ue)))|un))|Z(?:(?:(?:(?:(?:(?:ai?|ang?)|ao)|(?:ei?|eng?))|(?:hai?|(?:hang?|hao)))|(?:(?:hei?|(?:(?:heng?|hi)|hong))|(?:(?:hou|hua?)|(?:(?:huai|(?:huang?|hui))|hun))))|(?:(?:(?:huo|i)|ong)|(?:(?:(?:ou|u)|(?:uan|(?:ui|un)))|uo)))">

    <!ENTITY tautonimos "A(?:aptos|canthogyrus|chatina|gagus|gama|lburnus|lces|lle|losa|mandava|mazilia|meiva|nableps|nguilla|nhinga|nostomus|nser|nthias|pus|rcinella|riadne|spredo|stacus|vicularia|xis)|B(?:adis|agarius|agre|alanus|anjos|arbatula|arbus|asiliscus|atasio|elobranchus|elone|elonimorphis|idyanus|ison|ombina|oops|rama|rosme|ubo|ucayana|ufo|uteo|utis)|C(?:alamus|alappa|aleta|allichthys|alotes|apoeta|apreolus|aracal|arassius|ardinalis|arduelis|aretta|asuarius|atla|atostomus|ephea|erastes|haca|halcides|handramara|hanos|haos|hinchilla|hiropotes|hitala|hromis|iconia|idaris|inclus|itellus|lelia|occothraustes|ochlearius|oeligena|olius|olumella|oncholepas|onger|onta|onvoluta|ordylus|oscoroba|ossus|otinga|oturnix|rangon|ressida|rex|ricetus|rocuta|rossoptilon|uraeus|yanicterus|ygnus|ymbium|ynoglossus)|D(?:ama|ario|entex|evario|iuca|ives|olabrifera)|E(?:nhydris|nsifera|nsis|rythrinus|xtra)|F(?:alcipennis|eroculus|icus|ragum|rancolinus|urcula)|G(?:agata|albula|allinago|allus|azella|emma|enetta|erbillus|ibberulus|iraffa|lis|lycimeris|lyphis|obio|oliathus|onorynchus|orilla|rapsus|rus|ryllotalpa|uira|ulo)|H(?:ara|arpa|austellum|emilepidotus|eterophyes|imantopus|ippocampus|ippoglossus|ippopus|istrio|istrionicus|oolock|ucho|uso|yaena|ypnale)|I(?:chthyaetus|cterus|dea|guana|ndicator|ndri)|J(?:acana|aculus|anthina)|K(?:achuga|oilofera)|L(?:actarius|agocephalus|agopus|agurus|ambis|emmus|epadogaster|erwa|euciscus|ima|imanda|imosa|iparis|ithognathus|ithophaga|oa|ota|uscinia|utjanus|utra|utraria|ynx)|M(?:acrophyllum|anacus|argaritifera|armota|artes|ascarinus|ashuna|egacephala|elanodera|eles|elo|elolontha|elongena|enidia|ephitis|ercenaria|eretrix|erluccius|eza|icrostoma|ilvus|itella|itra|itu|odiolus|odulus|ola|olossus|olva|onachus|oniliformis|ops|ustelus|yaka|yospalax|yotis)|N(?:aja|aja|angra|asua|atrix|eita|iviventer|otopterus|ycticorax)|O(?:enanthe|gasawarana|liva|phioscincus|plopomus|reotragus|riolus)|P(?:agrus|angasius|apio|auxi|erdix|eriphylla|erna|etaurista|etronia|hocoena|hoenicurus|hoxinus|hycis|ica|ipa|ipile|ipistrellus|ipra|ithecia|lanorbis|lica|oliocephalus|ollachius|ollicipes|orites|orphyrio|orphyrolaema|orpita|orzana|ristis|seudobagarius|udu|uffinus|ungitius|yrrhocorax|yrrhula)|Q(?:uadrula|uelea)|R(?:ama|anina|apa|asbora|attus|edunca|egulus|emora|etropinna|hinobatos|iparia|ita|upicapra|upicola|utilus)|S(?:accolaimus|alamandra|arda|calpellum|cincus|colytus|ephanoides|erinus|odreana|olea|phyraena|pinachia|pirorbis|pirula|prattus|quatina|taphylaea|uiriri|ula|uta|ynodus)|T(?:adorna|andanus|chagra|elescopium|emnurus|erebellum|etradactylus|etrax|herezopolis|hymallus|ibicen|inca|odus|orpedo|rachurus|rachycorystes|rachyrinchus|ricornis|roglodytes|ropheops|ubifex|yrannus)|U(?:mbraculum|ncia)|V(?:anellus|elella|elutina|icugna|illosa|imba|iviparus|olva|ulpes)|X(?:anthocephalus|anthostigma|enopirostris)|Ypiranga|Z(?:ebrus|era|ingel|ingha|oma|onia|ungaro|ygoneura)">

    <!ENTITY operadores_matematicos "[-x\.·\*\/\^\|~¬±×÷ϐϑϒϕϰϱϴϵ϶؆؇‖′″‴⁀⁄⁒⁺⁻⁼⁽⁾₊₋₌₍₎∀∁∂∃∄∅∆∇∈∉∊∋∌∍∎∏∐∑−∓∔∕∖∗∘∙√∛∜∝∞∟∠∡∢∣∤∥∦∧∨∩∪∫∬∭∮∯∰∱∲∳∴∵∶∷∸∹∺∻∼∽∾∿≀≁≂≃≄≅≆≇≈≉≊≋≌≍≎≏≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≠≡≢≣≤≥≦≧≨≩≪≫≬≭≮≯≰≱≲≳≴≵≶≷≸≹≺≻≼≽≾≿⊀⊁⊂⊃⊄⊅⊆⊇⊈⊉⊊⊋⊌⊍⊎⊏⊐⊑⊒⊓⊔⊕⊖⊗⊘⊙⊚⊛⊜⊝⊞⊟⊠⊡⊢⊣⊤⊥⊦⊧⊨⊩⊪⊫⊬⊭⊮⊯⊰⊱⊲⊳⊴⊵⊶⊷⊸⊹⊺⊻⊼⊽⊾⊿⋀⋁⋂⋃⋄⋅⋆⋇⋈⋉⋊⋋⋌⋍⋎⋏⋐⋑⋒⋓⋔⋕⋖⋗⋘⋙⋚⋛⋜⋝⋞⋟⋠⋡⋢⋣⋤⋥⋦⋧⋨⋩⋪⋫⋬⋭⋮⋯⋰⋱⋲⋳⋴⋵⋶⋷⋸⋹⋺⋻⋼⋽⋾⋿]|\=|\+">
    <!ENTITY alfabeto_grego "[ΑαΝνΒβΞξΓγΟοΔδΠπΕεΡρΖζΣσςΗηΤτΘθΥυΙιΦφΚκΧχΛλΨψΜμΩω]">
    <!ENTITY unidades_de_medida "(?:(?:[khdcmnµfYZEPTGM]|da)?(?:[gmlsJNWCVSFTHΩ]|Hz|cd|lm|mol|Pa|Wb|rad|sr|lx|Bq|Gy|Sv|kat|Np|eV)(?:⁻)?[23¹²³]?|º[CFK]|cv|k?cal|mmHg|atm|bpm|ton|kWh|GWa|MWd|MWh|mAh|min|ha)">

    <!ENTITY cores_invariaveis "bege|cinza|laranja|vinho|rosa|ultravioleta">
    <!ENTITY cores "amarel[ao]|azul|verde|vermelh[ao]|laranja|lilás|rox[ao]|violeta|turquesa|branc[ao]|pret[ao]|castanh[ao]|bege|bordô|cinzent[ao]|carmim|ciano|magenta|marrom|ocre|cor">
    
]>

<rules lang="pt" xsi:noNamespaceSchemaLocation="../../../../../../../../../languagetool-core/src/main/resources/org/languagetool/resource/disambiguation.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <!-- Unification rules based on galician grammar.xml - START-->
  <unification feature="number">
    <equivalence type="singular">
          <token postag="(?:[NZ]..|[ADP]...|V....)[NS].+" postag_regexp="yes"/>
    </equivalence>
    <equivalence type="plural">
          <token postag="(?:[NZ]..|[ADP]...|V....)[NP].+" postag_regexp="yes"/>
    </equivalence>
  </unification>

  <unification feature="gender">
    <equivalence type="masc">
          <token postag="(?:[NZ].|[ADP]..|V.....)[CM].+" postag_regexp="yes"/>
    </equivalence>
    <equivalence type="fem">
          <token postag="(?:[NZ].|[ADP]..|V.....)[CF].+" postag_regexp="yes"/>
    </equivalence>
  </unification>

  <unification feature="person">
    <equivalence type="first">
          <token postag="(?:V...|PP)1.+" postag_regexp="yes"/>
    </equivalence>
    <equivalence type="second">
          <token postag="(?:V...|PP)2.+" postag_regexp="yes"/>
    </equivalence>
    <equivalence type="third">
          <token postag="(?:V...|PP)3.+" postag_regexp="yes"/>
    </equivalence>
  </unification>
    <!-- Unification rules retrieved from galician grammar.xml - END  -->

    <!--rule id="WORKAROUND_MISSING_ADVERBS_POS" name="Fix missing POS in adverbes">
    < Created by Tiago F. Santos, Portuguese rule, 2017-07-24>
      <pattern>
          <token regexp="yes" postag='I|RG' postag_regexp='yes'>.*mente$</token>
      </pattern>
      <disambig action="add"><wd pos="RM"/></disambig>
      <example inputform="francamente[Francamente/I]" outputform="francamente[Francamente/I,francamente/RM]" type="ambiguous">Falou <marker>francamente</marker> em soluções.</example>
    </rule  -->

    <!--		multiwords.txt related			-->
    <!-- 	Workaround retrieved from Catalan grammar.xml	>
  <rulegroup id="WORKAROUND_SENTENCE_TOKENIZATION" name="Fix problems with sentence tokenization">
    <rule>
      <pattern>
          <token regexp="yes">[A-Z]</token>
        <marker>
          <token spacebefore="no">.</token>
        </marker>
          <token spacebefore="yes" postag="[VADSC].*" postag_regexp="yes" regexp="yes">\p{Lu}.*
            <exception postag="NP.*" postag_regexp="yes"/></token>
      </pattern>
      <disambig action="add"><wd pos="SENT_START"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">[A-Z]</token>
        <marker>
          <token spacebefore="no">.</token>
        </marker>
          <token spacebefore="yes" postag="[VADSC].*" postag_regexp="yes" regexp="yes">\p{Lu}.*
            <exception postag="NP.*" postag_regexp="yes"/></token>
      </pattern>
      <disambig action="add"><wd pos="SENT_END"/></disambig>
    </rule>
  </rulegroup-->
  

    <rule id="INTERJECTION" name="Interjeição">
      <pattern>
        <marker>
          <token postag="I"/>
          <token postag="I"/>
        </marker>
          <token regexp="yes">[.,;:!?…]</token>
      </pattern>
      <disambig action="replace"><wd pos="I"/><wd pos="I"/></disambig>
    </rule>
  <rulegroup id="VAN_GOGH" name="Van Gogh">
    <!-- 	Rulegroup retrieved from Catalan grammar.xml	-->
    <rule>
      <pattern>
        <marker>
          <token>van</token>
        </marker>
          <token regexp="yes">(?-i)Aartsen|Agt|Allen|Asperen|Baaren|Basten|Beethoven|Beinum|Belin|Bommel|Bree|Buren|Campen|Dam|Delden|der|Dijk|Dine|Dong|Dyck|Egmond|Eyck|Gaal|Goethem|Gogh|Halen|Hauwe|Hemel|Immersel|Kempen|Lier|Maldere|Marwijk|Mill|Morrison|Nieuwkerk|Nistelrooy|Otterloo|Persie|Petegem|Ragin|Rensburg|Rompuy|Schalkwyk|Someren|Vaart|Val|Valen|Van|Vliet|Vlijmen|Wassenaer</token>
      </pattern>
      <disambig action="replace"><wd pos="NPCNSP0_"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">\p{Lu}.+</token>
        <marker>
          <token>van</token>
        </marker>
          <token regexp="yes">\p{Lu}.+</token>
      </pattern>
      <disambig action="replace"><wd pos="NPCNSP0_"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">\p{Lu}.+</token>
        <marker>
          <token>van</token>
        </marker>
          <token regexp="yes">den|der</token>
          <token regexp="yes">\p{Lu}.+</token>
      </pattern>
      <disambig action="replace"><wd pos="NPCNSP0_"/></disambig>
    </rule>
  </rulegroup>
  <rulegroup id="DA_VINCI" name="Da Vinci">
    <!-- 		Based on Catalan version		-->
    <rule>
      <pattern>
        <marker>
          <token>da</token>
        </marker>
          <token regexp="yes">(?-i)Cividale|Morte|Lingua|Língua|Gagliano|Palestrina|Perugia|Cunha|Gama|Viadana|Vinci</token>
      </pattern>
      <disambig action="replace"><wd pos="NPCNSP0_"/></disambig>
      <example type="untouched">De acordo com os dados no relatório esta quinta-feira apresentado na capital da Costa do Marfim…</example>
    </rule>
    <rule>
      <pattern>
          <token regexp='yes'>\p{Lu}\p{Ll}+</token>
        <marker>
          <token>da</token>
        </marker>
          <token regexp="yes">(?-i)Costa|Silva</token>
      </pattern>
      <disambig action="replace"><wd pos="NPCNSP0_"/></disambig>
      <example type="untouched">De acordo com os dados no relatório esta quinta-feira apresentado na capital da Costa do Marfim…</example>
    </rule>
  </rulegroup>
  <rulegroup id="NP_BRANDS" name="Brands and Trademarks">
    <rule>
      <pattern>
        <marker>
          <token regexp="yes">\w+[™®]$</token>
        </marker>
      </pattern>
      <filter class="org.languagetool.rules.pt.NoDisambiguationPortuguesePartialPosTagFilter"
             args="no:1 regexp:(\w+)[™®] postag_regexp:NP.+"/><!-- The filter is case-sensitive -->
      <disambig action="replace"><wd pos="NPCN000_"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token/>
          <token regexp="yes">[™®]</token>
      </pattern>
      <disambig action="replace"><wd pos="NPCN000_"/><wd pos="NPCN000_"/></disambig>
    </rule>
  </rulegroup>

  <rulegroup id="INVARIABLE_COLORS" name="Nomes de cores como adjetivos invariáveis">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2019-04-13  -->
    <!-- TODO make grammar rules reflecting this -->
    <!-- https://www.recantodasletras.com.br/gramatica/5110636 -->
    <rule>
      <pattern>
          <token postag="N..P.+" postag_regexp="yes"/>
        <marker>
          <token regexp='yes'>&cores_invariaveis;</token>
        </marker>
      </pattern>
      <disambig action="replace" postag="AQ0CN0"/>
    </rule>
    <rule>
      <pattern>
          <token postag="N..P.+" postag_regexp="yes"/>
        <marker>
          <token regexp='yes'>&cores;</token>
          <token regexp='yes' spacebefore='no'>&hifen;</token>
          <token postag_regexp="yes" spacebefore='no' postag="N.+"/>
        </marker>
      </pattern>
      <disambig action="replace"><wd pos="AQ0CN0"/><wd pos="AQ0CN0"/><wd pos="AQ0CN0"/></disambig> 
    </rule>
    <rule>
      <pattern>
          <token postag="N..P.+" postag_regexp="yes"/>
        <marker>
          <token regexp='yes'>&cores;</token>
          <token regexp='yes' spacebefore='no'>&hifen;</token>
          <token regexp='yes' spacebefore='no'>celeste|marinho|de</token>
        </marker>
      </pattern>
      <disambig action="replace"><wd pos="AQ0CN0"/><wd pos="AQ0CN0"/><wd pos="AQ0CN0"/></disambig> 
    </rule>
  </rulegroup>

    <rule id="QUEM_VERBO" name="quem + verbo">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2018-07-08  -->
      <pattern>
          <token>quem</token>
        <marker>
        <and>
          <token postag="N.+" postag_regexp="yes"/>
          <token postag="V.+" postag_regexp="yes"/>
        </and>
        </marker>
      </pattern>
      <disambig action="filter" postag="V.+"/>
    </rule>

    <rule id="SPS_SI" name="Preposição + Si">
    <!-- Si : Pronoun or Musical note				-->
    <!-- Created by Tiago F. Santos, Portuguese rule, 2016-11-19  -->
      <pattern>
          <token postag="SP.+" postag_regexp="yes"/>
        <marker>
          <token>si</token>
        </marker>
      </pattern>
      <disambig action="filter" postag="PP.+"/>
    </rule>

  <rulegroup id="ADVERB_VERB_NOUN" name="Via: Advérbio + Verbo/Nome">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2019-02-27 -->
    <rule>
      <pattern>
          <token postag="N.+" postag_regexp="yes"/>
          <token postag="C.+" postag_regexp="yes">
            <exception postag="(A|D|PP|R|V).+|_PUNCT" postag_regexp="yes"/></token>
          <token postag="R.+" postag_regexp="yes">
            <exception regexp='yes'>m(?:ais|enos)</exception>
            <exception postag="(A|C|D|S).+" postag_regexp="yes"/></token>
        <marker>
        <and>
          <token postag="N.+" postag_regexp="yes">
            <exception regexp='yes'>(?:ac?tiva|p(?:arte|resente))s?</exception></token>
          <token postag="V.+" postag_regexp="yes"/>
        </and>
        </marker>
      </pattern>
      <disambig action="filter" postag="V.+"/>
      <example inputform="via[ver/VMII1S0,ver/VMII2S0,ver/VMII3S0,via/NCFS000,via/SPS00]" outputform="via[ver/VMII1S0,ver/VMII2S0,ver/VMII3S0]" type="ambiguous">Há muito tempo que não <marker>via</marker> publicações da Ana.</example>
      <example type="untouched">>Nas Antilhas existem também <marker>ilhas</marker> que são possessões (britânicas, francesas, holand...</example>
    </rule>
    <rule>
      <pattern>
          <token postag="R.+" postag_regexp="yes">
            <exception scope='previous' postag="(A|C|D|PP|R|V).+|_PUNCT" postag_regexp="yes"/>
            <exception regexp='yes'>m(?:ais|enos)</exception>
            <exception postag="(A|C|D|S).+" postag_regexp="yes"/></token>
        <marker>
        <and>
          <token postag="N.+" postag_regexp="yes">
            <exception regexp='yes'>(?:ac?tiva|p(?:arte|resente))s?</exception></token>
          <token postag="V.+" postag_regexp="yes"/>
        </and>
        </marker>
      </pattern>
      <disambig action="filter" postag="V.+"/>
      <example type="untouched">>Nas Antilhas existem também <marker>ilhas</marker> que são possessões (britânicas, francesas, holand...</example>
    </rule>
    <rule>
      <pattern>
          <token postag="PP.+" postag_regexp="yes">
            <exception postag="(D|S).+" postag_regexp="yes"/></token>
          <token postag="R.+" postag_regexp="yes">
            <exception postag="(A|C|D|S).+" postag_regexp="yes"/></token>
        <marker>
        <and>
          <token postag="N.+" postag_regexp="yes"/>
          <token postag="V.+" postag_regexp="yes"/>
        </and>
        </marker>
      </pattern>
      <disambig action="filter" postag="V.+"/>
      <example inputform="quebra[quebra/AQ0CS0,quebra/NCCS000,quebra/NCFS000,quebrar/VMIP3S0,quebrar/VMM02S0]" outputform="quebra[quebrar/VMIP3S0,quebrar/VMM02S0]" type="ambiguous">...odo estudante confia no Sr. Akai porque ele nunca <marker>quebra</marker> promessas.</example>
      <example type="untouched">>Nas Antilhas existem também <marker>ilhas</marker> que são possessões (britânicas, francesas, holand...</example>
    </rule>
  </rulegroup>

  <rulegroup id="NOUN_QUE_FOLLOWING" name="Nome + QUE">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-07-15  -->
    <rule>
      <pattern>
          <token postag="[AN].+" postag_regexp="yes">
            <exception  negate_pos='yes' postag="[AN].+" postag_regexp="yes"/></token>
          <token>que</token>
        <marker>
        <and>
          <token postag="N.+" postag_regexp="yes"/>
          <token postag="V.+" postag_regexp="yes"/>
        </and>
        </marker>
      </pattern>
      <disambig action="filter" postag="V.+"/>
    </rule>
    <rule>
      <pattern>
          <token>que</token>
        <marker>
        <and>
          <token postag="D.+" postag_regexp="yes">
            <exception  negate_pos='yes' postag="[DP].+" postag_regexp="yes"/></token>
          <token postag="P.+" postag_regexp="yes"/>
        </and>
        </marker>
          <token postag="[AN].+" postag_regexp="yes"/>
      </pattern>
      <disambig action="filter" postag="D.+"/>
    </rule>
  </rulegroup>

    <rulegroup id="PP_D_V" name="Pronome + Pronome + Verbo">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-07-15  -->
        <antipattern>
            <token regexp='yes'>em|entre|por</token>
            <token regexp='yes'>&pronomes_retos;|mim|ti|si</token>
            <token regexp='yes'>m[aeo]s?|t[aeo]s?|s[aeo]|lh[aeo]s?|[ao]s?|[nv]os</token>
            <token postag='V.+|AQ0[CFM][SP]0|NC[CFM][SP]000|NP[CFM][SP][0GS]00' postag_regexp='yes'/>
            <token negate="yes" regexp='yes'>nas?|nos?|em|pelos?|pelas?|como|tal|tais</token>
        </antipattern>
      <rule>
        <pattern>
            <token regexp='yes'>&pronomes_retos;</token>
          <marker>    
            <token regexp='yes'>[nv]?[ao]s?</token>
              <token postag="V.+" postag_regexp="yes"/>
          </marker>       
        </pattern>
        <disambig action="filterall"/>
      </rule>
        <rule>
            <pattern>
                <token regexp='yes'>&pronomes_retos;</token>
                <token>nem</token>
                <marker>    
                    <token regexp='yes'>[nv]?[ao]s?</token>
                    <token postag="V.+" postag_regexp="yes"/>
                </marker>       
            </pattern>
            <disambig action="filterall"/>
        </rule>
    </rulegroup>

  <!--rulegroup id="SUBJUNCTIVES" name="Verbos no conjuntivo"-->
    <!-- Created by Tiago F. Santos, Portuguese rule, 2019-03-24  >
    <rule>
      <pattern>
          <token postag="_PUNCT|SENT_START" postag_regexp="yes"/>
          <token skip='-1' regexp='yes'>&introduz_conjuntivo;</token>
        <marker>
          <token postag="V.S.+" postag_regexp="yes">
            <exception postag='NP.+' postag_regexp='yes'/>
            <exception scope='previous' postag='V.+' postag_regexp='yes'/></token>
        </marker>
      </pattern>
      <disambig action="filter" postag="V.S.+"/>
    </rule>
    <rule>< TODO fix bug in synthesizer. some odd results in 'matched' suggestions >
      <antipattern>
          <token skip='-1' regexp='yes'>&introduz_conjuntivo;</token>
          <token postag="V.S.+" postag_regexp="yes"/>
      </antipattern>
      <antipattern--><!-- XXX Caught by rule POSSIVELMENT_CONJUNTIVO -->
          <!--token regexp="yes" skip='-3'>provavelmente|quiçá|possivelmente
            <exception scope="previous" regexp="yes">quando|se</exception></token>
          <token postag="V.S.+" postag_regexp="yes"/>
      </antipattern>
      <antipattern><token>A</token><token>fim</token><token>de</token><token>que</token></antipattern>
      <antipattern><token>Para</token><token>que</token></antipattern>
      <antipattern><token>Antes</token><token>que</token></antipattern>
      <antipattern><token>Depois</token><token>que</token></antipattern>
      <antipattern><token>Desde</token><token>que</token></antipattern>
      <antipattern><token>Contanto</token><token>que</token></antipattern>
      <antipattern><token>Sem</token><token>que</token></antipattern>
      <antipattern><token>Ainda</token><token>que</token></antipattern>
      <antipattern><token>Mesmo</token><token>que</token></antipattern>
      <antipattern><token>Até</token><token>que</token></antipattern>
      <antipattern><token>Desde</token><token>que</token></antipattern>
      <antipattern><token>Creio</token><token>que</token></antipattern>
      <antipattern><token>Exceto</token><token>se</token></antipattern>
      <antipattern><token>Salvo</token><token>se</token></antipattern>
      <antipattern><token>A</token><token>menos</token><token>que</token></antipattern>
      <antipattern><token>A</token><token>não</token><token>ser</token><token>que</token></antipattern>
      <antipattern><token>Convém</token><token>que</token></antipattern>
      <antipattern><token>Negar</token><token>que</token></antipattern>
      <antipattern><token>Sem</token><token>que</token></antipattern>
      <antipattern><token>Uma</token><token>vez</token><token>que</token></antipattern>
      <pattern>
        <marker>
        <and>
          <token postag="V.S.+" postag_regexp="yes"/>
          <token postag="V.[^S].+|[^V].+" postag_regexp="yes"/>
        </and>
        </marker>
      </pattern>
      <disambig action="remove" postag="V.S.+"/>
    </rule>
  </rulegroup-->

  <rulegroup id="PAST_PARTICIPLE" name="Filtrar particípio passado">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-08-02  -->
    <rule>
      <pattern>
          <token inflected='yes' regexp='yes'>&verbos_auxiliares_part_passado;</token>
          <token postag='R.+' postag_regexp="yes" min='0' max='4'>
            <exception negate_pos='yes' postag='R.+' postag_regexp="yes"/></token>
        <marker>
          <token postag="V.P.+" postag_regexp="yes"/>
        </marker>
      </pattern>
      <disambig action="filter" postag="V.P.+"/>
      <example inputform="cometido[cometer/VMP00SM,cometido/AQ0MS0]" outputform="cometido[cometer/VMP00SM]" type="ambiguous">Todos tinham <marker>cometido</marker> graves erros.</example>
      <example inputform="desrespeitado[desrespeitado/AQ0MS0,desrespeitar/VMP00SM]" outputform="desrespeitado[desrespeitar/VMP00SM]" type="ambiguous">Ela tinha <marker>desrespeitado</marker> todos com a sua infantilidade.</example>
    <!--example inputform="comprado[comprado/AQ0MS0,comprar/VMP00SM]" outputform="comprado[comprar/VMP00SM]" type="ambiguous">Tenho ao longo dos anos <marker>comprado</marker> livros.</example--> <!-- XXX testrules does not account for multiwords, but it is working -->
    </rule>
    <rule>
      <pattern>
          <token inflected='yes' regexp='yes'>&verbos_auxiliares_part_passado;</token>
          <token spacebefore='no' regexp='yes'>&hifen;</token>
          <token spacebefore='no' regexp='yes'>&pronomes_nao_ambiguos;|&pronomes_ambiguos;</token>
          <token postag='R.+' postag_regexp="yes" min='0' max='4'>
            <exception negate_pos='yes' postag='R.+' postag_regexp="yes"/></token>
        <marker>
          <token postag="V.P.+" postag_regexp="yes"/>
        </marker>
      </pattern>
      <disambig action="filter" postag="V.P.+"/>
      <example inputform="recordado[recordado/AQ0MS0,recordar/VMP00SM]" outputform="recordado[recordar/VMP00SM]" type="ambiguous">Todos tinham-se <marker>recordado</marker> do sucedido.</example>
    </rule>
  </rulegroup>

  <rulegroup id="FUTURO_PERIFRASICO" name="Filtrar futuro perifrásico">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-09-25  -->
    <rule>
      <pattern>
          <token inflected='yes' regexp='yes'>ir|vir|poder</token>
          <token postag='R.+' postag_regexp="yes" min='0' max='4'>
            <exception negate_pos='yes' postag='R.+' postag_regexp="yes"/></token>
        <marker>
          <token postag="VMN0000"/>
        </marker>
      </pattern>
      <disambig action="filter" postag="VMN0000"/>
      <example inputform="haver[haver/NCMS000,haver/VMN0000,haver/VMN01S0,haver/VMN03S0]" outputform="haver[haver/VMN0000]" type="ambiguous">Não vai <marker>haver</marker> votação.</example>
    </rule>
    <rule>
      <pattern>
          <token inflected='yes' regexp='yes'>ir|vir|poder</token>
          <token spacebefore='no' regexp='yes'>&hifen;</token>
          <token spacebefore='no' regexp='yes'>&pronomes_nao_ambiguos;|&pronomes_ambiguos;</token>
          <token postag='R.+' postag_regexp="yes" min='0' max='4'>
            <exception negate_pos='yes' postag='R.+' postag_regexp="yes"/></token>
        <marker>
          <token postag="VMN0000"/>
        </marker>
      </pattern>
      <disambig action="filter" postag="VMN0000"/>
    </rule>
  </rulegroup>

  <rulegroup id="SER_NOUN" name="'ser' como substantivo">
    <!-- Localized from Catalan by Tiago F. Santos, 2017-05-16  -->
    <rule>
      <pattern>
        <marker>
          <token postag="N.*" postag_regexp="yes" regexp="yes">ser|seres</token>
        </marker>
          <token regexp="yes">humanos?|vivos?</token>
      </pattern>
      <disambig action="filter" postag="N.*"/>
    </rule>
    <rule>
      <pattern>
        <marker>
          <token postag="D..MS." postag_regexp="yes">
            <exception>o</exception></token>
          <token postag="NCMS000">ser</token>
        </marker>
      </pattern>
      <disambig action="filterall"/>
    </rule>
    <rule>
      <pattern>
        <marker>
          <token postag="D..MP." postag_regexp="yes"/>
          <token postag="NCMP000">seres</token>
        </marker>
      </pattern>
      <disambig action="filterall"/>
    </rule>
    <rule>
      <pattern>
        <marker>
          <token postag="V.+" postag_regexp="yes" regexp="yes">ser|seres</token>
        </marker>
          <token>-</token>
          <token postag_regexp="yes" postag="&pronomes_nao_ambiguos;|se"/>
      </pattern>
      <disambig action="filter" postag="V.+"/>
    </rule>
    <rule>
      <pattern>
          <token postag_regexp="yes" postag="&pronomes_nao_ambiguos;|se"/>
        <marker>
          <token postag="V.+" postag_regexp="yes" regexp="yes">ser|seres</token>
        </marker>
      </pattern>
      <disambig action="filter" postag="V.+"/>
    </rule>
  </rulegroup>

    <rule id="NAO_ADVERB" name="Não como advérbio">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-07-28  -->
      <pattern>
        <marker>
          <token>não</token>
        </marker>
          <token postag_regexp='yes' postag='(R|V).+'/>
      </pattern>
      <disambig action="filter" postag="R.+"/>
    </rule>

    <rule id="ADVERB_VERB_SINGULAR" name="Advérbio Verbo/nome Nome Singular">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-09-27  	-->
      <pattern>
          <token postag="R.+" postag_regexp='yes'/>
        <marker>
        <and>
          <token postag="V.+" postag_regexp='yes'/>
          <token postag="(N|A.)..P.+" postag_regexp='yes'/>
        </and>
        </marker>
          <token postag="(N|A.)..S.+" postag_regexp='yes'>
            <exception negate_pos='yes' postag="(N|A.)..S.+" postag_regexp='yes'/></token>
      </pattern>
      <disambig action="filter" postag="V.+"/>
    </rule>

    <rule id="ALVO" name="alvo como adjetivo impessoal">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-11-30  -->
      <pattern>
          <token postag="V....P.+|NCFP.+" postag_regexp='yes'/>
        <marker>
          <token>alvo</token>
        </marker>
      </pattern>
      <disambig action="replace" postag="NCCN000"/>
    </rule>

  <rulegroup id="BASTANTE" name="Bastante como adjetivo">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2019-03-16 -->
    <rule>
      <pattern>
        <marker>
          <token>bastante</token>
        </marker>
          <token>
            <exception postag="N.+" postag_regexp='yes'/></token>
      </pattern>
      <disambig action="filter" postag="RG"/>
    </rule>
    <rule>
      <pattern>
          <token postag="N.+" postag_regexp='yes'>
            <exception postag="V.+" postag_regexp='yes'/></token>
        <marker>
          <token>bastante</token>
        </marker>
          <token>vezes</token>
      </pattern>
      <disambig action="filter" postag="A.+"/>
    </rule>
    <rule>
      <pattern>
          <token postag="V.+" postag_regexp='yes'>
            <exception negate_pos='yes' postag="V.+" postag_regexp='yes'/></token>
        <marker>
          <token>bastante</token>
        </marker>
          <token postag="N.+" postag_regexp='yes'>
            <exception negate_pos='yes' postag="N.+" postag_regexp='yes'/></token>
      </pattern>
      <disambig action="filter" postag="A.+"/>
    </rule>
  </rulegroup>

    <rule id="CERTO" name="Estar + Certo">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-11-30  -->
      <pattern>
          <token inflected='yes'>estar</token>
        <marker>
          <token regexp='yes'>cert[ao]s?</token>
        </marker>
      </pattern>
      <disambig action="filter" postag="A.+"/>
    </rule>

    <rule id="CITAR" name="CITAR + Fontes">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-11-30  -->
      <pattern>
        <marker>
          <token inflected='yes'>citar</token>
        </marker>
          <token regexp='yes'>(?:artigos|documento|fonte|livro|revista)s?|jorna(?:l|is)</token>
      </pattern>
      <disambig action="filter" postag="V.+"/>
    </rule>

  <rulegroup id="CERCA_DE" name="'cerca de'">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2018-07-18  -->
    <rule>
      <pattern>
        <marker>
          <token>cerca</token>
        </marker>
          <token>de</token>
          <token regexp='yes'>&numero_por_extenso_CP;|&numero_por_extenso_FS;|&numero_por_extenso_FP;|&numero_por_extenso_MS;|&numero_por_extenso_MP;|mei[ao]</token>
      </pattern>
      <disambig action="replace" postag="RG"/>
    </rule>
    <rule>
      <pattern>
        <marker>
          <token>cerca</token>
        </marker>
          <token>de</token>
          <token postag_regexp='yes' postag='NC.+'>
            <exception regexp='yes'>&numero_por_extenso_CP;|&numero_por_extenso_FS;|&numero_por_extenso_FP;|&numero_por_extenso_MS;|&numero_por_extenso_MP;|mei[ao]</exception></token>
      </pattern>
      <disambig action="filter" postag="N.+"/>
    </rule>
    <rule>
      <pattern>
          <token>cercas</token>
          <token>de</token>
        <marker>
          <token postag_regexp='yes' postag='NC.+'/>
        </marker>
      </pattern>
      <disambig action="filter" postag="N.+"/>
    </rule>
  </rulegroup>

  <rulegroup id="TAL_ADVERB" name="Locuções adverbiais com 'tal'">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2016-11-19  -->
    <rule>
      <pattern>
          <token>tal</token>
      </pattern>
      <disambig action="remove" postag="RG"/>
    </rule>
    <rule>
      <pattern>
        <marker>
          <token>tal</token>
        </marker>
          <token min='0'>e</token>
          <token regexp="yes">como|qual</token>
      </pattern>
      <disambig action="replace" postag="RG"/>
    </rule>
    <rule>
      <pattern>
          <token>como</token>
        <marker>
          <token>tal</token>
        </marker>
      </pattern>
      <disambig action="replace" postag="RG"/>
    </rule>
    <rule>
      <pattern>
          <token>não</token>
          <token>há</token>
        <marker>
          <token>tal</token>
        </marker>
      </pattern>
      <disambig action="replace" postag="RG"/>
    </rule>
  </rulegroup>

  <rulegroup id="TEMPO_A_FIO" name="Locuções adverbiais de tempo">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2018-12-09  -->
    <rule>
      <pattern>
          <token regexp='yes'>&expressoes_de_tempo;</token>
          <token>a</token>
          <token>fio</token>
      </pattern>
      <disambig action="replace"><wd pos="RG"/><wd pos="RG"/><wd pos="RG"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp='yes'>tempos?</token>
          <token>sem</token>
          <token>fim</token>
      </pattern>
      <disambig action="replace"><wd pos="RG"/><wd pos="RG"/><wd pos="RG"/></disambig>
    </rule>
  </rulegroup>

  <!--<rulegroup id="DE_FORMA_ADJECTIVE" name="De forma + adjectivo">
    Created by Tiago F. Santos, Portuguese rule, 2017-10-04 
    <rule>
      <pattern>
          <token>de</token>
          <token>forma</token>
          <token postag="A..[CF]S.+" postag_regexp="yes"/>
      </pattern>
      <disambig action="replace"><wd pos="RG"/><wd pos="RG"/><wd pos="RG"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token>de</token>
          <token regexp='yes'>jeito|modo</token>
          <token postag="A..[CM]S.+" postag_regexp="yes"/>
      </pattern>
      <disambig action="replace"><wd pos="RG"/><wd pos="RG"/><wd pos="RG"/></disambig>
    </rule>
  </rulegroup>-->

    <rule id="ADV_E_ADVMENTE" name="Advérbio curto + conjunção + advérbio de modo">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2019-08-19  -->
      <pattern>
          <token postag="A..[FC].+" postag_regexp="yes"/>
          <token regexp='yes'>e|ou</token>
          <token postag="R.+" postag_regexp="yes" regexp='yes'>.+mente</token>
      </pattern>
      <disambig action="replace"><wd pos="RM"/><wd pos="RM"/><wd pos="RM"/></disambig>
    </rule>

  <rulegroup id="D_R_N" name="Det + Adv + Nom">
    <!-- 		Based on Spanish disambiguation.xml by Tiago F. Santos		-->
    <rule>
      <pattern>
          <token postag="D.+" postag_regexp="yes"/>
        <marker>
          <token postag="R.+" postag_regexp="yes"><exception postag="A.*" postag_regexp="yes"/></token>
        </marker>
          <token postag="N.+" postag_regexp="yes">
            <exception>são</exception>
            <exception postag="(C|SP).*" postag_regexp="yes"/></token>
      </pattern>
      <disambig action="filter" postag="R.*"/>
    </rule>
    <rule>
      <pattern>
          <token postag="D.+" postag_regexp="yes">
            <exception negate_pos='yes'  postag="D.+" postag_regexp="yes"/></token>
          <token postag="R.+" postag_regexp="yes">
            <exception negate_pos='yes'  postag="R.+" postag_regexp="yes"/></token>
        <marker>
        <and>
          <token postag="N.+" postag_regexp="yes">
            <exception negate_pos='yes'  postag="[NV].+" postag_regexp="yes"/></token>
          <token postag="V.+" postag_regexp="yes"/>
        </and>
        </marker>
      </pattern>
      <disambig action="filter" postag="N.*"/>
    </rule>
  </rulegroup>
    
    <rulegroup id="PRON_VERB" name="não + pron + verb">
        <antipattern>
            <token postag="D..[MC][SN]." postag_regexp="yes"/>
            <token postag="NC[MC][SN]000" postag_regexp="yes"/>
        </antipattern>
        <antipattern>
            <token postag="D..[FC][SN]." postag_regexp="yes"/>
            <token postag="NC[FC][SN]000" postag_regexp="yes"/>
        </antipattern>
        <antipattern>
            <token postag="D..[MC][PN]." postag_regexp="yes"/>
            <token postag="NC[MC][PN]000" postag_regexp="yes"/>
        </antipattern>
        <antipattern>
            <token postag="D..[FC][PN]." postag_regexp="yes"/>
            <token postag="NC[FC][PN]000" postag_regexp="yes"/>
        </antipattern>
        <rule>
            <pattern>
                <token postag="RN|RG" postag_regexp="yes"><exception postag="CS"></exception></token>
                <token postag="P[^I].*" postag_regexp="yes"/>
                <token postag="V.[SI].*" postag_regexp="yes"/>
            </pattern>
            <disambig action="filterall"/>
        </rule>
    </rulegroup>

    <!-- DDN : Determinante possesivo + Determinante indefinido + Nome -->
    <!-- 		based on Spanish disambiguation.xml by Tiago F. Santos		-->
  <rulegroup id="DDN_U" name="Det + Nom + Adj">
    <rule>
      <antipattern>
          <token postag="D.+" postag_regexp="yes"/>
          <token postag="D.+" postag_regexp="yes"/> <!-- it was D[^P].+ -->
          <token postag="A.+" postag_regexp="yes"/>
          <token postag="N.+" postag_regexp="yes"/>
      </antipattern>
      <pattern>
        <marker>
          <unify>
            <feature id="gender"/>
            <feature id="number"/>
          <token postag="D.+" postag_regexp="yes"/>
          <token postag="D.+" postag_regexp="yes"/>
          <token postag="N.+" postag_regexp="yes"></token>
          </unify>
        </marker>
      </pattern>
      <disambig action="unify"/>
    </rule>
    <rule>
      <pattern>
        <marker>
          <unify>
            <feature id="gender"/>
            <feature id="number"/>
          <token postag="D.+" postag_regexp="yes"/>
          <token postag="D.+" postag_regexp="yes"/>
          <token postag="A.+" postag_regexp="yes"/>
          <token postag="N.+" postag_regexp="yes"/>
          </unify>
        </marker>
      </pattern>
      <disambig action="unify"/>
    </rule>
  </rulegroup>

  <rulegroup id="DNA" name="Det + Nom + Adj">
    <!-- DNA : Det + Nome + adjetivo-->
    <!-- 		based on from Spanish disambiguation.xml by Tiago F. Santos		-->
    <rule>
      <antipattern>
          <token>mal</token><!-- XXX 'mal' errors caught by MAL_MAU_CONFUSION -->
          <token postag="N.+" postag_regexp="yes"/>
      </antipattern>
      <pattern>
        <marker>
          <unify>
            <feature id="gender"/>
            <feature id="number"/>
          <token postag="D.+" postag_regexp="yes"/>
          <token postag="N.+" postag_regexp="yes">
            <exception regexp='yes'>m(?:ais|enos|)</exception></token>
          <token postag="A.+" postag_regexp="yes">
            <exception regexp='yes'>contra|dura|[sv]ão</exception>
            <exception postag_regexp='yes' postag='V.+' regexp='yes' case_sensitive='yes'>\p{Ll}+</exception></token>
          </unify>
        </marker>
      </pattern>
      <disambig action="unify"/>
      <example inputform="uma[um/DI0FS0,um/NCFS000,um/PI0FS000]" outputform="uma[um/DI0FS0]" type="ambiguous">É <marker>uma</marker> ocasião romântica.</example>
      <example type="untouched">É o mais ambicioso projeto.</example>
      <example type="untouched">É uma romântica ocasião.</example>
      <example type="untouched">Um <marker>mal trabalhador</marker> reclama de suas ferramentas.</example><!-- triggers MAL_MAU_CONFUSION -->
    </rule>
    <rule>
      <pattern>
        <marker>
          <unify>
            <feature id="gender"/>
            <feature id="number"/>
          <token postag="D.+" postag_regexp="yes"/>
        <unify-ignore>
          <token postag="R.+" postag_regexp="yes"/>
        </unify-ignore>
          <token postag="A.+" postag_regexp="yes"/>
          </unify>
        </marker>
      </pattern>
      <disambig action="filterall"/>
      <example inputform="o[o/DA0MS0,o/PD0MS000,o/PP3MSA00]" outputform="o[o/DA0MS0]" type="ambiguous">É <marker>o</marker> mais ambicioso projeto.</example>
      <example type="untouched">É uma ocasião romântica.</example>
    </rule>
  </rulegroup>

    <!-- DAN : Determinante + Adjetivo + Nome-->
    <!-- 		l18n from Spanish disambiguation.xml by Tiago F. Santos		-->
    <rule id="DAN" name="Det + Adj + Nom">
      <pattern>
        <marker>
          <unify>
            <feature id="gender"/>
            <feature id="number"/>
          <token postag="D.+" postag_regexp="yes"/>
          <token postag="A.+" postag_regexp="yes"/>
          <token postag="N.+" postag_regexp="yes">
            <exception postag="[DC].+|SPS00|(?:A..|N.)CN.+" postag_regexp="yes"/>
            <exception regexp="yes">era|são</exception></token>
          </unify>
        </marker>
      </pattern>
      <disambig action="unify"/>
      <example inputform="uma[um/DI0FS0,um/NCFS000,um/PI0FS000]" outputform="uma[um/DI0FS0]" type="ambiguous">É <marker>uma</marker> romântica ocasião.</example>
      <example type="untouched">É uma ocasião romântica.</example>
      <example type="untouched">...em 112 Trajano fixa o procedimento contra os cristãos.</example>
    </rule>

    <!-- NSN : Nom + Nom/Prep + Nom/Adj = prep -->
    <!-- 		l18n from Spanish disambiguation.xml by Tiago F. Santos		-->
    <rule id="NSN" name="Nom + Nom/Prep + Nom/Adj">
      <pattern>
          <token postag="N.+" postag_regexp="yes">
            <exception postag="RN|CS" postag_regexp="yes"/></token>
        <marker>
          <token postag="SP.+" postag_regexp="yes">
            <exception postag="NP.+" postag_regexp="yes"/></token><!-- XXX for compatibility with multiwords. Odd priorities in disambiguation since rules are jumped -->
        </marker>
          <token postag="[NA].+" postag_regexp="yes"/>
      </pattern>
      <disambig action="filter" postag="S.+"/>
    </rule>

    <!-- ANA : Adj + Nom/Adj + Adj = Nom -->
    <!-- 		l18n from Spanish disambiguation.xml by Tiago F. Santos		-->
    <rule id="ANA" name="Adj + Nom/Adj + Adj">
      <pattern>
          <token postag="A.+" postag_regexp="yes">
            <exception postag="[NV].+" postag_regexp="yes"/></token>
        <marker>
        <and>
          <token postag="N.+" postag_regexp="yes">
            <exception postag="V.+" postag_regexp="yes"/></token>
          <token postag="A.+" postag_regexp="yes"/>
        </and>
        </marker>
          <token postag="A.+" postag_regexp="yes">
            <exception postag="N.+" postag_regexp="yes"/></token>
      </pattern>
      <disambig action="filter" postag="N.+"/>
    </rule>
    
    <rule id="INFINITIVE_NOUN" name="saber, comer (infinitive / noun)">
        <!-- exception to DET_VERBONOME -->
        <pattern>
            <token>para</token>
            <marker>
                <token postag="V.N.*" postag_regexp="yes" regexp="yes">saber|comer</token>    
            </marker>
        </pattern>
        <disambig action="filter" postag="V.N.*"/>
    </rule>

  <rulegroup id="DET_VERBONOME" name="Det + Ver/Nom">
    <!-- Created by Tiago F. Santos, Portuguese rule  	-->
    <rule>
      <pattern>
          <token regexp="yes">&art_detecao_paronimos;
            <exception postag='SPS00'/><!-- XXX because it is disambiguated by S_V -->
            <exception regexp='yes'>à|nos</exception></token>
        <marker>
        <and>
          <token postag="N.+" postag_regexp="yes">
            <exception regexp='yes'>cercas?|são</exception></token>
          <token postag="V.+" postag_regexp="yes">
            <exception postag="VMN0000"/></token>
        </and>
        </marker>
      </pattern>
      <disambig action="remove" postag="V.+"/>
    <!--example type="ambiguous" inputform="cerca[cerca/NCFS000,cerca/RG,cercar/VMIP3S0,cercar/VMM02S0]" outputform="cerca[cerca/NCFS000,cerca/RG]">Dos <marker>cerca</marker> de 416 mil soldados que serviram, cerca de 60 mil...</example--><!-- XXX disambiguated by more specific CERCA_DE -->
      <example type="ambiguous" inputform="carpinteiro[carpinteirar/VMIP1S0,carpinteiro/NCMS000]" outputform="carpinteiro[carpinteiro/NCMS000]">O <marker>carpinteiro</marker> serra-te isso à medida.</example>
      <example type="untouched">Muitos destes “senhores dos mares” correm sérios riscos de deixarem de o <marker>ser</marker>.</example>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">&art_detecao_paronimos;
            <exception regexp='yes'>[ao]s?|nos|para</exception></token>
        <marker>
        <and>
          <token postag="N.+" postag_regexp="yes"/>
          <token postag="VMN0000"/>
        </and>
        </marker>
      </pattern>
      <disambig action="remove" postag="V.+"/>
      <example type="ambiguous" inputform="jantar[jantar/NCMS000,jantar/VMN0000,jantar/VMSF1S0,jantar/VMSF3S0]" outputform="jantar[jantar/NCMS000]">Um <marker>jantar</marker> à lareira parece-me bem.</example>
    </rule>
  </rulegroup>

  <rulegroup id="A_PREPOSITION" name="Verbo + a (preposição)">
    <!-- Verbo + Preposição: p.ex. 'a' como preposição depois do verbo	-->
    <!-- Created by Tiago F. Santos, Portuguese rule, 2016-11-15  	-->
    <!-- https://pt.wikipedia.org/wiki/A_(preposi%C3%A7%C3%A3o)		-->
    <rule>
      <pattern>
        <marker>
          <token>a</token>
        </marker>
          <token postag="[RZ].+" postag_regexp="yes"/>
      </pattern>
      <disambig action="filter" postag="S.+"/>
    </rule>
    <rule>
      <pattern>
        <marker>
          <token>a</token>
        </marker>
          <token regexp='yes'>mim|ti|si|[nv]ós|el[ae]s?|cavalo|convite|domícilio|fim|par|poucos?|muitos?|princípio|tempo|favor|exemplo|rigor|sério|título</token>
      </pattern>
      <disambig action="filter" postag="S.+"/>
    </rule>
    <rule>
      <pattern>
        <marker>
          <token>a</token>
        </marker>
          <token regexp='yes'>longo|sangue|todo</token>
          <token regexp='yes'>prazo|frio|custo</token>
      </pattern>
      <disambig action="filter" postag="S.+"/>
    </rule>
    <rule><!-- TODO too agressive. try disabling this rule in a day without many changes and see regression results -->
      <pattern>
          <token postag="V.+" postag_regexp="yes">
            <exception>para</exception>
            <exception inflected='yes' regexp='yes'>caminhar|correr|explicar|inaugurar|ver</exception></token>
          <token min='0' postag='R.' postag_regexp='yes'/>
        <marker>
          <token>a</token>
        </marker>
      </pattern>
      <disambig action="filter" postag="S.+"/>
      <example type='untouched'>...desde que foi inaugurada a República de Itália, em 1946,...</example>
    </rule>
    <rule>
      <pattern>
          <token postag='V.+' postag_regexp='yes' regexp='yes' inflected='yes'>&requer_crase_verbos;|a(?:plicar|ssemelhar)|comprometer|d(?:edicar|irigir)|e(?:levar|stender)|ir|limitar|observar|p(?:[ôo]r|ertencer)|r(?:eagir|ecorrer|eferir|estringir)|sobrep[ôo]r|ver</token><!-- XXX ambiguous: juntar|alagar -->
          <token regexp='yes' spacebefore='no'>&hifen;</token>
          <token postag='P.+' postag_regexp='yes' spacebefore='no'/>
          <token min='0' postag='R.' postag_regexp='yes'/>
        <marker>
          <token>a</token>
        </marker>
      </pattern>
      <disambig action='filter' postag='S.+'/>
    </rule>
    <rule>
      <pattern>
          <token regexp='yes'>&requer_crase;</token>
        <marker>
          <token>a</token>
        </marker>
      </pattern>
      <disambig action="filter" postag="S.+"/>
    </rule>
    <rule>
      <pattern>
          <token inflected='yes'>ser</token>
          <token postag='A.+' postag_regexp='yes'/>
        <marker>
          <token>a</token>
        </marker>
      </pattern>
      <disambig action="filter" postag="S.+"/>
    </rule>
    <rule>
      <pattern>
          <token postag_regexp="yes" postag="SENT_START|_PUNCT|V.+"/>
          <token>não</token>
        <marker>
          <token>a</token>
        </marker>
      </pattern>
      <disambig action="filter" postag="S.+"/>
    </rule>
  </rulegroup>

    <!--P_V Quando está a frente de um verbo, trata-se de um pronome-->
    <!-- 		l18n from Spanish disambiguation.xml by Tiago F. Santos		-->
    <rule id="P_V" name="Pronome + Verbo">
      <pattern>
        <token><exception postag="SPS00"></exception></token>
        <marker>
        <and>
          <token postag="D.+" postag_regexp="yes"/>
          <token postag="[PN].+" postag_regexp="yes"/>
        </and>
        </marker>
          <token postag="V.+" postag_regexp="yes">
            <exception negate_pos='yes' postag="V.+" postag_regexp="yes"/></token>
      </pattern>
      <disambig action="filter" postag="P.+|N.+"/>
      <example type="untouched">Muito obrigada por esta viagem maravilhosa.</example>
      <example type="untouched">Escreva seu endereço aqui.</example>
      <example type="untouched">Durante seu reinado, os Durrani consolidaram em uma só nação.</example>
    </rule>

  <rulegroup id="S_V" name="Preposição + Verbo">
    <rule>
    <!-- 		Created by Tiago F. Santos, 2017-07-15		-->
      <antipattern><!-- e.g. 'Só a olhar' and other 'continuous' infinitives -->
        <token postag='[VR].+' postag_regexp='yes'/>
        <token>a</token>
        <token postag='VMN0000'/>
      </antipattern>
      <antipattern><!-- e.g. Estavam 'a sentir pressões' -->
        <token>a</token>
        <token postag='VMN0000'/>
        <token postag='N.F.+' postag_regexp='yes'/>
      </antipattern>
      <pattern>
          <token postag="SPS00" postag_regexp="no">
            <exception postag="SP.+" postag_regexp="yes" negate_pos='yes'/></token>
        <marker>
        <and>
          <token postag="V.+" postag_regexp="yes"/>
          <token postag="N.+" postag_regexp="yes"/>
        </and>
        </marker>
      </pattern>
      <disambig action="remove" postag="V.+"/>
      <example inputform="impacto[impactar/VMIP1S0,impacto/AQ0MS0,impacto/NCMS000]" outputform="impacto[impacto/AQ0MS0,impacto/NCMS000]" type="ambiguous">É uma obra com <marker>impacto</marker> ecológico relevante.</example>
      <example type="untouched">Ele não o fez de bom grado, mas era necessário.</example>
      <example type="untouched">Só a olhar.</example>
    </rule>
    <rule>
      <pattern>
        <token postag='[VR].+' postag_regexp='yes'/>
        <token>a</token>
        <marker>
        <token postag='VMN0000'/>
        </marker>
      </pattern>
      <disambig action='filter' postag="VMN0000"/>
      <!-- e.g. Estavam 'a sentir pressões' -->
    </rule>
    <rule>
      <pattern>
          <token>a</token>
        <marker>
        <token postag='VMN0000'/>
        </marker>
        <token postag='N.F.+' postag_regexp='yes'/>
      </pattern>
      <disambig action='filter' postag="VMN0000"/>
      <!-- e.g. Estavam 'a sentir pressões' -->
    </rule>
  </rulegroup>

    <rule id="PARA_WORKAROUND" name="Para">
      <pattern>
          <token>
            <exception regexp="yes">el[ea]|carro</exception></token>
        <marker>
          <token>para</token>
        </marker>
          <token>
            <exception>em</exception></token>
      </pattern>
      <disambig action='remove' postag="V.+"/>
    </rule>

    <!-- D_N Quando está diante de um nome, trata-se de um determinante.-->
    <!-- 		l18n from Spanish disambiguation.xml by Tiago F. Santos		-->
    <rule id="D_N" name="Artigo + Nome">
      <antipattern>
        <token inflected='yes'>ser</token>
        <token regexp='yes'>tod[ao]s?</token>
      </antipattern>
      <!-- TODO fix bug in antipattern. Antipattern base code does not trigger here -->
      <!--antipattern>
        <token inflected='yes'>abrir</token>
        <token skip='-1'>espaço</token>
        <token>a</token>
      </antipattern-->
      <antipattern>
        <token inflected='yes' regexp='yes' skip='-1'>&requer_crase;|&requer_crase_verbos;|chegar|limitar</token><!-- ambiguous: ir -->
        <token>a</token>
      </antipattern>
      <antipattern>
        <token postag='A.+' postag_regexp='yes'/>
        <token>a</token>
        <token postag='N.M.+' postag_regexp='yes'/>
      </antipattern>
      <antipattern>
        <token>ambos</token>
        <token postag='N.(F.|MS).+' postag_regexp='yes'/>
      </antipattern>
      <antipattern>
        <token regexp='yes'>[,;—]|&hifen;|e</token>
        <token>a</token>
        <token postag='N.(M.|FP).+' postag_regexp='yes'/>
      </antipattern>
      <pattern>
        <marker>
          <token postag="D.+" postag_regexp="yes">
            <exception postag="R.*" postag_regexp="yes"/></token>
        </marker>
          <token postag="[PNA].*" postag_regexp="yes">
            <exception postag="V.+" postag_regexp="yes"/></token>
      </pattern>
      <disambig action="filter" postag="D.+"/>
      <example type='untouched'>Éramos todos família.</example>
      <example type='untouched'>Quantos aderiram realmente a essa greve?</example>
      <example type='untouched'>Os cigarros eletrónicos a vapor também comportam riscos.</example>
      <example type='untouched'>Algo que nos une como plataforma a tantos continentes, a tantos oceanos, a tantas culturas, a tantas civilizações</example>
      <!--example type='untouched'>A decisão de abrir espaço a eleições antecipadas é dele.</example-->
      <!-- TODO fix bug in antipattern. Antipattern does not trigger here -->
    </rule>

    <rule id="AMBOS_PREPOSITION" name="Verbo + ambos">
    <!-- 		Created by Tiago F. Santos, 2019-08-25		-->
      <pattern>
        <token postag='V....P.+' postag_regexp='yes'/>
        <token postag='P.+' postag_regexp='yes'>ambos</token>
        <token postag='N.(F.|MS).+' postag_regexp='yes'/>
      </pattern>
      <disambig action="filterall"/>
    </rule>

  <rulegroup id="JUNTA_VERBO" name="junta como verbo">
    <!-- 		Created by Tiago F. Santos, 2019-09-06		-->
    <rule>
      <pattern>
          <token>junta
            <exception scope='previous' regexp='yes'>[dn]a|uma</exception>
            <exception scope='next' regexp='yes'>d[eao]s?|comercial|militar|popular</exception></token>
      </pattern>
      <disambig action="filter" postag='V.+'/>
    </rule>
    <rule>
      <pattern>
          <token regexp='yes'>[dn]as?|umas?</token>
        <marker>
          <token regexp='yes'>juntas?</token>
        </marker>
      </pattern>
      <disambig action="filter" postag='[AN].+'/>
    </rule>
    <rule>
      <pattern>
        <marker>
          <token regexp='yes'>juntas?</token>
        </marker>
          <token regexp='yes'>d[eao]s?|comercia(?:is|l)|militar(?:es)?|popular(?:es)?</token>
      </pattern>
      <disambig action="filter" postag='[AN].+'/>
    </rule>
  </rulegroup>

    <rule id="AVANCA_NUMEROS" name="avança números">
    <!-- 		Created by Tiago F. Santos, 2019-08-30		-->
      <pattern>
          <token>avança</token>
          <token>números</token>
      </pattern>
      <disambig action="replace"><wd pos="VMIP3S0"/><wd pos="NCMP000"/></disambig>
    </rule>

  <rulegroup id="ERA_GARANTE_VERB" name="Era/Garante como verbo">
    <!-- 		Created by Tiago F. Santos, 2019-08-25		-->
    <rule>
      <pattern>
          <token postag='N.(F.|.P).+' postag_regexp='yes'/>
        <marker>
          <token>garante</token>
        </marker>
      </pattern>
      <disambig action="filter" postag='V.+'/>
    </rule>
    <rule>
      <pattern>
        <marker>
          <token>garante</token>
        </marker>
          <token postag='N.(F.|.P).+' postag_regexp='yes'/>
      </pattern>
      <disambig action="filter" postag='V.+'/>
    </rule>
    <rule>
      <pattern>
          <token postag='(?:N|A.).(M.|.P).+' postag_regexp='yes'/>
        <marker>
          <token>era</token>
        </marker>
      </pattern>
      <disambig action="filter" postag='V.+'/>
    </rule>
  </rulegroup>

  <rulegroup id="DEVIDO_AX" name="Devido + a + artigo">
    <!-- 		Created by Tiago F. Santos, 2019-08-21		-->
    <rule>
      <pattern>
        <token>devido</token>
        <token>à</token>
      </pattern>
      <disambig action="replace"><wd pos="SP000"/><wd pos="DA0FS0"/></disambig>
    </rule>
    <rule>
      <pattern>
        <token>devido</token>
        <token>às</token>
      </pattern>
      <disambig action="replace"><wd pos="SP000"/><wd pos="DA0FP0"/></disambig>
    </rule>
    <rule>
      <pattern>
        <token>devido</token>
        <token>ao</token>
      </pattern>
      <disambig action="replace"><wd pos="SP000"/><wd pos="DA0MS0"/></disambig>
    </rule>
    <rule>
      <pattern>
        <token>devido</token>
        <token>aos</token>
      </pattern>
      <disambig action="replace"><wd pos="SP000"/><wd pos="DA0MP0"/></disambig>
    </rule>
  </rulegroup>

    <rule id="SER_TODOS" name="Ser + Todos">
      <pattern>
        <token inflected='yes'>ser</token>
        <marker>
        <token regexp='yes'>todos?</token>
        </marker>
      </pattern>
      <disambig action="filter" postag="P.+"/>
      <example inputform="todos[todo/DI0MP0,todo/PI0MP000]" outputform="todos[todo/PI0MP000]" type="ambiguous">Éramos <marker>todos</marker> família.</example>
    </rule>

    <!-- P_N Possesivo + nome -->
    <!-- 		l18n from Spanish disambiguation.xml by Tiago F. Santos		-->
    <rule id="PN" name="Pos + Nom ">
      <pattern>
        <marker>
          <unify>
            <feature id="gender"/>
            <feature id="number"/>
          <token postag="DP.+" postag_regexp="yes"/>
          <token postag="N.+" postag_regexp="yes">
            <exception postag="C.|S.+|R.+" postag_regexp="yes"/></token>
          </unify>
        </marker>
          <token>
            <exception postag="V.+" postag_regexp="yes"/></token>
      </pattern>
      <disambig action="unify"/>
    <!--Example: seu irmão-->
    </rule>

  <rulegroup id="PV" name="PP + VERBO ">
    <!-- 		Created by Tiago F. Santos, 2019-03-16		-->
    <rule>
      <pattern>
          <token regexp='yes'>eu|tu|el[ea]s?|[nv]ós|vocês?</token>
        <marker>
        <and>
          <token postag="N.+" postag_regexp="yes"/>
          <token postag="V.+" postag_regexp="yes"/>
        </and>
        </marker>
      </pattern>
      <disambig action="filter" postag="V.+"/>
    <!--Example: Ele casa -->
    </rule>
    <rule>
      <pattern>
          <token regexp='yes' spacebefore='yes'>&pronomes_nao_ambiguos;</token>
        <marker>
        <and>
          <token postag="N.+" postag_regexp="yes"/>
          <token postag="V.+" postag_regexp="yes"/>
        </and>
        </marker>
      </pattern>
      <disambig action="filter" postag="V.+"/>
    <!--Example: Ele casa -->
    </rule>
  </rulegroup>

    <rule id="PREPOSITION_SE" name="'Se' como preposição">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-08-28  	-->
      <pattern>
          <token regexp="yes">&hifen;</token>
        <marker>
          <token postag_regexp='yes' postag="P.+"  spacebefore='no'/>
        </marker>
      </pattern>
      <disambig action="filter" postag="P.+"/>
      <example inputform="se[se/CS,se/PP3CN000]" outputform="se[se/PP3CN000]" type="ambiguous">Testa-<marker>se</marker>.</example>
      <example inputform="o[o/DA0MS0,o/PD0MS000,o/PP3MSA00]" outputform="o[o/PD0MS000,o/PP3MSA00]" type="ambiguous">Testa-<marker>o</marker>.</example>
    </rule>
    
    <rule id="NOS_DEU" name="nos deu, nos servia...">
        <pattern>
            <marker>
                <token postag="PP.*" postag_regexp="yes">nos</token>
            </marker>
            <!--<token regexp="yes">deu|servia</token>-->
            <token postag="V.[IS].*" postag_regexp="yes"><exception postag="NCMP000"/></token>
        </pattern>
        <disambig action="remove" postag="SP.*"/>
    </rule>

    <rule id="PREPOSICIONAL_PHRASES" name="Expressões prepositivas">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-09-06  	-->
      <pattern>
        <marker>
          <token regexp='yes'>face|frente|graças|quanto|referente|relativamente|rumo</token><!-- XXX do not add devido. needs agreement -->
        </marker>
          <token regexp='yes'>[aà]o?s?</token>
      </pattern>
      <disambig action="replace"><wd pos="SP000"/></disambig>
    </rule>

    <rule id="MESMO" name="Mesmo">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-09-27  	-->
      <antipattern><!-- XXX D_R_N -->
          <token spacebefore='yes' postag_regexp='yes' postag="D.+"/>
          <token>mesmo</token>
          <token postag="N.+" postag_regexp="yes">
            <exception>são</exception>
            <exception postag="(C|SP).*" postag_regexp="yes"/></token>
      </antipattern>
      <pattern>
          <token spacebefore='yes' postag_regexp='yes' postag="[DP].+"/><!-- TODO add S.+ after proper splitting -->
        <marker>
          <token>mesmo</token>
        </marker>
      </pattern>
      <disambig action="remove"><wd pos="RG"/></disambig>
    </rule>

    <rule id="TANTO_COMO" name="Tanto ... como ...">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-11-15  	-->
      <pattern>
        <marker>
          <token regexp="yes">tão|tanto</token>
        </marker>
          <token max='2'/>
          <token>como</token>
      </pattern>
      <disambig action="replace" postag="RG"/>
    </rule>

    <rule id="COR_DE_XXXX" name="Cores como adjetivo">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-11-18  	-->
      <pattern>
          <token postag="N.+" postag_regexp='yes'/>
        <marker>
          <token>cor</token>
          <token>de</token>
          <token regexp='yes'>c(?:afé|hocolate)|laranja|rosa|tijolo|vinho</token>
        </marker>
      </pattern>
      <disambig action="replace"><wd pos="AQ0CN0_"/><wd pos="AQ0CN0_"/><wd pos="AQ0CN0_"/></disambig>
    </rule>

    <rule id="ALIMENTAR_EXPECTATIVAS" name="Expectativas">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-09-27  	-->
      <pattern>
        <marker>
        <and>
          <token postag="V.+" postag_regexp='yes'/>
          <token postag="[AN].+" postag_regexp='yes'/>
        </and>
        </marker>
          <token regexp='yes' min='0'>as?</token>
          <token regexp='yes'>expec?tativas?</token>
      </pattern>
      <disambig action="filter" postag="V.+"/>
    </rule>

    <rule id='PHONETIC_INFINITIVE_FIX' name='correção de infinitivo fonético'>
    <!-- Created by Tiago F. Santos, Portuguese rule, 2016-XX-XX  	-->
      <pattern>
          <token postag="VMN0000" regexp='yes'>.+[^r]$</token>
      </pattern>
      <disambig action="remove" postag="V.N.+"/>
    </rule>
    <rule id="PUNCT" name="Pontuação">
    <!-- 		l18n from Spanish disambiguation.xml by Tiago F. Santos		-->
      <pattern>
          <token regexp="yes">[.,;:!?…()\[\]&#8209;&#8210;&#8211;&#8212;&#8213;«»”“‘’'\-]|[\*×∗·\+\/÷:=]</token>
      </pattern>
      <disambig action="add"><wd pos="_PUNCT"/></disambig>
    </rule>
    <rule id="TRES_PONTOS" name="Reticencias">
    <!-- 		l18n from Catalan disambiguation.xml by Tiago F. Santos		-->
      <pattern>
          <token>.</token>
          <token>.</token>
          <token>.</token>
      </pattern>
      <disambig action="add"><wd pos="_TRESPONTOS"/><wd pos="_TRESPONTOS"/><wd pos="_TRESPONTOS"/></disambig>
    </rule>

  <rulegroup id="QUOT" name="Quotation marks">
    <!-- 		l18n from English disambiguation.xml by Tiago F. Santos		-->
    <rule>
      <pattern>
          <token postag="SENT_START"/>
        <marker>
          <token>&quot;</token>
        </marker>
      </pattern>
      <disambig postag="``"/>
      <example type="untouched">Examplo 'a'</example>
      <example type="untouched">Examplo &quot;a</example>
      <example type="ambiguous" inputform="&quot;[&quot;/'',&quot;/``]" outputform="&quot;[&quot;/``]"><marker>&quot;</marker>Um teste.</example>
    </rule>
    <rule>
      <pattern>
          <token>
            <exception regexp="yes">\p{Ps}</exception></token>
        <marker>
        <and>
          <token postag="``" spacebefore="no">&quot;</token>
          <token postag="''" spacebefore="no">&quot;</token>
        </and>
        </marker>
      </pattern>
      <disambig postag="''"/>
      <example type="untouched">Examplo 'a'</example>
      <example type="untouched">Examplo &quot;a</example>
      <example type="untouched">Examplo (&quot;a</example>
      <example type="ambiguous" inputform="&quot;[&quot;/'',&quot;/``]" outputform="&quot;[&quot;/'']">Um &quot;teste<marker>&quot;</marker>.</example>
    </rule>
    <rule>
      <pattern>
        <marker>
        <and>
          <token postag="''" spacebefore="yes">&quot;</token>
          <token postag="``" spacebefore="yes">&quot;</token>
        </and>
        </marker>
      </pattern>
      <disambig postag="``"/>
      <example type="untouched">Examplo 'a'</example>
      <example type="untouched">Examplo a&quot;</example>
      <example type="ambiguous" inputform="&quot;[&quot;/'',&quot;/``]" outputform="&quot;[&quot;/``]">Um <marker>&quot;</marker>teste&quot;.</example>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">\p{Ps}</token>
        <marker>
        <and>
          <token postag="``" spacebefore="no">&quot;</token>
          <token postag="''" spacebefore="no">&quot;</token>
        </and>
        </marker>
      </pattern>
      <disambig postag="``"/>
      <example type="untouched">Examplo 'a'</example>
      <example type="untouched">Examplo &quot;a</example>
      <example type="untouched">Examplo a&quot;</example>
      <example type="ambiguous" inputform="&quot;[&quot;/'',&quot;/``]" outputform="&quot;[&quot;/``]">Um (<marker>&quot;</marker>teste&quot;.</example>
    </rule>
  </rulegroup>
  
  <rule id="QUOTATION_MARCOAGPINTO" name="Aspas MARCOAGPINTO">
    <!--      Created by Marco A.G.Pinto, Portuguese 2021-11-05 (25-JUN-2021+)      -->
    <pattern>
      <token regexp="yes">[»«"”‘‹›']</token>
    </pattern>
    <disambig action="add"><wd pos="_QUOT"/></disambig>
  </rule>

  <rulegroup id="VERBOS_COMPOSTOS" name="Verbos compostos">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2018-07-08  	-->
    <rule>
      <pattern>
          <token inflected='yes'>levar</token>
          <token>a</token>
        <marker>
          <token>cabo</token>
        </marker>
      </pattern>
      <disambig action="replace" postag="RG"/>
    </rule>
    <rule>
      <pattern>
        <marker>
          <token inflected='yes'>levar</token>
        </marker>
          <token>a</token>
          <token>cabo</token>
      </pattern>
      <disambig action="filter" postag="V.+"/>
    </rule>
  </rulegroup>

    <rule id="DEVE_SER" name="Deve + Infinitivo">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2018-07-08  	-->
      <pattern>
        <marker>
          <token inflected='yes'>dever</token>
        </marker>
          <token postag="VMN0000"/>
      </pattern>
      <disambig action="filter" postag="V.+"/>
    </rule>

  <rulegroup id="PERIFRASES" name="Perífrases de infinitivo">
    <rule>
    <!-- Created by Tiago F. Santos, Portuguese rule, 2018-07-04  	-->
      <pattern>
          <token inflected='yes'>ir</token>
          <token regexp='yes'>tod[ao]s</token>
        <marker>
          <token postag="VMN0000"/>
        </marker>
      </pattern>
      <disambig action="filter" postag="VMN0000"/>
    </rule>
    <!-- 		l18n from Galician disambiguation.xml by Tiago F. Santos		-->
    <rule>
      <pattern>
          <token inflected="yes" regexp="yes">haver|ter</token>
          <token>que</token>
        <marker>
          <token postag="VMN0000">
            <exception negate_pos="yes" postag="V.+" postag_regexp="yes"/></token>
        </marker>
      </pattern>
      <disambig postag="VMN0000"/>
    </rule>
    <rule>
      <pattern>
          <token inflected="yes" regexp="yes">estar|andar|levar|continuar|seguir|ser|colocar|começar|pegar|vir|chegar|voltar|tornar|romper|pôr</token>
          <token>a</token>
        <marker>
          <token postag="VMN0000">
            <exception negate_pos="yes" postag="V.+" postag_regexp="yes"/></token>
        </marker>
      </pattern>
      <disambig postag="VMN0000"/>
    </rule>
    <rule>
      <pattern>
          <token inflected="yes" regexp="yes">dever|haver|deixar|parar|acabar|rematar|terminar|vir|ter</token>
          <token>de</token>
        <marker>
          <token postag="VMN0000">
            <exception negate_pos="yes" postag="V.+" postag_regexp="yes"/></token>
        </marker>
      </pattern>
      <disambig postag="VMN0000"/>
    </rule>
    <rule>
      <pattern>
          <token inflected="yes">acabar</token>
          <token>por</token>
        <marker>
          <token postag="VMN0000">
            <exception negate_pos="yes" postag="V.+" postag_regexp="yes"/></token>
        </marker>
      </pattern>
      <disambig postag="VMN0000"/>
    </rule>
    <rule>
      <pattern>
          <token inflected="yes">estar</token>
          <token>para</token>
        <marker>
          <token postag="VMN0000">
            <exception negate_pos="yes" postag="V.+" postag_regexp="yes"/></token>
        </marker>
      </pattern>
      <disambig postag="VMN0000"/>
    </rule>
    <rule>
      <pattern>
          <token inflected="yes">dar</token>
          <token>em</token>
        <marker>
          <token postag="VMN0000">
            <exception negate_pos="yes" postag="V.+" postag_regexp="yes"/></token>
        </marker>
      </pattern>
      <disambig postag="VMN0000"/>
    </rule>
    <rule>
      <pattern>
          <token inflected="yes" regexp="yes">querer|ir|dever|haver|poder|voltar|adoptar|adotar|acostumar</token>
        <marker>
          <token postag="VMN0000">
            <exception negate_pos="yes" postag="V.+" postag_regexp="yes"/></token>
        </marker>
      </pattern>
      <disambig postag="VMN0000"/>
    </rule>
  </rulegroup>

    <rule id="VOGAIS" name="[^o|letra] e[subst|conj] (e[subst])">
    <!-- 		l18n from Galician disambiguation.xml by Tiago F. Santos		-->
      <pattern>
          <token>
            <exception regexp="yes">os?|letras?|voga(l|is)</exception></token>
        <marker>
          <token regexp="yes">[aeo]</token>
        </marker>
      </pattern>

      <disambig action="remove"><wd pos="NCMS000"/></disambig>
    </rule>

  <rulegroup  id="NUMBER_OF_TIMES" name="Número de vezes">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2016-11-15  	-->
    <rule>
      <pattern>
          <token>uma</token>
          <token>vez</token>
      </pattern>
      <disambig action="replace"><wd pos="RG"/><wd pos="RG"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">muitas|tantas|duas|&numero_por_extenso_CP;</token>
          <token>vezes</token>
      </pattern>
      <disambig action="replace"><wd pos="RG"/><wd pos="RG"/></disambig>
    </rule>
  </rulegroup>

  <rulegroup id="NUMBER" name="Number">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2016-11-15  	-->
    <rule>
      <pattern>
          <token regexp="yes">[1234567890]+</token>
      </pattern>
      <disambig postag="Z0CN0"/>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">[1234567890][1234567890., ]+[1234567890]</token>
      </pattern>
      <disambig postag="Z0CN0"/>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">&numero_por_extenso_CP;</token>
      </pattern>
      <disambig action="add"><wd pos="Z0CP0"/></disambig>
    </rule>
    <rule>
      <antipattern>
          <token>cento</token>
          <token>e</token>
      </antipattern>
      <pattern>
          <token regexp="yes">&numero_por_extenso_MP;
            <exception>uns</exception></token>
      </pattern>
      <disambig action="add"><wd pos="Z0MP0"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">&numero_por_extenso_FP;
            <exception>umas</exception></token>
      </pattern>
      <disambig action="add"><wd pos="Z0FP0"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">&numero_por_extenso_MS;</token>
      </pattern>
      <disambig action="add"><wd pos="Z0MS0"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">&numero_por_extenso_FS;</token>
      </pattern>
      <disambig action="add"><wd pos="Z0FS0"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token postag_regexp="yes" postag='Z0M[SPN]0'>
            <exception regexp='yes'>\d+</exception></token>
          <token postag_regexp="yes" postag='Z0[MC][SPN]0'/>
      </pattern>
      <disambig action="replace"><wd pos="Z0MP0"/><wd pos="Z0MP0"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token postag_regexp="yes" postag='Z0[CM][SPN]0'>
            <exception regexp='yes'>\d+</exception></token>
          <token postag_regexp="yes" postag='Z0M[SPN]0'/>
      </pattern>
      <disambig action="replace"><wd pos="Z0MP0"/><wd pos="Z0MP0"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token postag_regexp="yes" postag='Z0F[SPN]0'>
            <exception regexp='yes'>\d+</exception></token>
          <token postag_regexp="yes" postag='Z0[CF][SPN]0'/>
      </pattern>
      <disambig action="replace"><wd pos="Z0FP0"/><wd pos="Z0FP0"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token postag_regexp="yes" postag='Z0[CF][SPN]0'>
            <exception regexp='yes'>\d+</exception></token>
          <token postag_regexp="yes" postag='Z0F[SPN]0'/>
      </pattern>
      <disambig action="replace"><wd pos="Z0FP0"/><wd pos="Z0FP0"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token postag_regexp="yes" postag='Z0M[SPN]0'>
            <exception regexp='yes'>\d+</exception></token>
          <token regexp='yes'>e|-</token>
          <token postag_regexp="yes" postag='Z0[MC][SPN]0'/>
      </pattern>
      <disambig action="replace"><wd pos="Z0MP0"/><wd pos="Z0MP0"/><wd pos="Z0MP0"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token postag_regexp="yes" postag='Z0[CM][SPN]0'>
            <exception regexp='yes'>\d+|0|zeros?|2\.0</exception></token>
          <token regexp='yes'>e|-</token>
          <token postag_regexp="yes" postag='Z0M[SPN]0'/>
      </pattern>
      <disambig action="replace"><wd pos="Z0MP0"/><wd pos="Z0MP0"/><wd pos="Z0MP0"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token postag_regexp="yes" postag='Z0F[SPN]0'>
            <exception regexp='yes'>\d+</exception></token>
          <token regexp='yes'>e|-</token>
          <token postag_regexp="yes" postag='Z0[CF][SPN]0'/>
      </pattern>
      <disambig action="replace"><wd pos="Z0FP0"/><wd pos="Z0FP0"/><wd pos="Z0FP0"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token postag_regexp="yes" postag='Z0[CF][SPN]0'>
            <exception regexp='yes'>\d+</exception></token>
          <token regexp='yes'>e|-</token>
          <token postag_regexp="yes" postag='Z0F[SPN]0'/>
      </pattern>
      <disambig action="replace"><wd pos="Z0FP0"/><wd pos="Z0FP0"/><wd pos="Z0FP0"/></disambig>
    </rule>
  </rulegroup>

    <rule id="A_RANGE" name="Range">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2016-11-15  	-->
      <pattern>
          <token postag_regexp="yes" postag='Z.+'/>
        <marker>
          <token>a</token>
        </marker>
          <token postag_regexp="yes" postag='Z.+'/>
      </pattern>
      <disambig postag="SP000"/>
    </rule>

  <rulegroup id="ROMAN_NUMBER" name="Roman number">
    <!-- 		l18n from french and catalan disambiguation.xml by Tiago F. Santos		-->
    <rule>
      <pattern>
          <token regexp="yes" case_sensitive="yes">(?=[MDCLXVI])M*(C[MD]|D?C*)(X[CL]|L?X*)(I[XV]|V?I*)</token>
      </pattern>
      <disambig postag="ZRCN0"/>
    </rule>
    <rule>
      <pattern case_sensitive="yes">
        <marker>
          <token regexp="yes">(?=.)M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})</token>
        </marker>
      </pattern>
      <disambig action="add"><wd pos="AO0CN0"/></disambig>
    </rule>
    <rule>
      <pattern case_sensitive="yes">
        <marker>
          <token regexp="yes" spacebefore="yes">(?=.)m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|i{0,3}|iv|vi{0,3})
            <exception regexp='yes'>li|vi</exception></token>
        </marker>
      </pattern>
      <disambig action="add"><wd pos="AO0CN0"/></disambig>
    </rule>
    <rule>
      <pattern case_sensitive="yes">
          <token postag="SENT_START"/>
        <marker>
          <token regexp="yes">(?=.)m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|i{0,3}|iv|vi{0,3})
            <exception regexp='yes'>li|vi</exception></token>
        </marker>
      </pattern>
      <disambig action="add"><wd pos="AO0CN0"/></disambig>
    </rule>
    <rule>
      <pattern case_sensitive="yes">
          <token>-</token>
        <marker>
          <token regexp="yes">(?=.)m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|i{0,3}|iv|vi{0,3})
            <exception regexp='yes'>li|vi</exception></token>
        </marker>
      </pattern>
      <disambig action="add"><wd pos="AO0CN0"/></disambig>
    </rule>
    <rule>
      <pattern case_sensitive="yes">
          <token>-</token>
        <marker>
          <token regexp="yes">[ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫⅬⅭⅮⅯ]+</token>
        </marker>
      </pattern>
      <disambig action="add"><wd pos="AO0CN0"/></disambig>
    </rule>
    <rule>
      <pattern case_sensitive="no">
          <token regexp="yes">(?:xc|x?l|l?x{0,3})(?:ix|i{0,3}|iv|v|vi{0,3})</token>
          <token spacebefore='no'>)</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
  </rulegroup>

  <rulegroup id="PERCENTAGES" name="Percentagens">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2016-11-15  	-->
    <rule>
      <pattern>
          <token regexp="yes">[\d,. ]+[&#37;&#8240;&#8241;]
            <exception scope='next' postag_regexp='yes' postag='A.+'/>
            <exception regexp='yes'>1 ?[&#37;&#8240;&#8241;]</exception></token>
      </pattern>
      <disambig action="replace"><wd pos="NCMP000"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">1 ?[&#37;&#8240;&#8241;]
            <exception scope='next' postag_regexp='yes' postag='A.+'/></token>
      </pattern>
      <disambig action="replace"><wd pos="NCMN000"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">[\d,. ]+[&#37;&#8240;&#8241;]</token>
          <token postag_regexp='yes' postag='A..MS.+'>
            <exception>são</exception></token>
      </pattern>
      <disambig action="replace"><wd pos="AQ0MS0"/><wd pos="AQ0MS0"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">[\d,. ]+[&#37;&#8240;&#8241;]</token>
          <token postag_regexp='yes' postag='A..FS.+'>
            <exception>são</exception></token>
      </pattern>
      <disambig action="replace"><wd pos="AQ0FS0"/><wd pos="AQ0FS0"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">[\d,. ]+[&#37;&#8240;&#8241;]</token>
          <token postag_regexp='yes' postag='A..MP.+'>
            <exception>são</exception></token>
      </pattern>
      <disambig action="replace"><wd pos="AQ0MP0"/><wd pos="AQ0MP0"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">[\d,. ]+[&#37;&#8240;&#8241;]</token>
          <token postag_regexp='yes' postag='A..FP.+'>
            <exception>são</exception></token>
      </pattern>
      <disambig action="replace"><wd pos="AQ0FP0"/><wd pos="AQ0FP0"/></disambig>
    </rule>
    <rule>
      <pattern>
        <marker>
          <token regexp="yes">[\d,. ]+[&#37;&#8240;&#8241;]</token>
        </marker>
          <token postag_regexp='yes' postag='RG.*'/>
      </pattern>
      <disambig action="replace"><wd pos="RG"/></disambig>
    </rule>
  </rulegroup>

  <rulegroup id="DEGREES" name="Graus">
    <!-- Created by Tiago F. Santos, Portuguese rule  	-->
    <rule>
      <pattern>
          <token regexp="yes">1[º°′″‴] ?[CFKNSEWO]?
            <exception>1º</exception></token>
      </pattern>
      <disambig action="replace"><wd pos="NCMS000"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">[\d,. ]+[º°′″‴][CFKNSEWO]?
            <exception regexp='yes'>1[º°′″‴].?</exception>
            <exception regexp='yes'>\d+º</exception></token>
      </pattern>
      <disambig action="replace"><wd pos="NCMP000"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">1[º°′″‴]</token>
          <token regexp="yes" spacebefore='yes'>[CFKNSEWO]
            <exception case_sensitive='yes' regexp='yes'>[eo]</exception></token>
      </pattern>
      <disambig action="replace"><wd pos="NCMS000"/><wd pos="NCMN000"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">[\d,. ]+[º°′″‴]</token>
          <token regexp="yes" spacebefore='yes'>[CFKNSEWO]
            <exception case_sensitive='yes' regexp='yes'>[eo]</exception></token>
      </pattern>
      <disambig action="replace"><wd pos="NCMP000"/><wd pos="NCMN000"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">[º°][CFKNSEWO]</token>
      </pattern>
      <disambig action="replace"><wd pos="NCMN000"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp='yes'>\d+[\.&#57347;]?º</token>
          <token regexp='yes'>\d+(?:[\.,]\d+)?[′']</token>
      </pattern>
      <disambig action="replace"><wd pos="NCMN000"/><wd pos="NCMN000"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">[\d,. ]*[º°′″‴][CFKNSEWO]</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
  </rulegroup>

  <rulegroup id="ORDINALS" name="Ordinais">
    <!-- Created by Tiago F. Santos, Portuguese rule 	-->
    <rule>
      <antipattern>
          <token regexp='yes'>\d+[\.&#57347;]?º</token>
          <token regexp='yes'>\d+(?:[\.,]\d+)?[′'']|[CFKNSEWO]</token>
      </antipattern>
      <pattern>
          <token regexp='yes'>\d+[\.&#57347;]?[oº]</token>
      </pattern>
      <disambig action="replace"><wd pos="NCMS000"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">\d+[\.&#57347;]?[oº][sˢ]</token>
      </pattern>
      <disambig action="replace"><wd pos="NCMP000"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp='yes'>\d+[\.&#57347;]?ª</token>
      </pattern>
      <disambig action="replace"><wd pos="NCFS000"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes">\d+[\.&#57347;]?[aª][sˢ]</token>
      </pattern>
      <disambig action="replace"><wd pos="NCFP000"/></disambig>
    </rule>
  </rulegroup>

  <rulegroup id="HOURS" name="Horas">
    <rule>
      <pattern>
          <token regexp='yes'>0?1h(\d{2}m)?(\d{2})?s?</token>
      </pattern>
      <disambig action="replace"><wd pos="NCFS000"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp='yes'>\d{1,2}h(\d{2}m)?(\d{2})?s?
            <exception regexp='yes'>0?1h(\d{2}m)?(\d{2})?s?</exception></token>
      </pattern>
      <disambig action="replace"><wd pos="NCFP000"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp='yes'>0?1\:(\d{2}\:)?(\d{2})?h?</token>
      </pattern>
      <disambig action="replace"><wd pos="NCFS000"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp='yes'>\d{1,2}\:(\d{2}\:)?(\d{2})?h?
            <exception regexp='yes'>0?1\:(\d{2}\:)?(\d{2})?h?</exception></token>
      </pattern>
      <disambig action="replace"><wd pos="NCFP000"/></disambig>
    </rule>
  </rulegroup>
  <rulegroup id="FILTER_PROPER_NAMES" name="Nomes próprios portugueses">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2018-11-23  	-->
    <rule>
      <pattern case_sensitive='yes'>
          <token postag='NP.+' postag_regexp='yes' regexp='yes'>\p{Lu}.+
            <exception scope='previous' postag='SENT_START' postag_regexp='yes'/></token>
      </pattern>
      <disambig action="filter" postag="N.+"/>
    <!--example inputform="Silva[Silva/NPCSG00,Silva/NPMSS00,silva/NCFS000]" outputform="Silva[Silva/NPCSG00,Silva/NPMSS00]" type="ambiguous">Isso são as ferramentas do <marker>Silva</marker>.</example XXX Works only for stricter rule (filter NP.+)-->
      <example inputform="São[São/NPMS000,ser/VMIP3P0,são/AQ0MS0,são/NCMS000]" outputform="São[São/NPMS000,são/NCMS000]" type="ambiguous">Cidade do México, <marker>São</marker> Paulo e Nova Iorque.</example>
      <example type="untouched">Costa alentejana... que saudades…</example>
    </rule>
    <rule>
      <antipattern>
        <token>Iniciativa</token>
        <token>Liberal</token>
      </antipattern>
      <pattern>
          <token regexp='yes'>Dona|Santa|Montanha|&precede_nome_proprio_F;</token>
          <token postag='NP.+' postag_regexp='yes' regexp='yes' case_sensitive='yes'>\p{Lu}.+</token>
      </pattern>
      <disambig action="replace"><wd pos="NPFS000"/><wd pos="NPFS000_"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp='yes'>Monte|&precede_nome_proprio_M;</token>
          <token postag='NP.+' postag_regexp='yes' regexp='yes' case_sensitive='yes'>\p{Lu}.+</token>
      </pattern>
      <disambig action="replace"><wd pos="NPMS000"/><wd pos="NPMS000_"/></disambig>
    </rule>
  </rulegroup>
  <rulegroup id="FOREIGN_PROPER_NAMES" name="Nomes estrangeiros">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-09-18  	-->
    <rule>
      <pattern case_sensitive='yes'>
          <token>La</token>
          <token postag='UNKNOWN' regexp='yes'>\p{Lu}.+</token>
      </pattern>
      <disambig action="replace"><wd pos="NPFS000"/><wd pos="NPFS000"/></disambig>
    </rule>
    <rule>
      <pattern case_sensitive='yes'>
          <token>Las</token>
          <token postag='UNKNOWN' regexp='yes'>\p{Lu}.+</token>
      </pattern>
      <disambig action="replace"><wd pos="NPFP000"/><wd pos="NPFP000"/></disambig>
    </rule>
    <rule>
      <pattern case_sensitive='yes'>
          <token>L</token><!-- XXX Le is also FP in Italian, but it is less common in Portuguese texts -->
          <token regexp='yes'>['’]</token>
          <token postag='UNKNOWN' regexp='yes'>\p{Lu}.+</token>
      </pattern>
      <disambig action="replace"><wd pos="NPMS000"/><wd pos="NPMS000"/><wd pos="NPMS000"/></disambig>
    </rule>
    <rule>
      <pattern case_sensitive='yes'>
          <token regexp='yes'>[AEI]l|Le</token><!-- XXX Le is also FP in Italian, but it is less common in Portuguese texts -->
          <token postag='UNKNOWN' regexp='yes'>\p{Lu}.+</token>
      </pattern>
      <disambig action="replace"><wd pos="NPMS000"/><wd pos="NPMS000"/></disambig>
    </rule>
    <rule>
      <pattern case_sensitive='yes'>
          <token regexp='yes'>Els|Los|Gli</token>
          <token postag='UNKNOWN' regexp='yes'>\p{Lu}.+</token>
      </pattern>
      <disambig action="replace"><wd pos="NPMP000"/><wd pos="NPMP000"/></disambig>
    </rule>
    <rule>
      <pattern case_sensitive='yes'>
          <token>Les</token>
          <token postag='UNKNOWN' regexp='yes'>\p{Lu}.+</token>
      </pattern>
      <disambig action="replace"><wd pos="NPCP000"/><wd pos="NPCP000"/></disambig>
    </rule>
  </rulegroup>

    <rule id="PRO_NAME" name="Pro como nome">
      <pattern case_sensitive='yes'>
          <token regexp='yes'>\p{Lu}.+</token>
        <marker>
          <token>Pro</token>
        </marker>
      </pattern>
      <disambig action="replace"><wd pos="NPCS000"/></disambig>
    </rule>

    <rule id="N_APOSTROPHE" name="N' + Artigo ">
      <pattern>
        <marker>
          <token regexp='yes'>[nd]</token>
          <token regexp='yes'>['’]</token>
        </marker>
          <token postag_regexp='yes' postag='D.+'/>
      </pattern>
      <disambig action="replace"><wd pos="SPS00"/><wd pos="SPS00"/></disambig>
    </rule>

  <rulegroup id="CHINESE_NAMES" name="Chinese names">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2019-03-16  	-->
    <!-- https://en.wikipedia.org/wiki/Pinyin_table -->
    <rule>
      <pattern>
          <token regexp="yes" case_sensitive='yes'>&ditongos_chineses;</token>
          <token regexp="yes" case_sensitive='yes'>(?-i)(&ditongos_chineses;)(?:(?i)(&ditongos_chineses;))?
            <exception>Time</exception></token>
      </pattern>
      <disambig action="replace"><wd pos="NPCS000_"/><wd pos="NPCS000_"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes" case_sensitive='yes'>(?-i)(&ditongos_chineses;)(?i)(&ditongos_chineses;)</token>
          <token regexp="yes" case_sensitive='yes'>&ditongos_chineses;</token>
      </pattern>
      <disambig action="replace"><wd pos="NPCS000_"/><wd pos="NPCS000_"/></disambig>
    </rule>
    <rule>
      <pattern>
          <token regexp="yes" postag='UNKNOWN' case_sensitive='yes'>(?-i)(&ditongos_chineses;)(?i)(&ditongos_chineses;)
            <exception>Time</exception></token>
      </pattern>
      <disambig action="replace"><wd pos="NPCS000_"/></disambig>
    </rule>
  </rulegroup>

    <!-- XXX Ignore Spelling Rules XXX -->
    <!--rule id='CONTRATED_INFINITIVE' name='Formas verbais oxítonas'>
      <pattern>
          <token postag='VMX0000' postag_regexp='yes'/>
          <token regexp='yes' spacebefore='no'>&hifen;</token>
          <token regexp='yes' spacebefore='no'>l[ao]s?</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule-->
    <rule name="Ignore spelling of url protocols" id="URI_PROTOCOL">
        <pattern><!-- chrome://, ftp://, file:// -->
            <token regexp="yes">[a-z\-]+</token>
            <token spacebefore="no">:</token>
            <token spacebefore="no">/</token>
            <token spacebefore="no">/</token>
            <token spacebefore="no" min="0">/</token>
            <token spacebefore="no" regexp="yes">[a-z0-9\-]+</token>
        </pattern>
        <disambig action="ignore_spelling"/>
    </rule>
    <rule id="EN_VOGUE" name="En vogue">
      <pattern>
          <token>en</token>
          <token regexp="yes">vogue|gros|masse|passant|détail</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="COTE_DAZUR" name="Côte d'Azur">
      <pattern>
          <token>Côte</token>
          <token>d</token>
          <token regexp="yes">['’]</token>
          <token>Azur</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="LOS_ANGELES" name="Los Angeles">
      <pattern>
          <token>Los</token>
          <token regexp="yes">A(?:lamos|ngeles)</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="LAS_VEGAS" name="Las Vegas">
      <pattern case_sensitive="yes">
          <token>Las</token>
          <token>Vegas</token>
      </pattern>
      <disambig action="immunize"/>
    </rule>
    <rule id="VALLEYS" name="Valleys">
      <pattern case_sensitive="yes">
          <token regexp="yes">Death|Silicon</token>
          <token>Valley</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="OAK_RIDGE" name="Oak Ridge">
      <pattern case_sensitive="yes">
          <token>Oak</token>
          <token>Ridge</token>
      </pattern>
      <disambig action="immunize"/>
    </rule>
    <rule id="MISE_EN_SCENE" name="Mise en scène">
      <pattern>
          <token>Mise</token>
          <token>en</token>
          <token>scène</token>
      </pattern>
      <disambig action="immunize"/>
    </rule>
    <rule id="RHYTHM_AND_BLUES" name="Rhythm and Blues">
      <pattern>
          <token>Rhythm</token>
          <token>and</token>
          <token>Blues</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="ROCK_AND_ROLL" name="Rock and Roll">
      <pattern>
          <token>Rock</token>
          <token>and</token>
          <token>Roll</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="ALEXIUS_MEINONG" name="Alexius Meinong">
      <pattern>
          <token>Alexius</token>
          <token regexp="yes">Meinongs?</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="ALFRED_NOBEL" name="Alfred Nobel">
      <pattern>
          <token>Alfred</token>
          <token>Nobel</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="ADDIS_ABEBA" name="Addis Abeba">
      <pattern>
          <token>Addis</token>
          <token>Abeba</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="LA_PAZ" name="La Paz">
      <pattern>
          <token>La</token>
          <token>Paz</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="SANTO_DOMINGO" name="Santo Domingo">
      <pattern>
          <token>Santo</token>
          <token>Domingo</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="LE_HAVRE" name="Le Havre/Le Mans">
      <pattern>
          <token>Le</token>
          <token regexp='yes'>Havre|Mans</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="PHNOM_PENH" name="Phnom Penh">
      <pattern>
          <token>Phnom</token>
          <token>Penh</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="OPEN_SOURCE" name="Open Source">
      <pattern>
          <token>Open</token>
          <token>Source</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="OPEN_SOURCE_SOFTWARE" name="Open-Source-Software">
      <pattern>
          <token>Open-Source-Software</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="JUNGLE_WORLD" name="Jungle World">
      <pattern>
          <token>Jungle</token>
          <token>World</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="STONES" name="Rolling Stones">
      <pattern>
          <token>Rolling</token>
          <token regexp='yes'>Stones?</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="A_LA_CARTE" name="À la carte">
      <pattern>
          <token>à</token>
          <token>la</token>
          <token>carte</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="BIG_BEN" name="Big Ben">
      <pattern>
          <token>Big</token>
          <token regexp="yes">Ben|Data|Bang</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="PEU_A_PEU" name="Peu à peu">
      <pattern>
          <token>peu</token>
          <token>à</token>
          <token>peu</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="AVANT_LA_LETTRE" name="Avant la lettre">
      <pattern>
          <token>avant</token>
          <token>la</token>
          <token>lettre</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="COQ_AU_VIN" name="Coq au Vin">
      <pattern>
          <token>Coq</token>
          <token>au</token>
          <token>Vin</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="AIR_FORCE" name="Air Force">
      <pattern>
          <token>Air</token>
          <token>Force</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="CUI_BONO" name="Cui bono">
      <pattern>
          <token>Cui</token>
          <token>Bono</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="MEMENTO_MORI" name="Memento mori">
      <pattern>
          <token>Memento</token>
          <token>mori</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="SALVA_VERITATE" name="Salva veritate">
      <pattern>
          <token>salva</token>
          <token>veritate</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="PERSONA_NON_GRATA" name="Persona non grata">
      <pattern>
          <token>Persona</token>
          <token min="0">non</token>
          <token regexp="yes">(in)?grata</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="ENFANT_TERRIBLE" name="Enfant terrible">
      <pattern>
          <token>Enfant</token>
          <token>terrible</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="FAIR_PLAY" name="Fair Play">
      <pattern case_sensitive="yes">
          <token>Fair</token>
          <token>Play</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="UNIVERSITY_OF" name="University of">
      <pattern case_sensitive="yes">
          <token>University</token>
          <token>of</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="YAD_VASHEM" name="Yad Vashem">
      <pattern>
          <token>Yad</token>
          <token>Vashem</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="EL_NINO" name="El Niño">
      <pattern>
          <token>El</token>
          <token>Niño</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="IN_MEDIAS_RES" name="In medias res">
      <pattern>
          <token>in</token>
          <token>medias</token>
          <token>res</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="FACULTAS_DOCENDI" name="Facultas Docendi">
      <pattern>
          <token>Facultas</token>
          <token>Docendi</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="VENIA_LEGENDI" name="Venia Legendi">
      <pattern>
          <token>Venia</token>
          <token>Legendi</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="GRAND_CANYON" name="Grand Canyon">
      <pattern>
          <token>Grand</token>
          <token regexp='yes'>Canyon|Prix|Slam</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="HORRIBILE_DICTU" name="Horribile dictu">
      <pattern>
          <token>horribile</token>
          <token>dictu</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="DIABETES_MELLITUS" name="Diabetes mellitus">
      <pattern>
          <token>Diabetes</token>
          <token regexp="yes">mellitus|renalis|insipidus</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="O_BLITZ" name="O Blitz">
      <pattern>
          <token regexp="yes">[dn]?o</token>
          <token regexp="yes">Blitz|Donner</token>
          <token min='0'>Kebab</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="WALL_STREET" name="Wall Street">
      <pattern>
          <token regexp="yes">Wall|Downing|Baker</token>
          <token>Street</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="FIFTH_AVENUE" name="Fifth Avenue">
      <pattern>
          <token>Fifth</token>
          <token>Avenue</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="PER_SE" name="Per se">
      <pattern>
          <token>per</token>
          <token regexp="yes">capita|procura|rectum|saldo|se</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="POUR_LE_MERITE" name="Pour le Mérite">
      <pattern>
          <token>Pour</token>
          <token>le</token>
          <token>Mérite</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="SUI_GENERIS" name="Sui">
      <pattern>
          <token>sui</token>
          <token>generis</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="PACTA_SUNT_SERVANDA" name="Pacta">
      <pattern>
          <token>pacta</token>
          <token>sunt</token>
          <token>servanda</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="VIRTUAL_REALITY" name="Virtual">
      <pattern>
          <token>Virtual</token>
          <token regexp="yes">Reality|Environments?</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="GUELEN" name="Fethullah Gülen">
      <pattern>
          <token>Fethullah</token>
          <token regexp='yes'>Gülens?</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="ERDOGAN" name="Recep Tayyip Erdoğan">
      <pattern>
          <token>Recep</token>
          <token>Tayyip</token>
          <token regexp='yes'>Erdoğans?</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="HILLARY_CLINTON" name="Hillary Clinton">
      <pattern>
          <token regexp='yes'>Hillary|Bill</token>
          <token regexp='yes'>Clintons?</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="ABU_DHABI" name="Abu">
      <pattern>
          <token>Abu</token>
          <token>Dhabi</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="ROCKY_MOUNTAINS" name="Rocky Mountains">
      <pattern>
          <token>Rocky</token>
          <token>Mountains</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="CORDON_BLEU" name="Cordon bleu">
      <pattern>
          <token>Cordon</token>
          <token>bleu</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="JOUR_FIXE" name="Jour fixe">
      <pattern>
          <token regexp="yes">Blanc|Jour|Idée</token>
          <token>fixe</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="PEARL_HARBOR" name="Pearl Harbor">
      <pattern>
          <token>Pearl</token>
          <token>Harbor</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="ISLE_OF_MAN" name="Isle of Man">
      <pattern>
          <token>Isle</token>
          <token>of</token>
          <token regexp="yes">Man|Wight|Arran|Mull</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="HUMAN_RIGHTS_WATCH" name="Human Rights Watch">
      <pattern>
          <token>Human</token>
          <token>Rights</token>
          <token>Watch</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="PATER_FAMILIAS" name="Pater familias">
      <pattern>
          <token>pater</token>
          <token>familias</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="CON_CARNE" name="Con Carne">
      <pattern case_sensitive="yes">
          <token>con</token>
          <token>Carne</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="SCOTLAND_YARD" name="Scotland Yard">
      <pattern case_sensitive="yes">
          <token>Scotland</token>
          <token>Yard</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="BUCKINGHAM_PALACE" name="Buckingham Palace">
      <pattern>
          <token>Palácio</token>
          <token>de</token>
          <token>Buckingham</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="PARKS" name="Parks">
      <pattern case_sensitive="yes">
          <token regexp="yes">Central|Hyde</token>
          <token>Park</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="TERRA_INCOGNITA" name="Terra incognita">
      <pattern>
          <token>Terra</token>
          <token>incognita</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="NON_SEQUITUR" name="Non sequitur">
      <pattern>
          <token>non</token>
          <token>sequitur</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="REDUCTIO_AD_ABSURDUM" name="Reductio ad absurdum">
      <pattern>
          <token>reductio</token>
          <token>ad</token>
          <token>absurdum</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="TERTIUM_NON_DATUR" name="Tertium non datur">
      <pattern>
          <token>Tertium</token>
          <token>non</token>
          <token>datur</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="EX_NIHILO" name="Ex nihilo">
      <pattern>
          <token>ex</token>
          <token>nihilo</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="SUUM_CUIQUE" name="Suum cuique">
      <pattern>
          <token>suum</token>
          <token>cuique</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="URBI_ORBI" name="Urbi et orbi">
      <pattern>
          <token>Urbi</token>
          <token>et</token>
          <token>orbi</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="SPIRITUS_RECTOR" name="Spiritus Rector">
      <pattern>
          <token>Spiritus</token>
          <token>Rector</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="VINO_VERITAS" name="In vino veritas">
      <pattern>
          <token>in</token>
          <token>vino</token>
          <token>veritas</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="VENIA_VERBO" name="Sit venia verbo">
      <pattern>
          <token>sit</token>
          <token>venia</token>
          <token>verbo</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="SEX_CITY" name="Sex and the City">
      <pattern>
          <token>Sex</token>
          <token>and</token>
          <token>the</token>
          <token>City</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="BREAKING_BAD" name="Breaking Bad">
      <pattern>
          <token>Breaking</token>
          <token>Bad</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="VISUAL_STUDIO" name="Visual Studio/Basic">
      <pattern case_sensitive="yes">
          <token>Visual</token>
          <token regexp="yes">Studio|Basic|[CJ](?:#|\+\+)</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="GOOGLE_MAPS" name="Google Maps">
      <pattern case_sensitive="yes">
          <token>Google</token>
          <token regexp="yes">Ad|Alerts|Analytics|APIs|App|Apps|Art|Attribution|Authenticator|Bookmarks|Business|Calendar|Charts|Checkout|Classroom|Cloud|Compute|Contacts|Cultural|Current|Data|Developers|Docs|Drive|Fit|Flights|Fonts|for|Fusion|Get|Groups|Home|Maps|Mobile|Moderator|My|Ngram|One|Opinion|Photos|Play|Plugin|Primer|Public|Questions|Schemer|Scholar|Search|Search‎|Shopping|Sites|Spaces|Store|Street|Surveys|Sync|Tez|Translate|Translator|URL|Videos|Wallet|Website|WiFi</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="Ampersands" name="AMPERSANDS">
      <pattern>
          <token regexp='yes'>C&amp;A|I&amp;D|S&amp;P</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="LOW_COST" name="Low cost">
      <pattern>
          <token>low</token>
          <token regexp="yes" spacebefore='no' min='0'>&hifen;</token>
          <token regexp="yes">costs?</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id="T-SHIRT" name="T-shirt">
      <pattern>
          <token>t</token>
          <token regexp="yes" spacebefore='no'>&hifen;</token>
          <token spacebefore='no'>shirt</token>
      </pattern>
      <disambig action="replace"><wd pos="NCFS000_"/><wd pos="_PUNCT"/><wd pos="NCFS000_"/></disambig>
    </rule>
    <rule id="T-SHIRTS" name="T-shirts">
      <pattern>
          <token>t</token>
          <token regexp="yes" spacebefore='no'>&hifen;</token>
          <token spacebefore='no'>shirts</token>
      </pattern>
      <disambig action="replace"><wd pos="NCFP000_"/><wd pos="_PUNCT"/><wd pos="NCFP000_"/></disambig>
    </rule>
    <rule id="STAND-UP_COMEDY" name="Stand-up comedy">
      <pattern>
          <token>stand</token>
          <token regexp="yes" spacebefore='no'>&hifen;</token>
          <token spacebefore='no'>up</token>
          <token regexp="yes">comed(y|ies)</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>

  <rulegroup id='LOOSE_UPPERCASES' name='Maiúsculas soltas'>
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-10-10  	-->
    <rule>
      <pattern>
          <token regexp='yes'>(categoria|escalão|grupo|turma|vitamina)s?</token>
          <token case_sensitive='yes' regexp='yes'>\p{Lu}</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule id='SIZES' name='Tamanhos de roupa'>
      <pattern>
          <token regexp='yes'>tamanhos?</token>
          <token case_sensitive='yes' regexp='yes'>X{0,2}[SLM]|GG?|PP?</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
  </rulegroup>

  <rulegroup id='WORDS_WITH_NUMBERS' name='Palavras com números ou símbolos'>
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-10-10  	-->
    <rule>
    <!-- XXX TV dimensions|3D|networks|4Chan|G20|G7|hypothesis|intel CPUs|P2P|number of rooms|highways|programming languages -->
      <pattern>
          <token case_sensitive='yes' regexp='yes'>[248]K|[2345][DG]|[48]Chan|G(1|7|20)|H[₁₂₃₄₅₆₇₈₉₀]|i[3579]|P2P|T[1234560]|(?:A|E?N|IC)\d{1,3}|[CJ](?:#|\+\+)</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule>
      <pattern>
          <token regexp='yes'>vitaminas?</token>
        <marker>
          <token case_sensitive='yes' regexp='yes'>B(?:[1235679]|12)|D3</token>
        </marker>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
  </rulegroup>

    <rule id='TAUTONYMS' name='Toutónimos'>
    <!-- Created by Tiago F. Santos, Portuguese rule, 2019-08-19  	-->
      <pattern>
          <token case_sensitive='yes' regexp='yes'>&tautonimos;</token>
          <token><match no='0'/>
            <exception case_sensitive='yes' regexp='yes'>\p{Lu}\p{Ll}+</exception></token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>

  <rulegroup id="SPELLING_IGNORE_RULE" name="Ignore spellings rule">
    <!-- Created by Tiago F. Santos, Portuguese rule, 2017-06-XX  	-->
    <rule>
      <pattern>
        <marker>
          <token postag_regexp="yes" postag=".+_"/>
        </marker>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule>
      <pattern>
        <marker>
          <token postag_regexp="yes" postag="I"/>
        </marker>
          <token regexp='yes'>[\!\?]</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule>
      <pattern>
        <marker>
          <token postag_regexp="yes" postag="I"/>
        </marker>
          <token postag_regexp="yes" postag="I"/>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule>
      <pattern>
        <marker>
          <token case_sensitive="yes" regexp="yes">\p{Lu}</token>
        </marker>
          <token spacebefore='no'>.</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule><!-- apostrophes -->
      <pattern>
        <marker>
          <token regexp="yes">[dn]</token>
          <token spacebefore='no' regexp="yes">['’‘]</token>
        </marker>
          <token spacebefore='no' regexp="yes">[^bcdfghjklmnpqrstvwxyz]\w+</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule><!-- separators -->
      <pattern>
          <token>-</token>
          <token>-</token>
          <token>-</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule>
      <pattern>
          <token regexp='yes'>\d+.[ºª][sˢ]?</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule><!-- loose letters used in some time formats -->
      <pattern>
          <token regexp='yes'>\d{1,2}h(\d{2}m)?(\d{2})?s?</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule> <!-- variable in formulas -->
      <pattern>
          <token regexp='yes'>\w|&alfabeto_grego;</token><!-- XXX here μ is ok. it can't be micro -->
          <token regexp='yes'>&operadores_matematicos;</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule><!-- variable in formulas -->
      <pattern>
          <token regexp='yes'>&operadores_matematicos;</token>
          <token regexp='yes'>\w|&alfabeto_grego;
            <exception>μ</exception></token><!-- XXX don't add μ - possible confusion with loose micro -->
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule><!-- variable in formulas -->
      <pattern>
          <token postag_regexp='yes' postag='Z.+'/>
        <marker>
          <token regexp='yes'>\w|&alfabeto_grego;
            <exception>μ</exception></token><!-- XXX don't add μ - possible confusion with loose micro -->
        </marker>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule><!-- radio stations -->
      <pattern>
          <token regexp='yes'>\d{2,3}\.\d</token>
          <token regexp='yes' spacebefore='yes'>AM|FM</token>
      </pattern>
      <disambig action="immunize"/>
    </rule>
    <rule><!-- ignore abbreviations -->
      <pattern>
        <marker>
          <token regexp='yes'>&abreviaturas;</token>
        </marker>
          <token spacebefore='no'>.</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule><!-- ignore abbreviations (masculine º)-->
      <pattern>
          <token regexp='yes'>a(?:pt|rt)|n</token>
          <token spacebefore='no'>.</token>
          <token spacebefore='no' regexp='yes'>ºˢ?</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule><!-- ignore abbreviations (feminine ª)-->
      <pattern>
          <token regexp='yes' case_sensitive='yes'>Dr|Ex|[Pp]rof|Sr</token>
          <token spacebefore='no'>.</token>
          <token spacebefore='no' regexp='yes'>ªˢ?</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule><!-- ignore smileys -->
      <pattern>
          <token spacebefore='yes' regexp='yes'>[:;8]</token>
          <token spacebefore='no' case_sensitive='yes' min='0'>-</token>
          <token spacebefore='no' regexp='yes' case_sensitive='yes'>[bDoOpPsSxX]</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule><!-- ignore smileys type: X-O-->
      <pattern>
          <token spacebefore='yes'>X</token>
          <token spacebefore='no' case_sensitive='yes'>-</token>
          <token spacebefore='no' regexp='yes' case_sensitive='yes'>[()/\[bDoOpPsSxX]</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule>
    <!-- Based on English disambiguation.xml -->
      <pattern case_sensitive="yes">
          <token regexp="yes">\/|[\.·\/]|[\d\., ]*\d+</token>
          <token regexp="yes">&unidades_de_medida;</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
    <rule>
      <pattern case_sensitive="yes">
          <token regexp="yes">\d[\d ]*[\.,]?\d*(&unidades_de_medida;)</token>
      </pattern>
      <disambig action="ignore_spelling"/>
    </rule>
  </rulegroup>
  
<!--  <rulegroup name="Ignore spelling of domain names" id="IMMUNIZE_DOMAIN_NAMES">
    <rule>
      <pattern case_sensitive="yes">
        <token regexp="yes">[A-Za-z0-9\-]+</token>
        <token spacebefore="no">.</token>
        <token regexp="yes" spacebefore="no">[A-Za-z0-9\-]+</token>
        <token spacebefore="no">.</token>
        <token spacebefore="no" regexp="yes">&dominios_internet;</token>
      </pattern>
      <disambig action="immunize"/>  
    </rule>
    <rule>
      <pattern case_sensitive="yes">
        <token regexp="yes">[A-Za-z0-9\-]+</token>
        <token spacebefore="no">.</token>
        <token spacebefore="no" regexp="yes">&dominios_internet;</token>
      </pattern>
      <disambig action="immunize"/>  
    </rule>
  </rulegroup>-->
</rules>
