Example #1
0
        public FrenchCommonDateTimeParserConfiguration()
        {
            UtilityConfiguration = new FrenchDatetimeUtilityConfiguration();

            UnitMap       = DateTimeDefinitions.UnitMap.ToImmutableDictionary();
            UnitValueMap  = DateTimeDefinitions.UnitValueMap.ToImmutableDictionary();
            SeasonMap     = DateTimeDefinitions.SeasonMap.ToImmutableDictionary();
            CardinalMap   = DateTimeDefinitions.CardinalMap.ToImmutableDictionary();
            DayOfWeek     = DateTimeDefinitions.DayOfWeek.ToImmutableDictionary();
            MonthOfYear   = DateTimeDefinitions.MonthOfYear.ToImmutableDictionary();
            Numbers       = DateTimeDefinitions.Numbers.ToImmutableDictionary();
            DoubleNumbers = DateTimeDefinitions.DoubleNumbers.ToImmutableDictionary();

            CardinalExtractor = new CardinalExtractor();
            IntegerExtractor  = new IntegerExtractor();
            OrdinalExtractor  = new OrdinalExtractor();

            NumberParser            = new BaseNumberParser(new FrenchNumberParserConfiguration());
            DateExtractor           = new BaseDateExtractor(new FrenchDateExtractorConfiguration());
            TimeExtractor           = new BaseTimeExtractor(new FrenchTimeExtractorConfiguration());
            DateTimeExtractor       = new BaseDateTimeExtractor(new FrenchDateTimeExtractorConfiguration());
            DurationExtractor       = new BaseDurationExtractor(new FrenchDurationExtractorConfiguration());
            DatePeriodExtractor     = new BaseDatePeriodExtractor(new FrenchDatePeriodExtractorConfiguration());
            TimePeriodExtractor     = new BaseTimePeriodExtractor(new FrenchTimePeriodExtractorConfiguration());
            DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new FrenchDateTimePeriodExtractorConfiguration());
            DateParser           = new BaseDateParser(new FrenchDateParserConfiguration(this));
            TimeParser           = new BaseTimeParser(new FrenchTimeParserConfiguration(this));
            DateTimeParser       = new BaseDateTimeParser(new FrenchDateTimeParserConfiguration(this));
            DurationParser       = new BaseDurationParser(new FrenchDurationParserConfiguration(this));
            DatePeriodParser     = new BaseDatePeriodParser(new FrenchDatePeriodParserConfiguration(this));
            TimePeriodParser     = new BaseTimePeriodParser(new FrenchTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new BaseDateTimePeriodParser(new FrenchDateTimePeriodParserConfiguration(this));
        }
Example #2
0
 public SpanishCommonDateTimeParserConfiguration()
 {
     UnitMap                 = InitUnitMap();
     UnitValueMap            = InitUnitValueMap();
     SeasonMap               = InitSeasonMap();
     CardinalMap             = InitCardinalMap();
     DayOfWeek               = InitDayOfWeek();
     MonthOfYear             = InitMonthOfYear();
     Numbers                 = InitNumbers();
     DoubleNumbers           = InitDoubleNumbers();
     CardinalExtractor       = new CardinalExtractor();
     IntegerExtractor        = new IntegerExtractor();
     OrdinalExtractor        = new OrdinalExtractor();
     NumberParser            = new BaseNumberParser(new SpanishNumberParserConfiguration());
     DateExtractor           = new BaseDateExtractor(new SpanishDateExtractorConfiguration());
     TimeExtractor           = new BaseTimeExtractor(new SpanishTimeExtractorConfiguration());
     DateTimeExtractor       = new BaseDateTimeExtractor(new SpanishDateTimeExtractorConfiguration());
     DurationExtractor       = new BaseDurationExtractor(new SpanishDurationExtractorConfiguration());
     DatePeriodExtractor     = new BaseDatePeriodExtractor(new SpanishDatePeriodExtractorConfiguration());
     TimePeriodExtractor     = new BaseTimePeriodExtractor(new SpanishTimePeriodExtractorConfiguration());
     DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new SpanishDateTimePeriodExtractorConfiguration());
     DateParser              = new BaseDateParser(new SpanishDateParserConfiguration(this));
     TimeParser              = new BaseTimeParser(new SpanishTimeParserConfiguration(this));
     DateTimeParser          = new BaseDateTimeParser(new SpanishDateTimeParserConfiguration(this));
     DurationParser          = new BaseDurationParser(new SpanishDurationParserConfiguration(this));
     UtilityConfiguration    = new SpanishDatetimeUtilityConfiguration();
     DatePeriodParser        = new BaseDatePeriodParser(new SpanishDatePeriodParserConfiguration(this));
     TimePeriodParser        = new BaseTimePeriodParser(new SpanishTimePeriodParserConfiguration(this));
     DateTimePeriodParser    = new BaseDateTimePeriodParser(new SpanishDateTimePeriodParserConfiguration(this));
 }
