예제 #1
0
 public ItalianDateParserConfiguration(ICommonDateTimeParserConfiguration config) : base(config.Options)
 {
     DateTokenPrefix          = DateTimeDefinitions.DateTokenPrefix;
     IntegerExtractor         = config.IntegerExtractor;
     OrdinalExtractor         = config.OrdinalExtractor;
     CardinalExtractor        = config.CardinalExtractor;
     NumberParser             = config.NumberParser;
     DurationExtractor        = config.DurationExtractor;
     DateExtractor            = config.DateExtractor;
     DurationParser           = config.DurationParser;
     DateRegexes              = new ItalianDateExtractorConfiguration(this).DateRegexList;
     OnRegex                  = ItalianDateExtractorConfiguration.OnRegex;
     SpecialDayRegex          = ItalianDateExtractorConfiguration.SpecialDayRegex;
     SpecialDayWithNumRegex   = ItalianDateExtractorConfiguration.SpecialDayWithNumRegex;
     NextRegex                = ItalianDateExtractorConfiguration.NextRegex;
     ThisRegex                = ItalianDateExtractorConfiguration.ThisRegex;
     LastRegex                = ItalianDateExtractorConfiguration.LastRegex;
     UnitRegex                = ItalianDateExtractorConfiguration.DateUnitRegex;
     WeekDayRegex             = ItalianDateExtractorConfiguration.WeekDayRegex;
     StrictWeekDay            = ItalianDateExtractorConfiguration.StrictWeekDay;
     MonthRegex               = ItalianDateExtractorConfiguration.MonthRegex;
     WeekDayOfMonthRegex      = ItalianDateExtractorConfiguration.WeekDayOfMonthRegex;
     ForTheRegex              = ItalianDateExtractorConfiguration.ForTheRegex;
     WeekDayAndDayOfMothRegex = ItalianDateExtractorConfiguration.WeekDayAndDayOfMothRegex;
     RelativeMonthRegex       = ItalianDateExtractorConfiguration.RelativeMonthRegex;
     YearSuffix               = ItalianDateExtractorConfiguration.YearSuffix;
     RelativeWeekDayRegex     = ItalianDateExtractorConfiguration.RelativeWeekDayRegex;
     DayOfMonth               = config.DayOfMonth;
     DayOfWeek                = config.DayOfWeek;
     MonthOfYear              = config.MonthOfYear;
     CardinalMap              = config.CardinalMap;
     UnitMap                  = config.UnitMap;
     UtilityConfiguration     = config.UtilityConfiguration;
 }
