Skip to content

Commit

Permalink
[pt] Adjust rule priorities
Browse files Browse the repository at this point in the history
  • Loading branch information
p-goulart committed Nov 16, 2023
1 parent d3c8165 commit 0237e3d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ public boolean isAdvancedTypographyEnabled() {

@Override
protected int getPriorityForId(String id) {
if (id.startsWith("MORFOLOGIK_SPELLER")) {
return -50;
}

switch (id) {
case "FRAGMENT_TWO_ARTICLES": return 50;
case "DEGREE_MINUTES_SECONDS": return 30;
Expand Down Expand Up @@ -250,10 +254,11 @@ protected int getPriorityForId(String id) {
case "WEAK_WORDS": return -32;
case "PT_AGREEMENT_REPLACE": return -35;
case "CONTA_TO": return -44;
case "PT_DIACRITICS_REPLACE": return -45; // prefer over spell checker
case "PT_DIACRITICS_REPLACE": return -45; // prefer over spell checker
case "DIACRITICS": return -45;
case "PT_COMPOUNDS_POST_REFORM": return -45;
case "AUX_VERBO": return -45;
case "PRETERITO_PERFEITO": return -51; // lower than speller
case "CRASE_CONFUSION": return -54;
case "NAO_MILITARES": return -54;
case "NA_QUELE": return -54;
Expand All @@ -279,6 +284,7 @@ protected int getPriorityForId(String id) {
case "UNKNOWN_WORD": return -2000;
case "NO_VERB": return -2100;
}

if (id.startsWith("AI_PT_HYDRA_LEO")) { // prefer more specific rules (also speller)
if (id.startsWith("AI_PT_HYDRA_LEO_MISSING_COMMA")) {
return -51; // prefer comma style rules.
Expand Down

0 comments on commit 0237e3d

Please sign in to comment.