Example #3
0
        public SpanishCommonDateTimeParserConfiguration(DateTimeOptions options) : base(options)
        {
            UtilityConfiguration = new SpanishDatetimeUtilityConfiguration();

            UnitMap       = DateTimeDefinitions.UnitMap.ToImmutableDictionary();
            UnitValueMap  = DateTimeDefinitions.UnitValueMap.ToImmutableDictionary();
            SeasonMap     = DateTimeDefinitions.SeasonMap.ToImmutableDictionary();
            CardinalMap   = DateTimeDefinitions.CardinalMap.ToImmutableDictionary();
            DayOfWeek     = DateTimeDefinitions.DayOfWeek.ToImmutableDictionary();
            MonthOfYear   = DateTimeDefinitions.MonthOfYear.ToImmutableDictionary();
            Numbers       = DateTimeDefinitions.Numbers.ToImmutableDictionary();
            DoubleNumbers = DateTimeDefinitions.DoubleNumbers.ToImmutableDictionary();

            CardinalExtractor = Number.Spanish.CardinalExtractor.GetInstance();
            IntegerExtractor  = new IntegerExtractor();
            OrdinalExtractor  = new OrdinalExtractor();

            NumberParser            = new BaseNumberParser(new SpanishNumberParserConfiguration());
            DateExtractor           = new BaseDateExtractor(new SpanishDateExtractorConfiguration());
            TimeExtractor           = new BaseTimeExtractor(new SpanishTimeExtractorConfiguration());
            DateTimeExtractor       = new BaseDateTimeExtractor(new SpanishDateTimeExtractorConfiguration());
            DurationExtractor       = new BaseDurationExtractor(new SpanishDurationExtractorConfiguration());
            DatePeriodExtractor     = new BaseDatePeriodExtractor(new SpanishDatePeriodExtractorConfiguration());
            TimePeriodExtractor     = new BaseTimePeriodExtractor(new SpanishTimePeriodExtractorConfiguration());
            DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new SpanishDateTimePeriodExtractorConfiguration());
            DateParser           = new BaseDateParser(new SpanishDateParserConfiguration(this));
            TimeParser           = new BaseTimeParser(new SpanishTimeParserConfiguration(this));
            DateTimeParser       = new BaseDateTimeParser(new SpanishDateTimeParserConfiguration(this));
            DurationParser       = new BaseDurationParser(new SpanishDurationParserConfiguration(this));
            DatePeriodParser     = new BaseDatePeriodParser(new SpanishDatePeriodParserConfiguration(this));
            TimePeriodParser     = new BaseTimePeriodParser(new SpanishTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new BaseDateTimePeriodParser(new SpanishDateTimePeriodParserConfiguration(this));
        }
Example #4
0
        public PortugueseCommonDateTimeParserConfiguration(IOptionsConfiguration config) : base(config)
        {
            UtilityConfiguration = new PortugueseDatetimeUtilityConfiguration();

            UnitMap            = DateTimeDefinitions.UnitMap.ToImmutableDictionary();
            UnitValueMap       = DateTimeDefinitions.UnitValueMap.ToImmutableDictionary();
            SeasonMap          = DateTimeDefinitions.SeasonMap.ToImmutableDictionary();
            CardinalMap        = DateTimeDefinitions.CardinalMap.ToImmutableDictionary();
            DayOfWeek          = DateTimeDefinitions.DayOfWeek.ToImmutableDictionary();
            MonthOfYear        = DateTimeDefinitions.MonthOfYear.ToImmutableDictionary();
            Numbers            = DateTimeDefinitions.Numbers.ToImmutableDictionary();
            DoubleNumbers      = DateTimeDefinitions.DoubleNumbers.ToImmutableDictionary();
            WrittenDecades     = DateTimeDefinitions.WrittenDecades.ToImmutableDictionary();
            SpecialDecadeCases = DateTimeDefinitions.SpecialDecadeCases.ToImmutableDictionary();

            CardinalExtractor = Number.Portuguese.CardinalExtractor.GetInstance();
            IntegerExtractor  = new IntegerExtractor();
            OrdinalExtractor  = new OrdinalExtractor();

            NumberParser            = new BaseNumberParser(new PortugueseNumberParserConfiguration());
            DateExtractor           = new BaseDateExtractor(new PortugueseDateExtractorConfiguration(this));
            TimeExtractor           = new BaseTimeExtractor(new PortugueseTimeExtractorConfiguration(this));
            DateTimeExtractor       = new BaseDateTimeExtractor(new PortugueseDateTimeExtractorConfiguration(this));
            DurationExtractor       = new BaseDurationExtractor(new PortugueseDurationExtractorConfiguration(this));
            DatePeriodExtractor     = new BaseDatePeriodExtractor(new PortugueseDatePeriodExtractorConfiguration(this));
            TimePeriodExtractor     = new BaseTimePeriodExtractor(new PortugueseTimePeriodExtractorConfiguration(this));
            DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new PortugueseDateTimePeriodExtractorConfiguration(this));
            DateParser           = new BaseDateParser(new PortugueseDateParserConfiguration(this));
            TimeParser           = new BaseTimeParser(new PortugueseTimeParserConfiguration(this));
            DateTimeParser       = new BaseDateTimeParser(new PortugueseDateTimeParserConfiguration(this));
            DurationParser       = new BaseDurationParser(new PortugueseDurationParserConfiguration(this));
            DatePeriodParser     = new BaseDatePeriodParser(new PortugueseDatePeriodParserConfiguration(this));
            TimePeriodParser     = new BaseTimePeriodParser(new PortugueseTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new BaseDateTimePeriodParser(new PortugueseDateTimePeriodParserConfiguration(this));
        }
Example #5
0
 public EnglishMergedParserConfiguration() : base()
 {
     BeforeRegex          = EnglishMergedExtractorConfiguration.BeforeRegex;
     AfterRegex           = EnglishMergedExtractorConfiguration.AfterRegex;
     DatePeriodParser     = new BaseDatePeriodParser(new EnglishDatePeriodParserConfiguration(this));
     TimePeriodParser     = new BaseTimePeriodParser(new EnglishTimePeriodParserConfiguration(this));
     DateTimePeriodParser = new BaseDateTimePeriodParser(new EnglishDateTimePeriodParserConfiguration(this));
     GetParser            = new BaseSetParser(new EnglishSetParserConfiguration(this));
     HolidayParser        = new BaseHolidayParser(new EnglishHolidayParserConfiguration());
 }
 public EnglishMergedParserConfiguration() : base()
 {
     BeforeRegex          = new Regex(DateTimeDefinitions.BeforeRegex, RegexOptions.IgnoreCase | RegexOptions.Singleline);
     AfterRegex           = new Regex(DateTimeDefinitions.AfterRegex, RegexOptions.IgnoreCase | RegexOptions.Singleline);
     DatePeriodParser     = new BaseDatePeriodParser(new EnglishDatePeriodParserConfiguration(this));
     TimePeriodParser     = new BaseTimePeriodParser(new EnglishTimePeriodParserConfiguration(this));
     DateTimePeriodParser = new BaseDateTimePeriodParser(new EnglishDateTimePeriodParserConfiguration(this));
     GetParser            = new BaseSetParser(new EnglishSetParserConfiguration(this));
     HolidayParser        = new BaseHolidayParser(new EnglishHolidayParserConfiguration());
 }
