Class PortugueseAccentuationCheckRule

java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.pt.PortugueseAccentuationCheckRule

public class PortugueseAccentuationCheckRule extends Rule
This rule checks if a word without graphical accent and with a verb POS tag should be a noun or an adjective with graphical accent. It uses two lists of word pairs: verb-noun and verb-adjective.
  • Field Details

    • PREPOSICAO_DE

      private static final Pattern PREPOSICAO_DE
      Patterns
    • ARTIGO_O_MS

      private static final Pattern ARTIGO_O_MS
    • ARTIGO_O_FS

      private static final Pattern ARTIGO_O_FS
    • ARTIGO_O_MP

      private static final Pattern ARTIGO_O_MP
    • ARTIGO_O_FP

      private static final Pattern ARTIGO_O_FP
    • DETERMINANTE

      private static final Pattern DETERMINANTE
    • DETERMINANTE_MS

      private static final Pattern DETERMINANTE_MS
    • DETERMINANTE_FS

      private static final Pattern DETERMINANTE_FS
    • DETERMINANTE_MP

      private static final Pattern DETERMINANTE_MP
    • DETERMINANTE_FP

      private static final Pattern DETERMINANTE_FP
    • NOME_MS

      private static final Pattern NOME_MS
    • NOME_FS

      private static final Pattern NOME_FS
    • NOME_MP

      private static final Pattern NOME_MP
    • NOME_FP

      private static final Pattern NOME_FP
    • ADJETIVO_MS

      private static final Pattern ADJETIVO_MS
    • ADJETIVO_FS

      private static final Pattern ADJETIVO_FS
    • ADJETIVO_MP

      private static final Pattern ADJETIVO_MP
    • ADJETIVO_FP

      private static final Pattern ADJETIVO_FP
    • INFINITIVO

      private static final Pattern INFINITIVO
    • VERBO_CONJUGADO

      private static final Pattern VERBO_CONJUGADO
    • PARTICIPIO_MS

      private static final Pattern PARTICIPIO_MS
    • GRUPO_VERBAL

      private static final Pattern GRUPO_VERBAL
    • VERBO_3S

      private static final Pattern VERBO_3S
    • NOT_IN_PREV_TOKEN

      private static final Pattern NOT_IN_PREV_TOKEN
    • BEFORE_ADJECTIVE_MS

      private static final Pattern BEFORE_ADJECTIVE_MS
    • BEFORE_ADJECTIVE_FS

      private static final Pattern BEFORE_ADJECTIVE_FS
    • BEFORE_ADJECTIVE_MP

      private static final Pattern BEFORE_ADJECTIVE_MP
    • BEFORE_ADJECTIVE_FP

      private static final Pattern BEFORE_ADJECTIVE_FP
    • GN

      private static final Pattern GN
    • EXCEPCOES_ANTES_DE

      private static final Pattern EXCEPCOES_ANTES_DE
    • PRONOME_PESSOAL

      private static final Pattern PRONOME_PESSOAL
    • relevantWords

      private static final Map<String,AnalyzedTokenReadings> relevantWords
    • relevantWords2

      private static final Map<String,AnalyzedTokenReadings> relevantWords2
  • Constructor Details

  • Method Details

    • getId

      public String getId()
      Description copied from class: Rule
      A string used to identify the rule in e.g. configuration files. This string is supposed to be unique and to stay the same in all upcoming versions of LanguageTool. It's supposed to contain only the characters A-Z and the underscore.
      Specified by:
      getId in class Rule
    • getDescription

      public String getDescription()
      Description copied from class: Rule
      A short description of the error this rule can detect, usually in the language of the text that is checked.
      Specified by:
      getDescription in class Rule
    • match

      public RuleMatch[] match(AnalyzedSentence sentence)
      Description copied from class: Rule
      Check whether the given sentence matches this error rule, i.e. whether it contains the error detected by this rule. Note that the order in which this method is called is not always guaranteed, i.e. the sentence order in the text may be different from the order in which you get the sentences (this may be the case when LanguageTool is used as a LibreOffice/OpenOffice add-on, for example). In other words, implementations must be stateless, so that a previous call to this method has no influence on later calls.
      Specified by:
      match in class Rule
      Parameters:
      sentence - a pre-analyzed sentence
      Returns:
      an array of RuleMatch objects
    • matchPostagRegexp

      private boolean matchPostagRegexp(AnalyzedTokenReadings aToken, Pattern pattern)
      Match POS tag with regular expression