Class PostponedAdjectiveConcordanceFilter

java.lang.Object
org.languagetool.rules.patterns.RuleFilter
org.languagetool.rules.es.PostponedAdjectiveConcordanceFilter

public class PostponedAdjectiveConcordanceFilter extends RuleFilter
This rule checks if an adjective doesn't agree with the previous noun and at the same time it doesn't agree with any of the previous words. Takes care of some exceptions.
  • Field Details

    • maxLevels

      private final int maxLevels
      Patterns
      See Also:
    • NOM

      private static final Pattern NOM
    • NOM_MS

      private static final Pattern NOM_MS
    • NOM_FS

      private static final Pattern NOM_FS
    • NOM_MP

      private static final Pattern NOM_MP
    • NOM_MN

      private static final Pattern NOM_MN
    • NOM_FP

      private static final Pattern NOM_FP
    • NOM_CS

      private static final Pattern NOM_CS
    • NOM_CP

      private static final Pattern NOM_CP
    • NOM_DET

      private static final Pattern NOM_DET
    • _GN_

      private static final Pattern _GN_
    • _GN_MS

      private static final Pattern _GN_MS
    • _GN_FS

      private static final Pattern _GN_FS
    • _GN_MP

      private static final Pattern _GN_MP
    • _GN_FP

      private static final Pattern _GN_FP
    • _GN_CS

      private static final Pattern _GN_CS
    • _GN_CP

      private static final Pattern _GN_CP
    • DET

      private static final Pattern DET
    • DET_CS

      private static final Pattern DET_CS
    • DET_MS

      private static final Pattern DET_MS
    • DET_FS

      private static final Pattern DET_FS
    • DET_MP

      private static final Pattern DET_MP
    • DET_FP

      private static final Pattern DET_FP
    • GN_MS

      private static final Pattern GN_MS
    • GN_FS

      private static final Pattern GN_FS
    • GN_MP

      private static final Pattern GN_MP
    • GN_FP

      private static final Pattern GN_FP
    • GN_CP

      private static final Pattern GN_CP
    • GN_CS

      private static final Pattern GN_CS
    • ADJECTIU

      private static final Pattern ADJECTIU
    • ADJECTIU_MS

      private static final Pattern ADJECTIU_MS
    • ADJECTIU_FS

      private static final Pattern ADJECTIU_FS
    • ADJECTIU_MP

      private static final Pattern ADJECTIU_MP
    • ADJECTIU_FP

      private static final Pattern ADJECTIU_FP
    • ADJECTIU_CP

      private static final Pattern ADJECTIU_CP
    • ADJECTIU_CS

      private static final Pattern ADJECTIU_CS
    • ADJECTIU_S

      private static final Pattern ADJECTIU_S
    • ADJECTIU_P

      private static final Pattern ADJECTIU_P
    • ADVERBI

      private static final Pattern ADVERBI
    • CONJUNCIO

      private static final Pattern CONJUNCIO
    • PUNTUACIO

      private static final Pattern PUNTUACIO
    • LOC_ADV

      private static final Pattern LOC_ADV
    • ADVERBIS_ACCEPTATS

      private static final Pattern ADVERBIS_ACCEPTATS
    • COORDINACIO_IONI

      private static final Pattern COORDINACIO_IONI
    • KEEP_COUNT

      private static final Pattern KEEP_COUNT
    • KEEP_COUNT2

      private static final Pattern KEEP_COUNT2
    • STOP_COUNT

      private static final Pattern STOP_COUNT
    • PREPOSICIONS

      private static final Pattern PREPOSICIONS
    • PREPOSICIO_CANVI_NIVELL

      private static final Pattern PREPOSICIO_CANVI_NIVELL
    • VERB

      private static final Pattern VERB
    • GV

      private static final Pattern GV
    • adverbAppeared

      boolean adverbAppeared
    • conjunctionAppeared

      boolean conjunctionAppeared
    • punctuationAppeared

      boolean punctuationAppeared
  • Constructor Details

    • PostponedAdjectiveConcordanceFilter

      public PostponedAdjectiveConcordanceFilter()
  • Method Details

    • acceptRuleMatch

      public RuleMatch acceptRuleMatch(RuleMatch match, Map<String,String> arguments, int patternTokenPos, AnalyzedTokenReadings[] patternTokens, List<Integer> tokenPositions) throws IOException
      Description copied from class: RuleFilter
      Returns the original rule match or a modified one, or null if the rule match is filtered out.
      Specified by:
      acceptRuleMatch in class RuleFilter
      Parameters:
      arguments - the resolved argument from the args attribute in the XML. Resolved means that e.g. \1 has been resolved to the actual string at that match position.
      patternTokens - those tokens of the text that correspond the matched pattern
      Returns:
      null if this rule match should be removed, or any other RuleMatch (e.g. the one from the arguments) that properly describes the detected error
      Throws:
      IOException
    • keepCounting

      private boolean keepCounting(AnalyzedTokenReadings aTr)
    • initializeApparitions

      private void initializeApparitions()
    • updateApparitions

      private void updateApparitions(AnalyzedTokenReadings aTr)
    • matchPostagRegexp

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

      private boolean matchRegexp(String s, Pattern pattern)
      Match String with regular expression
    • getAnalyzedToken

      private AnalyzedToken getAnalyzedToken(AnalyzedTokenReadings aToken, Pattern pattern)