Example #7
0
 public GermanMergedParserConfiguration(DateTimeOptions options) : base(options)
 {
     BeforeRegex          = GermanMergedExtractorConfiguration.BeforeRegex;
     AfterRegex           = GermanMergedExtractorConfiguration.AfterRegex;
     SinceRegex           = GermanMergedExtractorConfiguration.SinceRegex;
     DatePeriodParser     = new BaseDatePeriodParser(new GermanDatePeriodParserConfiguration(this));
     TimePeriodParser     = new BaseTimePeriodParser(new GermanTimePeriodParserConfiguration(this));
     DateTimePeriodParser = new BaseDateTimePeriodParser(new GermanDateTimePeriodParserConfiguration(this));
     GetParser            = new BaseSetParser(new GermanSetParserConfiguration(this));
     HolidayParser        = new BaseHolidayParser(new GermanHolidayParserConfiguration());
 }
 public FrenchMergedParserConfiguration() : base()
 {
     BeforeRegex          = FrenchMergedExtractorConfiguration.BeforeRegex;
     AfterRegex           = FrenchMergedExtractorConfiguration.AfterRegex;
     SinceRegex           = FrenchMergedExtractorConfiguration.SinceRegex;
     DatePeriodParser     = new BaseDatePeriodParser(new FrenchDatePeriodParserConfiguration(this));
     TimePeriodParser     = new BaseTimePeriodParser(new FrenchTimePeriodParserConfiguration(this));
     DateTimePeriodParser = new BaseDateTimePeriodParser(new FrenchDateTimePeriodParserConfiguration(this));
     GetParser            = new BaseSetParser(new FrenchSetParserConfiguration(this));
     HolidayParser        = new BaseHolidayParser(new FrenchHolidayParserConfiguration());
 }
        public SwedishCommonDateTimeParserConfiguration(IDateTimeOptionsConfiguration config)
            : base(config)
        {
            UtilityConfiguration = new SwedishDatetimeUtilityConfiguration();

            UnitMap                = DateTimeDefinitions.UnitMap.ToImmutableDictionary();
            UnitValueMap           = DateTimeDefinitions.UnitValueMap.ToImmutableDictionary();
            SeasonMap              = DateTimeDefinitions.SeasonMap.ToImmutableDictionary();
            SpecialYearPrefixesMap = DateTimeDefinitions.SpecialYearPrefixesMap.ToImmutableDictionary();
            CardinalMap            = DateTimeDefinitions.CardinalMap.ToImmutableDictionary();
            DayOfWeek              = DateTimeDefinitions.DayOfWeek.ToImmutableDictionary();
            MonthOfYear            = DateTimeDefinitions.MonthOfYear.ToImmutableDictionary();
            Numbers                = DateTimeDefinitions.Numbers.ToImmutableDictionary();
            DoubleNumbers          = DateTimeDefinitions.DoubleNumbers.ToImmutableDictionary();
            WrittenDecades         = DateTimeDefinitions.WrittenDecades.ToImmutableDictionary();
            SpecialDecadeCases     = DateTimeDefinitions.SpecialDecadeCases.ToImmutableDictionary();

            var numOptions = NumberOptions.None;

            if ((config.Options & DateTimeOptions.NoProtoCache) != 0)
            {
                numOptions = NumberOptions.NoProtoCache;
            }

            var numConfig = new BaseNumberOptionsConfiguration(config.Culture, numOptions);

            CardinalExtractor = Number.Swedish.CardinalExtractor.GetInstance(numConfig);
            IntegerExtractor  = Number.Swedish.IntegerExtractor.GetInstance(numConfig);
            OrdinalExtractor  = Number.Swedish.OrdinalExtractor.GetInstance(numConfig);

            NumberParser = new BaseNumberParser(new SwedishNumberParserConfiguration(numConfig));

            TimeZoneParser = new BaseTimeZoneParser(new SwedishTimeZoneParserConfiguration(this));

            // Do not change order. The order of initialization can lead to side-effects
            DateExtractor           = new BaseDateExtractor(new SwedishDateExtractorConfiguration(this));
            TimeExtractor           = new BaseTimeExtractor(new SwedishTimeExtractorConfiguration(this));
            DateTimeExtractor       = new BaseDateTimeExtractor(new SwedishDateTimeExtractorConfiguration(this));
            DurationExtractor       = new BaseDurationExtractor(new SwedishDurationExtractorConfiguration(this));
            DatePeriodExtractor     = new BaseDatePeriodExtractor(new SwedishDatePeriodExtractorConfiguration(this));
            TimePeriodExtractor     = new BaseTimePeriodExtractor(new SwedishTimePeriodExtractorConfiguration(this));
            DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new SwedishDateTimePeriodExtractorConfiguration(this));

            DurationParser       = new BaseDurationParser(new SwedishDurationParserConfiguration(this));
            DateParser           = new BaseDateParser(new SwedishDateParserConfiguration(this));
            TimeParser           = new TimeParser(new SwedishTimeParserConfiguration(this));
            DateTimeParser       = new BaseDateTimeParser(new SwedishDateTimeParserConfiguration(this));
            DatePeriodParser     = new BaseDatePeriodParser(new SwedishDatePeriodParserConfiguration(this));
            TimePeriodParser     = new BaseTimePeriodParser(new SwedishTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new BaseDateTimePeriodParser(new SwedishDateTimePeriodParserConfiguration(this));

            DateTimeAltParser = new BaseDateTimeAltParser(new SwedishDateTimeAltParserConfiguration(this));
        }
