def __init__(self): super().__init__() self._single_time_extractor = BaseTimeExtractor( SpanishTimeExtractorConfiguration()) self._integer_extractor = SpanishIntegerExtractor() self.utility_configuration = SpanishDateTimeUtilityConfiguration() self._simple_cases_regex: List[Pattern] = [ RegExpUtility.get_safe_reg_exp(SpanishDateTime.PureNumFromTo), RegExpUtility.get_safe_reg_exp(SpanishDateTime.PureNumBetweenAnd), RegExpUtility.get_safe_reg_exp(SpanishDateTime.SpecificTimeFromTo), RegExpUtility.get_safe_reg_exp( SpanishDateTime.SpecificTimeBetweenAnd) ] self._till_regex: Pattern = RegExpUtility.get_safe_reg_exp( SpanishDateTime.TillRegex) self._time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp( SpanishDateTime.TimeOfDayRegex) self._general_ending_regex: Pattern = RegExpUtility.get_safe_reg_exp( SpanishDateTime.GeneralEndingRegex) self.from_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.FromRegex) self.range_connector_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.RangeConnectorRegex) self.between_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.BetweenRegex) self._token_before_date = SpanishDateTime.TokenBeforeDate self._pure_number_regex = [ SpanishDateTime.PureNumFromTo, SpanishDateTime.PureNumFromTo ] self._options = DateTimeOptions.NONE self._check_both_before_after = SpanishDateTime.CheckBothBeforeAfter
def __init__(self): BaseDateParserConfiguration.__init__(self) self._utility_configuration = SpanishDateTimeUtilityConfiguration() self._unit_map = SpanishDateTime.UnitMap self._unit_value_map = SpanishDateTime.UnitValueMap self._season_map = SpanishDateTime.SeasonMap self._cardinal_map = SpanishDateTime.CardinalMap self._day_of_week = SpanishDateTime.DayOfWeek self._month_of_year = SpanishDateTime.MonthOfYear self._numbers = SpanishDateTime.Numbers self._double_numbers = SpanishDateTime.DoubleNumbers self._check_both_before_after = SpanishDateTime.CheckBothBeforeAfter self._cardinal_extractor = SpanishCardinalExtractor() self._integer_extractor = SpanishIntegerExtractor() self._ordinal_extractor = SpanishOrdinalExtractor() self._number_parser = BaseNumberParser( SpanishNumberParserConfiguration()) self._date_extractor = BaseDateExtractor( SpanishDateExtractorConfiguration()) self._time_extractor = BaseTimeExtractor( SpanishTimeExtractorConfiguration()) self._duration_extractor = BaseDurationExtractor( SpanishDurationExtractorConfiguration()) self._date_period_extractor = BaseDatePeriodExtractor( SpanishDatePeriodExtractorConfiguration()) self._time_period_extractor = BaseTimePeriodExtractor( SpanishTimePeriodExtractorConfiguration()) self._date_time_extractor = BaseDateTimeExtractor( SpanishDateTimeExtractorConfiguration()) self._date_time_period_extractor = BaseDateTimePeriodExtractor( SpanishDateTimePeriodExtractorConfiguration()) self._duration_parser = BaseDurationParser( SpanishDurationParserConfiguration(self)) self._date_parser = BaseDateParser( SpanishDateParserConfiguration(self)) self._time_parser = BaseTimeParser( SpanishTimeParserConfiguration(self)) self._date_period_parser = BaseDatePeriodParser( SpanishDatePeriodParserConfiguration(self)) self._time_period_parser = BaseTimePeriodParser( SpanishTimePeriodParserConfiguration(self)) self._date_time_parser = BaseDateTimeParser( SpanishDateTimeParserConfiguration(self)) self._date_time_period_parser = BaseDateTimePeriodParser( SpanishDateTimePeriodParserConfiguration(self))
def __init__(self): self._simple_cases_regexes = [ RegExpUtility.get_safe_reg_exp(SpanishDateTime.SimpleCasesRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.DayBetweenRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.SimpleCasesRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.DayBetweenRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.OneWordPeriodRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.MonthWithYearRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.MonthNumWithYearRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.YearRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.WeekOfMonthRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.WeekOfYearRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.MonthFrontBetweenRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.MonthFrontSimpleCasesRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.QuarterRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.QuarterRegexYearFront), RegExpUtility.get_safe_reg_exp(SpanishDateTime.AllHalfYearRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.SeasonRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.RestOfDateRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.LaterEarlyPeriodRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.WeekWithWeekDayRangeRegex) ] self._illegal_year_regex = RegExpUtility.get_safe_reg_exp(BaseDateTime.IllegalYearRegex) self._year_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.YearRegex) self._till_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.TillRegex) self._followed_unit = RegExpUtility.get_safe_reg_exp(SpanishDateTime.FollowedDateUnit) self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp(SpanishDateTime.NumberCombinedWithDateUnit) self._past_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.PastRegex) self._future_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.FutureRegex) self._week_of_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.WeekOfRegex) self._month_of_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.MonthOfRegex) self._date_unit_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.DateUnitRegex) self._in_connector_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.InConnectorRegex) self._range_unit_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.RangeUnitRegex) self.from_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.FromRegex) self.connector_and_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.ConnectorAndRegex) self.between_regex = RegExpUtility.get_safe_reg_exp(SpanishDateTime.BetweenRegex) self._date_point_extractor = BaseDateExtractor(SpanishDateExtractorConfiguration()) self._integer_extractor = SpanishIntegerExtractor() self._number_parser = BaseNumberParser(SpanishNumberParserConfiguration()) self._duration_extractor = BaseDurationExtractor(SpanishDurationExtractorConfiguration())
def __init__(self): self._single_time_extractor = BaseTimeExtractor( SpanishTimeExtractorConfiguration()) self._integer_extractor = SpanishIntegerExtractor() self.utility_configuration = SpanishDateTimeUtilityConfiguration() self._simple_cases_regex: List[Pattern] = [ RegExpUtility.get_safe_reg_exp(SpanishDateTime.PureNumFromTo), RegExpUtility.get_safe_reg_exp(SpanishDateTime.PureNumBetweenAnd) ] self._till_regex: Pattern = RegExpUtility.get_safe_reg_exp( SpanishDateTime.TillRegex) self._time_of_day_regex: Pattern = RegExpUtility.get_safe_reg_exp( SpanishDateTime.TimeOfDayRegex) self._general_ending_regex: Pattern = RegExpUtility.get_safe_reg_exp( SpanishDateTime.GeneralEndingRegex) self.from_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.FromRegex) self.connector_and_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.ConnectorAndRegex) self.between_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.BetweenRegex)
def __init__(self): self._year_period_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.YearPeriodRegex) self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.PastRegex) self._simple_cases_regexes = [ self._year_period_regex, RegExpUtility.get_safe_reg_exp(SpanishDateTime.SimpleCasesRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.DayBetweenRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.OneWordPeriodRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.MonthWithYearRegex), RegExpUtility.get_safe_reg_exp( SpanishDateTime.MonthNumWithYearRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.YearRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.WeekOfMonthRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.WeekOfYearRegex), RegExpUtility.get_safe_reg_exp( SpanishDateTime.MonthFrontBetweenRegex), RegExpUtility.get_safe_reg_exp( SpanishDateTime.MonthFrontSimpleCasesRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.QuarterRegex), RegExpUtility.get_safe_reg_exp( SpanishDateTime.QuarterRegexYearFront), RegExpUtility.get_safe_reg_exp(SpanishDateTime.SeasonRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.RestOfDateRegex), RegExpUtility.get_safe_reg_exp( SpanishDateTime.LaterEarlyPeriodRegex), RegExpUtility.get_safe_reg_exp( SpanishDateTime.WeekWithWeekDayRangeRegex), RegExpUtility.get_safe_reg_exp( SpanishDateTime.YearPlusNumberRegex), RegExpUtility.get_safe_reg_exp(SpanishDateTime.WhichWeekRegex), RegExpUtility.get_safe_reg_exp( SpanishDateTime.ReferenceDatePeriodRegex), ] self._check_both_before_after = SpanishDateTime.CheckBothBeforeAfter self._time_unit_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.TimeUnitRegex) self._within_next_prefix_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.WithinNextPrefixRegex) self._illegal_year_regex = RegExpUtility.get_safe_reg_exp( BaseDateTime.IllegalYearRegex) self._year_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.YearRegex) self._till_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.TillRegex) self._followed_unit = RegExpUtility.get_safe_reg_exp( SpanishDateTime.FollowedDateUnit) self._number_combined_with_unit = RegExpUtility.get_safe_reg_exp( SpanishDateTime.NumberCombinedWithDateUnit) self._past_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.PastRegex) self._future_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.FutureRegex) self._week_of_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.WeekOfRegex) self._month_of_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.MonthOfRegex) self._date_unit_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.DateUnitRegex) self._in_connector_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.InConnectorRegex) self._range_unit_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.RangeUnitRegex) self._all_half_year_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.AllHalfYearRegex) self.from_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.FromRegex) self.connector_and_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.ConnectorAndRegex) self.between_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.BetweenRegex) self._date_point_extractor = BaseDateExtractor( SpanishDateExtractorConfiguration()) self._integer_extractor = SpanishIntegerExtractor() self._number_parser = BaseNumberParser( SpanishNumberParserConfiguration()) self._duration_extractor = BaseDurationExtractor( SpanishDurationExtractorConfiguration()) self._now_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.NowRegex) self._future_suffix_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.FutureSuffixRegex) self._ago_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.AgoRegex) self._later_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.LaterRegex) self._less_than_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.LessThanRegex) self._more_than_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.MoreThanRegex) self._duration_date_restrictions = SpanishDateTime.DurationDateRestrictions self._month_num_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.MonthNumRegex) self._century_suffix_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.CenturySuffixRegex) self._check_both_before_after = False self._cardinal_extractor = SpanishCardinalExtractor() self._ordinal_extractor = SpanishOrdinalExtractor() self._decade_with_century_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.DecadeWithCenturyRegex) self._previous_prefix_regex = RegExpUtility.get_safe_reg_exp( SpanishDateTime.PreviousPrefixRegex)