Class AbstractFutureDateFilter


  • public abstract class AbstractFutureDateFilter
    extends RuleFilter
    Checks if a given date is in the future Used for mismatch detection between verb tense and a given date
    Since:
    4.3
    • Constructor Detail

      • AbstractFutureDateFilter

        public AbstractFutureDateFilter()
    • Method Detail

      • getDayOfMonth

        protected int getDayOfMonth​(String localizedDayOfMonth)
        Implement so that "first" returns 1, second returns 2 etc.
        Parameters:
        localizedDayOfMonth - name of day of the month or abbreviation thereof
      • getMonth

        protected abstract int getMonth​(String localizedMonth)
        Implement so that January returns 1, February 2 etc.
        Parameters:
        localizedMonth - name of a month or abbreviation thereof
      • getCalendar

        protected abstract Calendar getCalendar()
      • acceptRuleMatch

        public RuleMatch acceptRuleMatch​(RuleMatch match,
                                         Map<String,​String> args,
                                         int patternTokenPos,
                                         AnalyzedTokenReadings[] patternTokens)
        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:
        args - a map with values for year, month, day (day of month), weekDay
        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