Example #10
0
 public EnglishMergedParserConfiguration(DateTimeOptions options) : base(options)
 {
     BeforeRegex          = EnglishMergedExtractorConfiguration.BeforeRegex;
     AfterRegex           = EnglishMergedExtractorConfiguration.AfterRegex;
     SinceRegex           = EnglishMergedExtractorConfiguration.SinceRegex;
     YearAfterRegex       = EnglishMergedExtractorConfiguration.YearAfterRegex;
     YearRegex            = EnglishDatePeriodExtractorConfiguration.YearRegex;
     DatePeriodParser     = new BaseDatePeriodParser(new EnglishDatePeriodParserConfiguration(this));
     TimePeriodParser     = new BaseTimePeriodParser(new EnglishTimePeriodParserConfiguration(this));
     DateTimePeriodParser = new BaseDateTimePeriodParser(new EnglishDateTimePeriodParserConfiguration(this));
     GetParser            = new BaseSetParser(new EnglishSetParserConfiguration(this));
     HolidayParser        = new BaseHolidayParser(new EnglishHolidayParserConfiguration());
     TimeZoneParser       = new BaseTimeZoneParser();
 }
Example #11
0
        public FrenchCommonDateTimeParserConfiguration(IDateTimeOptionsConfiguration config)
            : base(config)
        {
            UtilityConfiguration = new FrenchDatetimeUtilityConfiguration();

            UnitMap                = DateTimeDefinitions.UnitMap.ToImmutableDictionary();
            UnitValueMap           = DateTimeDefinitions.UnitValueMap.ToImmutableDictionary();
            SeasonMap              = DateTimeDefinitions.SeasonMap.ToImmutableDictionary();
            SpecialYearPrefixesMap = DateTimeDefinitions.SpecialYearPrefixesMap.ToImmutableDictionary();
            CardinalMap            = DateTimeDefinitions.CardinalMap.ToImmutableDictionary();
            DayOfWeek              = DateTimeDefinitions.DayOfWeek.ToImmutableDictionary();
            MonthOfYear            = DateTimeDefinitions.MonthOfYear.ToImmutableDictionary();
            Numbers                = DateTimeDefinitions.Numbers.ToImmutableDictionary();
            DoubleNumbers          = DateTimeDefinitions.DoubleNumbers.ToImmutableDictionary();
            WrittenDecades         = DateTimeDefinitions.WrittenDecades.ToImmutableDictionary();
            SpecialDecadeCases     = DateTimeDefinitions.SpecialDecadeCases.ToImmutableDictionary();

            var numOptions = NumberOptions.None;

            if ((config.Options & DateTimeOptions.NoProtoCache) != 0)
            {
                numOptions = NumberOptions.NoProtoCache;
            }

            var numConfig = new BaseNumberOptionsConfiguration(config.Culture, numOptions);

            CardinalExtractor = Number.French.CardinalExtractor.GetInstance(numConfig);
            IntegerExtractor  = Number.French.IntegerExtractor.GetInstance(numConfig);
            OrdinalExtractor  = Number.French.OrdinalExtractor.GetInstance(numConfig);

            NumberParser = new BaseNumberParser(new FrenchNumberParserConfiguration(numConfig));

            DateExtractor           = new BaseDateExtractor(new FrenchDateExtractorConfiguration(this));
            TimeExtractor           = new BaseTimeExtractor(new FrenchTimeExtractorConfiguration(this));
            DateTimeExtractor       = new BaseDateTimeExtractor(new FrenchDateTimeExtractorConfiguration(this));
            DurationExtractor       = new BaseDurationExtractor(new FrenchDurationExtractorConfiguration(this));
            DatePeriodExtractor     = new BaseDatePeriodExtractor(new FrenchDatePeriodExtractorConfiguration(this));
            TimePeriodExtractor     = new BaseTimePeriodExtractor(new FrenchTimePeriodExtractorConfiguration(this));
            DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new FrenchDateTimePeriodExtractorConfiguration(this));

            // DurationParser should be assigned first, as DateParser would reference the DurationParser
            DurationParser       = new BaseDurationParser(new FrenchDurationParserConfiguration(this));
            DateParser           = new BaseDateParser(new FrenchDateParserConfiguration(this));
            TimeParser           = new BaseTimeParser(new FrenchTimeParserConfiguration(this));
            DateTimeParser       = new BaseDateTimeParser(new FrenchDateTimeParserConfiguration(this));
            DatePeriodParser     = new BaseDatePeriodParser(new FrenchDatePeriodParserConfiguration(this));
            TimePeriodParser     = new BaseTimePeriodParser(new FrenchTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new BaseDateTimePeriodParser(new FrenchDateTimePeriodParserConfiguration(this));
            DateTimeAltParser    = new BaseDateTimeAltParser(new FrenchDateTimeAltParserConfiguration(this));
        }
        public HindiCommonDateTimeParserConfiguration(IDateTimeOptionsConfiguration config)
            : base(config)
        {
            UtilityConfiguration = new HindiDatetimeUtilityConfiguration();

            UnitMap                = DateTimeDefinitions.UnitMap.ToImmutableDictionary();
            UnitValueMap           = DateTimeDefinitions.UnitValueMap.ToImmutableDictionary();
            SeasonMap              = DateTimeDefinitions.SeasonMap.ToImmutableDictionary();
            SpecialYearPrefixesMap = DateTimeDefinitions.SpecialYearPrefixesMap.ToImmutableDictionary();
            CardinalMap            = DateTimeDefinitions.CardinalMap.ToImmutableDictionary();
            DayOfWeek              = DateTimeDefinitions.DayOfWeek.ToImmutableDictionary();
            MonthOfYear            = DateTimeDefinitions.MonthOfYear.ToImmutableDictionary();
            Numbers                = DateTimeDefinitions.Numbers.ToImmutableDictionary();
            DoubleNumbers          = DateTimeDefinitions.DoubleNumbers.ToImmutableDictionary();
            WrittenDecades         = DateTimeDefinitions.WrittenDecades.ToImmutableDictionary();
            SpecialDecadeCases     = DateTimeDefinitions.SpecialDecadeCases.ToImmutableDictionary();

            var numOptions = NumberOptions.None;

            if ((config.Options & DateTimeOptions.NoProtoCache) != 0)
            {
                numOptions = NumberOptions.NoProtoCache;
            }

            var numConfig = new BaseNumberOptionsConfiguration(config.Culture, numOptions);

            CardinalExtractor = Number.Hindi.CardinalExtractor.GetInstance();
            IntegerExtractor  = Number.Hindi.IntegerExtractor.GetInstance();
            OrdinalExtractor  = Number.Hindi.OrdinalExtractor.GetInstance();

            NumberParser = new BaseIndianNumberParser(new HindiNumberParserConfiguration(numConfig));

            TimeZoneParser = new BaseTimeZoneParser();

            DateExtractor           = new BaseDateExtractor(new HindiDateExtractorConfiguration(this));
            TimeExtractor           = new BaseTimeExtractor(new HindiTimeExtractorConfiguration(this));
            DateTimeExtractor       = new BaseDateTimeExtractor(new HindiDateTimeExtractorConfiguration(this));
            DurationExtractor       = new BaseDurationExtractor(new HindiDurationExtractorConfiguration(this));
            DatePeriodExtractor     = new BaseDatePeriodExtractor(new HindiDatePeriodExtractorConfiguration(this));
            TimePeriodExtractor     = new BaseTimePeriodExtractor(new HindiTimePeriodExtractorConfiguration(this));
            DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new HindiDateTimePeriodExtractorConfiguration(this));
            DurationParser          = new BaseDurationParser(new HindiDurationParserConfiguration(this));
            DateParser           = new BaseDateParser(new HindiDateParserConfiguration(this));
            TimeParser           = new TimeParser(new HindiTimeParserConfiguration(this));
            DateTimeParser       = new BaseDateTimeParser(new HindiDateTimeParserConfiguration(this));
            DatePeriodParser     = new BaseDatePeriodParser(new HindiDatePeriodParserConfiguration(this));
            TimePeriodParser     = new BaseTimePeriodParser(new HindiTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new BaseDateTimePeriodParser(new HindiDateTimePeriodParserConfiguration(this));
            DateTimeAltParser    = new BaseDateTimeAltParser(new HindiDateTimeAltParserConfiguration(this));
        }
