Exemplo n.º 1
0
        public ChineseDateParserConfiguration(ICJKCommonDateTimeParserConfiguration config)
            : base(config)
        {
            IntegerExtractor = config.IntegerExtractor;
            OrdinalExtractor = config.OrdinalExtractor;

            NumberParser = config.NumberParser;

            DateExtractor     = config.DateExtractor;
            DurationExtractor = config.DurationExtractor;

            DateRegexList       = new ChineseDateExtractorConfiguration(this).DateRegexList;
            SpecialDate         = ChineseDateExtractorConfiguration.SpecialDate;
            NextRe              = ChineseDateExtractorConfiguration.NextRe;
            LastRe              = ChineseDateExtractorConfiguration.LastRe;
            SpecialDayRegex     = ChineseDateExtractorConfiguration.SpecialDayRegex;
            StrictWeekDayRegex  = ChineseDateExtractorConfiguration.WeekDayRegex;
            LunarRegex          = ChineseDateExtractorConfiguration.LunarRegex;
            UnitRegex           = ChineseDateExtractorConfiguration.UnitRegex;
            BeforeRegex         = ChineseDateExtractorConfiguration.BeforeRegex;
            AfterRegex          = ChineseDateExtractorConfiguration.AfterRegex;
            DynastyYearRegex    = ChineseDateExtractorConfiguration.DynastyYearRegex;
            DynastyStartYear    = ChineseDateExtractorConfiguration.DynastyStartYear;
            DynastyYearMap      = ChineseDateExtractorConfiguration.DynastyYearMap;
            NextRegex           = ChineseDateExtractorConfiguration.NextRegex;
            ThisRegex           = ChineseDateExtractorConfiguration.ThisRegex;
            LastRegex           = ChineseDateExtractorConfiguration.LastRegex;
            WeekDayOfMonthRegex = ChineseDateExtractorConfiguration.WeekDayOfMonthRegex;

            CardinalMap = config.CardinalMap;
            UnitMap     = config.UnitMap;
            DayOfMonth  = config.DayOfMonth;
            DayOfWeek   = config.DayOfWeek;
            MonthOfYear = config.MonthOfYear;
        }
Exemplo n.º 2
0
        public ChineseDateTimeParserConfiguration(IDateTimeOptionsConfiguration config)
            : base(config)
        {
            DateExtractor = new ChineseDateExtractorConfiguration();

            DateParser           = new ChineseDateParserConfiguration(this);
            TimeParser           = new ChineseTimeParserConfiguration(this);
            DateTimeParser       = new ChineseDateTimeParser(this);
            DatePeriodParser     = new ChineseDatePeriodParserConfiguration(this);
            TimePeriodParser     = new ChineseTimePeriodParserConfiguration(this);
            DateTimePeriodParser = new ChineseDateTimePeriodParserConfiguration(this);
            DurationParser       = new ChineseDurationParserConfiguration(this);
            GetParser            = new ChineseSetParserConfiguration(this);
            HolidayParser        = new ChineseHolidayParserConfiguration(this);

            UnitMap        = DateTimeDefinitions.ParserConfigurationUnitMap.ToImmutableDictionary();
            UnitValueMap   = DateTimeDefinitions.ParserConfigurationUnitValueMap.ToImmutableDictionary();
            SeasonMap      = DateTimeDefinitions.ParserConfigurationSeasonMap.ToImmutableDictionary();
            SeasonValueMap = DateTimeDefinitions.ParserConfigurationSeasonValueMap.ToImmutableDictionary();
            CardinalMap    = DateTimeDefinitions.ParserConfigurationCardinalMap.ToImmutableDictionary();
            DayOfMonth     = DateTimeDefinitions.ParserConfigurationDayOfMonth.ToImmutableDictionary();
            DayOfWeek      = DateTimeDefinitions.ParserConfigurationDayOfWeek.ToImmutableDictionary();
            MonthOfYear    = DateTimeDefinitions.ParserConfigurationMonthOfYear.ToImmutableDictionary();
            Numbers        = InitNumbers();

            DateRegexList = ChineseDateExtractorConfiguration.DateRegexList;

            NextRegex           = ChineseDateExtractorConfiguration.NextRegex;
            ThisRegex           = ChineseDateExtractorConfiguration.ThisRegex;
            LastRegex           = ChineseDateExtractorConfiguration.LastRegex;
            YearRegex           = ChineseDateExtractorConfiguration.YearRegex;
            RelativeRegex       = ChineseDateExtractorConfiguration.RelativeRegex;
            StrictWeekDayRegex  = ChineseDateExtractorConfiguration.WeekDayRegex;
            WeekDayOfMonthRegex = ChineseDateExtractorConfiguration.WeekDayOfMonthRegex;
            BeforeRegex         = ChineseMergedExtractorConfiguration.BeforeRegex;
            AfterRegex          = ChineseMergedExtractorConfiguration.AfterRegex;
            UntilRegex          = ChineseMergedExtractorConfiguration.UntilRegex;
            SincePrefixRegex    = ChineseMergedExtractorConfiguration.SincePrefixRegex;
            SinceSuffixRegex    = ChineseMergedExtractorConfiguration.SinceSuffixRegex;
            EqualRegex          = ChineseMergedExtractorConfiguration.EqualRegex;
        }