예제 #2
0
        public ItalianDateParserConfiguration(ICommonDateTimeParserConfiguration config)
            : base(config)
        {
            DateTokenPrefix          = DateTimeDefinitions.DateTokenPrefix;
            IntegerExtractor         = config.IntegerExtractor;
            OrdinalExtractor         = config.OrdinalExtractor;
            CardinalExtractor        = config.CardinalExtractor;
            NumberParser             = config.NumberParser;
            DurationExtractor        = config.DurationExtractor;
            DateExtractor            = config.DateExtractor;
            DurationParser           = config.DurationParser;
            HolidayParser            = new BaseHolidayParser(new ItalianHolidayParserConfiguration(this));
            DateRegexes              = new ItalianDateExtractorConfiguration(this).DateRegexList;
            OnRegex                  = ItalianDateExtractorConfiguration.OnRegex;
            SpecialDayRegex          = ItalianDateExtractorConfiguration.SpecialDayRegex;
            SpecialDayWithNumRegex   = ItalianDateExtractorConfiguration.SpecialDayWithNumRegex;
            NextRegex                = ItalianDateExtractorConfiguration.NextDateRegex;
            ThisRegex                = ItalianDateExtractorConfiguration.ThisRegex;
            LastRegex                = ItalianDateExtractorConfiguration.LastDateRegex;
            UnitRegex                = ItalianDateExtractorConfiguration.DateUnitRegex;
            WeekDayRegex             = ItalianDateExtractorConfiguration.WeekDayRegex;
            StrictWeekDay            = ItalianDateExtractorConfiguration.StrictWeekDay;
            MonthRegex               = ItalianDateExtractorConfiguration.MonthRegex;
            WeekDayOfMonthRegex      = ItalianDateExtractorConfiguration.WeekDayOfMonthRegex;
            ForTheRegex              = ItalianDateExtractorConfiguration.ForTheRegex;
            WeekDayAndDayOfMothRegex = ItalianDateExtractorConfiguration.WeekDayAndDayOfMothRegex;
            WeekDayAndDayRegex       = ItalianDateExtractorConfiguration.WeekDayAndDayRegex;
            RelativeMonthRegex       = ItalianDateExtractorConfiguration.RelativeMonthRegex;
            StrictRelativeRegex      = ItalianDateExtractorConfiguration.StrictRelativeRegex;
            YearSuffix               = ItalianDateExtractorConfiguration.YearSuffix;
            RelativeWeekDayRegex     = ItalianDateExtractorConfiguration.RelativeWeekDayRegex;
            BeforeAfterRegex         = ItalianDateExtractorConfiguration.BeforeAfterRegex;

            // @TODO move to config
            RelativeDayRegex    = new Regex(DateTimeDefinitions.RelativeDayRegex, RegexFlags);
            NextPrefixRegex     = new Regex(DateTimeDefinitions.NextPrefixRegex, RegexFlags);
            PreviousPrefixRegex = new Regex(DateTimeDefinitions.PreviousPrefixRegex, RegexFlags);
            UpcomingPrefixRegex = new Regex(DateTimeDefinitions.UpcomingPrefixRegex, RegexFlags);
            PastPrefixRegex     = new Regex(DateTimeDefinitions.PastPrefixRegex, RegexFlags);

            DayOfMonth           = config.DayOfMonth;
            DayOfWeek            = config.DayOfWeek;
            MonthOfYear          = config.MonthOfYear;
            Numbers              = config.Numbers;
            CardinalMap          = config.CardinalMap;
            UnitMap              = config.UnitMap;
            UtilityConfiguration = config.UtilityConfiguration;

            SameDayTerms     = DateTimeDefinitions.SameDayTerms.ToImmutableList();
            PlusOneDayTerms  = DateTimeDefinitions.PlusOneDayTerms.ToImmutableList();
            PlusTwoDayTerms  = DateTimeDefinitions.PlusTwoDayTerms.ToImmutableList();
            MinusOneDayTerms = DateTimeDefinitions.MinusOneDayTerms.ToImmutableList();
            MinusTwoDayTerms = DateTimeDefinitions.MinusTwoDayTerms.ToImmutableList();
        }
 public ItalianDateParserConfiguration(ICommonDateTimeParserConfiguration config) : base(config.Options)
 {
     DateTokenPrefix          = DateTimeDefinitions.DateTokenPrefix;
     IntegerExtractor         = config.IntegerExtractor;
     OrdinalExtractor         = config.OrdinalExtractor;
     CardinalExtractor        = config.CardinalExtractor;
     NumberParser             = config.NumberParser;
     DurationExtractor        = config.DurationExtractor;
     DateExtractor            = config.DateExtractor;
     DurationParser           = config.DurationParser;
     DateRegexes              = new ItalianDateExtractorConfiguration(this).DateRegexList;
     OnRegex                  = ItalianDateExtractorConfiguration.OnRegex;
     SpecialDayRegex          = ItalianDateExtractorConfiguration.SpecialDayRegex;
     SpecialDayWithNumRegex   = ItalianDateExtractorConfiguration.SpecialDayWithNumRegex;
     NextRegex                = ItalianDateExtractorConfiguration.NextRegex;
     ThisRegex                = ItalianDateExtractorConfiguration.ThisRegex;
     LastRegex                = ItalianDateExtractorConfiguration.LastRegex;
     UnitRegex                = ItalianDateExtractorConfiguration.DateUnitRegex;
     WeekDayRegex             = ItalianDateExtractorConfiguration.WeekDayRegex;
     StrictWeekDay            = ItalianDateExtractorConfiguration.StrictWeekDay;
     MonthRegex               = ItalianDateExtractorConfiguration.MonthRegex;
     WeekDayOfMonthRegex      = ItalianDateExtractorConfiguration.WeekDayOfMonthRegex;
     ForTheRegex              = ItalianDateExtractorConfiguration.ForTheRegex;
     WeekDayAndDayOfMothRegex = ItalianDateExtractorConfiguration.WeekDayAndDayOfMothRegex;
     RelativeMonthRegex       = ItalianDateExtractorConfiguration.RelativeMonthRegex;
     YearSuffix               = ItalianDateExtractorConfiguration.YearSuffix;
     RelativeWeekDayRegex     = ItalianDateExtractorConfiguration.RelativeWeekDayRegex;
     RelativeDayRegex         = new Regex(DateTimeDefinitions.RelativeDayRegex, RegexOptions.Singleline);
     NextPrefixRegex          = new Regex(DateTimeDefinitions.NextPrefixRegex, RegexOptions.Singleline);
     PastPrefixRegex          = new Regex(DateTimeDefinitions.PastPrefixRegex, RegexOptions.Singleline);
     DayOfMonth               = config.DayOfMonth;
     DayOfWeek                = config.DayOfWeek;
     MonthOfYear              = config.MonthOfYear;
     CardinalMap              = config.CardinalMap;
     UnitMap                  = config.UnitMap;
     UtilityConfiguration     = config.UtilityConfiguration;
     SameDayTerms             = DateTimeDefinitions.SameDayTerms.ToImmutableList();
     PlusOneDayTerms          = DateTimeDefinitions.PlusOneDayTerms.ToImmutableList();
     PlusTwoDayTerms          = DateTimeDefinitions.PlusTwoDayTerms.ToImmutableList();
     MinusOneDayTerms         = DateTimeDefinitions.MinusOneDayTerms.ToImmutableList();
     MinusTwoDayTerms         = DateTimeDefinitions.MinusTwoDayTerms.ToImmutableList();
 }