Example #13
0
 public GermanMergedParserConfiguration(DateTimeOptions options) : base(options)
 {
     BeforeRegex            = GermanMergedExtractorConfiguration.BeforeRegex;
     AfterRegex             = GermanMergedExtractorConfiguration.AfterRegex;
     SinceRegex             = GermanMergedExtractorConfiguration.SinceRegex;
     YearAfterRegex         = GermanMergedExtractorConfiguration.YearAfterRegex;
     YearRegex              = GermanDatePeriodExtractorConfiguration.YearRegex;
     SuperfluousWordMatcher = GermanMergedExtractorConfiguration.SuperfluousWordMatcher;
     DatePeriodParser       = new BaseDatePeriodParser(new GermanDatePeriodParserConfiguration(this));
     TimePeriodParser       = new BaseTimePeriodParser(new GermanTimePeriodParserConfiguration(this));
     DateTimePeriodParser   = new BaseDateTimePeriodParser(new GermanDateTimePeriodParserConfiguration(this));
     SetParser              = new BaseSetParser(new GermanSetParserConfiguration(this));
     HolidayParser          = new BaseHolidayParser(new GermanHolidayParserConfiguration());
     TimeZoneParser         = new BaseTimeZoneParser();
 }
Example #14
0
 public FrenchMergedParserConfiguration(DateTimeOptions options) : base(options)
 {
     BeforeRegex            = FrenchMergedExtractorConfiguration.BeforeRegex;
     AfterRegex             = FrenchMergedExtractorConfiguration.AfterRegex;
     SinceRegex             = FrenchMergedExtractorConfiguration.SinceRegex;
     YearAfterRegex         = FrenchMergedExtractorConfiguration.YearAfterRegex;
     SuperfluousWordMatcher = FrenchMergedExtractorConfiguration.SuperfluousWordMatcher;
     YearRegex            = FrenchDatePeriodExtractorConfiguration.YearRegex;
     DatePeriodParser     = new BaseDatePeriodParser(new FrenchDatePeriodParserConfiguration(this));
     TimePeriodParser     = new BaseTimePeriodParser(new FrenchTimePeriodParserConfiguration(this));
     DateTimePeriodParser = new BaseDateTimePeriodParser(new FrenchDateTimePeriodParserConfiguration(this));
     GetParser            = new BaseSetParser(new FrenchSetParserConfiguration(this));
     HolidayParser        = new BaseHolidayParser(new FrenchHolidayParserConfiguration());
     TimeZoneParser       = new BaseTimeZoneParser();
 }
        public EnglishMergedParserConfiguration(IOptionsConfiguration config) : base(config)
        {
            BeforeRegex            = EnglishMergedExtractorConfiguration.BeforeRegex;
            AfterRegex             = EnglishMergedExtractorConfiguration.AfterRegex;
            SinceRegex             = EnglishMergedExtractorConfiguration.SinceRegex;
            YearAfterRegex         = EnglishMergedExtractorConfiguration.YearAfterRegex;
            YearRegex              = EnglishDatePeriodExtractorConfiguration.YearRegex;
            SuperfluousWordMatcher = EnglishMergedExtractorConfiguration.SuperfluousWordMatcher;

            DatePeriodParser     = new BaseDatePeriodParser(new EnglishDatePeriodParserConfiguration(this));
            TimePeriodParser     = new BaseTimePeriodParser(new EnglishTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new BaseDateTimePeriodParser(new EnglishDateTimePeriodParserConfiguration(this));
            SetParser            = new BaseSetParser(new EnglishSetParserConfiguration(this));
            HolidayParser        = new BaseHolidayParser(new EnglishHolidayParserConfiguration(this));
            TimeZoneParser       = new BaseTimeZoneParser();
        }
 public ItalianMergedParserConfiguration(IOptionsConfiguration options) : base(options)
 {
     BeforeRegex            = ItalianMergedExtractorConfiguration.BeforeRegex;
     AfterRegex             = ItalianMergedExtractorConfiguration.AfterRegex;
     SinceRegex             = ItalianMergedExtractorConfiguration.SinceRegex;
     AroundRegex            = ItalianMergedExtractorConfiguration.AroundRegex;
     DateAfter              = ItalianMergedExtractorConfiguration.DateAfterRegex;
     YearRegex              = ItalianDatePeriodExtractorConfiguration.YearRegex;
     SuperfluousWordMatcher = ItalianMergedExtractorConfiguration.SuperfluousWordMatcher;
     DatePeriodParser       = new BaseDatePeriodParser(new ItalianDatePeriodParserConfiguration(this));
     TimePeriodParser       = new BaseTimePeriodParser(new ItalianTimePeriodParserConfiguration(this));
     DateTimePeriodParser   = new BaseDateTimePeriodParser(new ItalianDateTimePeriodParserConfiguration(this));
     SetParser              = new BaseSetParser(new ItalianSetParserConfiguration(this));
     HolidayParser          = new BaseHolidayParser(new ItalianHolidayParserConfiguration(this));
     TimeZoneParser         = new BaseTimeZoneParser();
 }
        public ThaiMergedParserConfiguration(DateTimeOptions options) : base(options | DateTimeOptions.Format24)
        {
            BeforeRegex            = ThaiMergedExtractorConfiguration.BeforeRegex;
            AfterRegex             = ThaiMergedExtractorConfiguration.AfterRegex;
            SinceRegex             = ThaiMergedExtractorConfiguration.SinceRegex;
            YearAfterRegex         = ThaiMergedExtractorConfiguration.YearAfterRegex;
            YearRegex              = ThaiDatePeriodExtractorConfiguration.YearRegex;
            SuperfluousWordMatcher = null;

            DatePeriodParser     = new BaseDatePeriodParser(new ThaiDatePeriodParserConfiguration(this));
            TimePeriodParser     = new BaseTimePeriodParser(new ThaiTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new BaseDateTimePeriodParser(new ThaiDateTimePeriodParserConfiguration(this));
            GetParser            = null;
            HolidayParser        = null;
            TimeZoneParser       = new BaseTimeZoneParser();
        }
 public GermanMergedParserConfiguration(IOptionsConfiguration config) : base(config)
 {
     BeforeRegex            = GermanMergedExtractorConfiguration.BeforeRegex;
     AfterRegex             = GermanMergedExtractorConfiguration.AfterRegex;
     SinceRegex             = GermanMergedExtractorConfiguration.SinceRegex;
     AroundRegex            = GermanMergedExtractorConfiguration.AroundRegex;
     DateAfter              = GermanMergedExtractorConfiguration.DateAfterRegex;
     YearRegex              = GermanDatePeriodExtractorConfiguration.YearRegex;
     SuperfluousWordMatcher = GermanMergedExtractorConfiguration.SuperfluousWordMatcher;
     DatePeriodParser       = new BaseDatePeriodParser(new GermanDatePeriodParserConfiguration(this));
     TimePeriodParser       = new BaseTimePeriodParser(new GermanTimePeriodParserConfiguration(this));
     DateTimePeriodParser   = new BaseDateTimePeriodParser(new GermanDateTimePeriodParserConfiguration(this));
     SetParser              = new BaseSetParser(new GermanSetParserConfiguration(this));
     HolidayParser          = new HolidayParserGer(new GermanHolidayParserConfiguration(this));
     TimeZoneParser         = new DummyTimeZoneParser();
 }
Example #19
0
        public TurkishMergedParserConfiguration(IDateTimeOptionsConfiguration config)
            : base(config)
        {
            AroundRegex = TurkishMergedExtractorConfiguration.AroundRegex;
            EqualRegex  = TurkishMergedExtractorConfiguration.EqualRegex;
            SuffixAfter = TurkishMergedExtractorConfiguration.SuffixAfterRegex;
            YearRegex   = TurkishDatePeriodExtractorConfiguration.YearRegex;

            SuperfluousWordMatcher = TurkishMergedExtractorConfiguration.SuperfluousWordMatcher;

            DatePeriodParser     = new BaseDatePeriodParser(new TurkishDatePeriodParserConfiguration(this));
            TimePeriodParser     = new BaseTimePeriodParser(new TurkishTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new BaseDateTimePeriodParser(new TurkishDateTimePeriodParserConfiguration(this));
            SetParser            = new BaseSetParser(new TurkishSetParserConfiguration(this));
            HolidayParser        = new BaseHolidayParser(new TurkishHolidayParserConfiguration(this));
            TimeZoneParser       = new BaseTimeZoneParser(new TurkishTimeZoneParserConfiguration(this));
        }
        public DutchMergedParserConfiguration(IDateTimeOptionsConfiguration config)
            : base(config)
        {
            BeforeRegex            = DutchMergedExtractorConfiguration.BeforeRegex;
            AfterRegex             = DutchMergedExtractorConfiguration.AfterRegex;
            SinceRegex             = DutchMergedExtractorConfiguration.SinceRegex;
            AroundRegex            = DutchMergedExtractorConfiguration.AroundRegex;
            EqualRegex             = DutchMergedExtractorConfiguration.EqualRegex;
            SuffixAfter            = DutchMergedExtractorConfiguration.SuffixAfterRegex;
            YearRegex              = DutchDatePeriodExtractorConfiguration.YearRegex;
            SuperfluousWordMatcher = DutchMergedExtractorConfiguration.SuperfluousWordMatcher;

            DatePeriodParser     = new BaseDatePeriodParser(new DutchDatePeriodParserConfiguration(this));
            TimePeriodParser     = new BaseTimePeriodParser(new DutchTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new BaseDateTimePeriodParser(new DutchDateTimePeriodParserConfiguration(this));
            SetParser            = new BaseSetParser(new DutchSetParserConfiguration(this));
            HolidayParser        = new BaseHolidayParser(new DutchHolidayParserConfiguration(this));
            TimeZoneParser       = new BaseTimeZoneParser();
        }
Example #21
0
        public SwedishMergedParserConfiguration(IDateTimeOptionsConfiguration config)
            : base(config)
        {
            BeforeRegex = SwedishMergedExtractorConfiguration.BeforeRegex;
            AfterRegex  = SwedishMergedExtractorConfiguration.AfterRegex;
            SinceRegex  = (config.Options & DateTimeOptions.ExperimentalMode) != 0 ? SwedishMergedExtractorConfiguration.SinceRegexExp :
                          SwedishMergedExtractorConfiguration.SinceRegex;
            AroundRegex = SwedishMergedExtractorConfiguration.AroundRegex;
            EqualRegex  = SwedishMergedExtractorConfiguration.EqualRegex;
            SuffixAfter = SwedishMergedExtractorConfiguration.SuffixAfterRegex;
            YearRegex   = SwedishDatePeriodExtractorConfiguration.YearRegex;

            SuperfluousWordMatcher = SwedishMergedExtractorConfiguration.SuperfluousWordMatcher;

            DatePeriodParser     = new BaseDatePeriodParser(new SwedishDatePeriodParserConfiguration(this));
            TimePeriodParser     = new BaseTimePeriodParser(new SwedishTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new BaseDateTimePeriodParser(new SwedishDateTimePeriodParserConfiguration(this));
            SetParser            = new BaseSetParser(new SwedishSetParserConfiguration(this));
            HolidayParser        = new BaseHolidayParser(new SwedishHolidayParserConfiguration(this));
            TimeZoneParser       = new BaseTimeZoneParser(new SwedishTimeZoneParserConfiguration(this));
        }
Example #22
0
        public EnglishCommonDateTimeParserConfiguration(IDateTimeOptionsConfiguration config)
            : base(config)
        {
            UtilityConfiguration = new EnglishDatetimeUtilityConfiguration();

            UnitMap                = DateTimeDefinitions.UnitMap.ToImmutableDictionary();
            UnitValueMap           = DateTimeDefinitions.UnitValueMap.ToImmutableDictionary();
            SeasonMap              = DateTimeDefinitions.SeasonMap.ToImmutableDictionary();
            SpecialYearPrefixesMap = DateTimeDefinitions.SpecialYearPrefixesMap.ToImmutableDictionary();
            CardinalMap            = DateTimeDefinitions.CardinalMap.ToImmutableDictionary();
            DayOfWeek              = DateTimeDefinitions.DayOfWeek.ToImmutableDictionary();
            MonthOfYear            = DateTimeDefinitions.MonthOfYear.ToImmutableDictionary();
            Numbers                = DateTimeDefinitions.Numbers.ToImmutableDictionary();
            DoubleNumbers          = DateTimeDefinitions.DoubleNumbers.ToImmutableDictionary();
            WrittenDecades         = DateTimeDefinitions.WrittenDecades.ToImmutableDictionary();
            SpecialDecadeCases     = DateTimeDefinitions.SpecialDecadeCases.ToImmutableDictionary();

            CardinalExtractor = Number.English.CardinalExtractor.GetInstance();
            IntegerExtractor  = Number.English.IntegerExtractor.GetInstance();
            OrdinalExtractor  = Number.English.OrdinalExtractor.GetInstance();

            TimeZoneParser          = new BaseTimeZoneParser();
            NumberParser            = new BaseNumberParser(new EnglishNumberParserConfiguration(new BaseNumberOptionsConfiguration(config.Culture)));
            DateExtractor           = new BaseDateExtractor(new EnglishDateExtractorConfiguration(this));
            TimeExtractor           = new BaseTimeExtractor(new EnglishTimeExtractorConfiguration(this));
            DateTimeExtractor       = new BaseDateTimeExtractor(new EnglishDateTimeExtractorConfiguration(this));
            DurationExtractor       = new BaseDurationExtractor(new EnglishDurationExtractorConfiguration(this));
            DatePeriodExtractor     = new BaseDatePeriodExtractor(new EnglishDatePeriodExtractorConfiguration(this));
            TimePeriodExtractor     = new BaseTimePeriodExtractor(new EnglishTimePeriodExtractorConfiguration(this));
            DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new EnglishDateTimePeriodExtractorConfiguration(this));
            DurationParser          = new BaseDurationParser(new EnglishDurationParserConfiguration(this));
            DateParser           = new BaseDateParser(new EnglishDateParserConfiguration(this));
            TimeParser           = new TimeParser(new EnglishTimeParserConfiguration(this));
            DateTimeParser       = new BaseDateTimeParser(new EnglishDateTimeParserConfiguration(this));
            DatePeriodParser     = new BaseDatePeriodParser(new EnglishDatePeriodParserConfiguration(this));
            TimePeriodParser     = new BaseTimePeriodParser(new EnglishTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new BaseDateTimePeriodParser(new EnglishDateTimePeriodParserConfiguration(this));
            DateTimeAltParser    = new BaseDateTimeAltParser(new EnglishDateTimeAltParserConfiguration(this));
        }
        public ItalianCommonDateTimeParserConfiguration(IOptionsConfiguration options)
            : base(options)
        {
            UtilityConfiguration = new ItalianDatetimeUtilityConfiguration();

            UnitMap = DateTimeDefinitions.UnitMap.ToImmutableDictionary();
            UnitValueMap = DateTimeDefinitions.UnitValueMap.ToImmutableDictionary();
            SeasonMap = DateTimeDefinitions.SeasonMap.ToImmutableDictionary();
            SpecialYearPrefixesMap = DateTimeDefinitions.SpecialYearPrefixesMap.ToImmutableDictionary();
            CardinalMap = DateTimeDefinitions.CardinalMap.ToImmutableDictionary();
            DayOfWeek = DateTimeDefinitions.DayOfWeek.ToImmutableDictionary();
            MonthOfYear = DateTimeDefinitions.MonthOfYear.ToImmutableDictionary();
            Numbers = DateTimeDefinitions.Numbers.ToImmutableDictionary();
            DoubleNumbers = DateTimeDefinitions.DoubleNumbers.ToImmutableDictionary();
            WrittenDecades = DateTimeDefinitions.WrittenDecades.ToImmutableDictionary();
            SpecialDecadeCases = DateTimeDefinitions.SpecialDecadeCases.ToImmutableDictionary();

            CardinalExtractor = Number.Italian.CardinalExtractor.GetInstance();
            IntegerExtractor = Number.Italian.IntegerExtractor.GetInstance();
            OrdinalExtractor = Number.Italian.OrdinalExtractor.GetInstance();

            NumberParser = new BaseNumberParser(new ItalianNumberParserConfiguration());
            DateExtractor = new BaseDateExtractor(new ItalianDateExtractorConfiguration(this));
            TimeExtractor = new BaseTimeExtractor(new ItalianTimeExtractorConfiguration(this));
            DateTimeExtractor = new BaseDateTimeExtractor(new ItalianDateTimeExtractorConfiguration(this));
            DurationExtractor = new BaseDurationExtractor(new ItalianDurationExtractorConfiguration(this));
            DatePeriodExtractor = new BaseDatePeriodExtractor(new ItalianDatePeriodExtractorConfiguration(this));
            TimePeriodExtractor = new BaseTimePeriodExtractor(new ItalianTimePeriodExtractorConfiguration(this));
            DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new ItalianDateTimePeriodExtractorConfiguration(this));
            DateParser = new BaseDateParser(new ItalianDateParserConfiguration(this));
            TimeParser = new BaseTimeParser(new ItalianTimeParserConfiguration(this));
            DateTimeParser = new BaseDateTimeParser(new ItalianDateTimeParserConfiguration(this));
            DurationParser = new BaseDurationParser(new ItalianDurationParserConfiguration(this));
            DatePeriodParser = new BaseDatePeriodParser(new ItalianDatePeriodParserConfiguration(this));
            TimePeriodParser = new BaseTimePeriodParser(new ItalianTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new BaseDateTimePeriodParser(new ItalianDateTimePeriodParserConfiguration(this));
            DateTimeAltParser = new BaseDateTimeAltParser(new ItalianDateTimeAltParserConfiguration(this));
        }
        public FrenchCommonDateTimeParserConfiguration(DateTimeOptions options) : base(options)
        {
            UtilityConfiguration = new FrenchDatetimeUtilityConfiguration();

            UnitMap            = DateTimeDefinitions.UnitMap.ToImmutableDictionary();
            UnitValueMap       = DateTimeDefinitions.UnitValueMap.ToImmutableDictionary();
            SeasonMap          = DateTimeDefinitions.SeasonMap.ToImmutableDictionary();
            CardinalMap        = DateTimeDefinitions.CardinalMap.ToImmutableDictionary();
            DayOfWeek          = DateTimeDefinitions.DayOfWeek.ToImmutableDictionary();
            MonthOfYear        = DateTimeDefinitions.MonthOfYear.ToImmutableDictionary();
            Numbers            = DateTimeDefinitions.Numbers.ToImmutableDictionary();
            DoubleNumbers      = DateTimeDefinitions.DoubleNumbers.ToImmutableDictionary();
            WrittenDecades     = DateTimeDefinitions.WrittenDecades.ToImmutableDictionary();
            SpecialDecadeCases = DateTimeDefinitions.SpecialDecadeCases.ToImmutableDictionary();

            CardinalExtractor = new CardinalExtractor();
            IntegerExtractor  = new IntegerExtractor();
            OrdinalExtractor  = new OrdinalExtractor();

            NumberParser            = new BaseNumberParser(new FrenchNumberParserConfiguration());
            DateExtractor           = new BaseDateExtractor(new FrenchDateExtractorConfiguration());
            TimeExtractor           = new BaseTimeExtractor(new FrenchTimeExtractorConfiguration());
            DateTimeExtractor       = new BaseDateTimeExtractor(new FrenchDateTimeExtractorConfiguration());
            DurationExtractor       = new BaseDurationExtractor(new FrenchDurationExtractorConfiguration());
            DatePeriodExtractor     = new BaseDatePeriodExtractor(new FrenchDatePeriodExtractorConfiguration());
            TimePeriodExtractor     = new BaseTimePeriodExtractor(new FrenchTimePeriodExtractorConfiguration());
            DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new FrenchDateTimePeriodExtractorConfiguration());
            // DurationParser should be assigned first, as DateParser would reference the DurationParser
            DurationParser       = new BaseDurationParser(new FrenchDurationParserConfiguration(this));
            DateParser           = new BaseDateParser(new FrenchDateParserConfiguration(this));
            TimeParser           = new BaseTimeParser(new FrenchTimeParserConfiguration(this));
            DateTimeParser       = new BaseDateTimeParser(new FrenchDateTimeParserConfiguration(this));
            DatePeriodParser     = new BaseDatePeriodParser(new FrenchDatePeriodParserConfiguration(this));
            TimePeriodParser     = new BaseTimePeriodParser(new FrenchTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new BaseDateTimePeriodParser(new FrenchDateTimePeriodParserConfiguration(this));
            DateTimeAltParser    = new BaseDateTimeAltParser(new FrenchDateTimeAltParserConfiguration(this));
        }