Example #1
0
 public PortugueseMergedExtractorConfiguration(DateTimeOptions options) : base(options)
 {
     DateExtractor           = new BaseDateExtractor(new PortugueseDateExtractorConfiguration());
     TimeExtractor           = new BaseTimeExtractor(new PortugueseTimeExtractorConfiguration(options));
     DateTimeExtractor       = new BaseDateTimeExtractor(new PortugueseDateTimeExtractorConfiguration(options));
     DatePeriodExtractor     = new BaseDatePeriodExtractor(new PortugueseDatePeriodExtractorConfiguration());
     TimePeriodExtractor     = new BaseTimePeriodExtractor(new PortugueseTimePeriodExtractorConfiguration());
     DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new PortugueseDateTimePeriodExtractorConfiguration());
     DurationExtractor       = new BaseDurationExtractor(new PortugueseDurationExtractorConfiguration());
     SetExtractor            = new BaseSetExtractor(new PortugueseSetExtractorConfiguration());
     HolidayExtractor        = new BaseHolidayExtractor(new PortugueseHolidayExtractorConfiguration());
     IntegerExtractor        = new Number.Portuguese.IntegerExtractor();
     DateTimeAltExtractor    = new BaseDateTimeAltExtractor(new PortugueseDateTimeAltExtractorConfiguration());
 }
 public EnglishMergedExtractorConfiguration(DateTimeOptions options)
 {
     Options                 = options;
     DateExtractor           = new BaseDateExtractor(new EnglishDateExtractorConfiguration());
     TimeExtractor           = new BaseTimeExtractor(new EnglishTimeExtractorConfiguration());
     DateTimeExtractor       = new BaseDateTimeExtractor(new EnglishDateTimeExtractorConfiguration());
     DatePeriodExtractor     = new BaseDatePeriodExtractor(new EnglishDatePeriodExtractorConfiguration());
     TimePeriodExtractor     = new BaseTimePeriodExtractor(new EnglishTimePeriodExtractorConfiguration());
     DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new EnglishDateTimePeriodExtractorConfiguration());
     DurationExtractor       = new BaseDurationExtractor(new EnglishDurationExtractorConfiguration());
     SetExtractor            = new BaseSetExtractor(new EnglishSetExtractorConfiguration());
     HolidayExtractor        = new BaseHolidayExtractor(new EnglishHolidayExtractorConfiguration());
     IntegerExtractor        = Number.English.IntegerExtractor.GetInstance();
 }
Example #3
0
        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(new HindiTimeZoneParserConfiguration(this));

            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 #4
0
 public GermanMergedExtractorConfiguration(DateTimeOptions options) : base(options)
 {
     DateExtractor           = new BaseDateExtractor(new GermanDateExtractorConfiguration());
     TimeExtractor           = new BaseTimeExtractor(new GermanTimeExtractorConfiguration(options));
     DateTimeExtractor       = new BaseDateTimeExtractor(new GermanDateTimeExtractorConfiguration(options));
     DatePeriodExtractor     = new BaseDatePeriodExtractor(new GermanDatePeriodExtractorConfiguration());
     TimePeriodExtractor     = new BaseTimePeriodExtractor(new GermanTimePeriodExtractorConfiguration());
     DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new GermanDateTimePeriodExtractorConfiguration());
     DurationExtractor       = new BaseDurationExtractor(new GermanDurationExtractorConfiguration());
     SetExtractor            = new BaseSetExtractor(new GermanSetExtractorConfiguration());
     HolidayExtractor        = new BaseHolidayExtractor(new GermanHolidayExtractorConfiguration());
     IntegerExtractor        = Number.German.IntegerExtractor.GetInstance();
     DateTimeAltExtractor    = new BaseDateTimeAltExtractor(new GermanDateTimeAltExtractorConfiguration());
 }
        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 PortugueseDateTimePeriodExtractorConfiguration(IDateTimeOptionsConfiguration config)
            : base(config)
        {
            TokenBeforeDate = DateTimeDefinitions.TokenBeforeDate;

            CardinalExtractor = Number.Portuguese.CardinalExtractor.GetInstance();

            SingleDateExtractor     = new BaseDateExtractor(new PortugueseDateExtractorConfiguration(this));
            SingleTimeExtractor     = new BaseTimeExtractor(new PortugueseTimeExtractorConfiguration(this));
            SingleDateTimeExtractor = new BaseDateTimeExtractor(new PortugueseDateTimeExtractorConfiguration(this));
            DurationExtractor       = new BaseDurationExtractor(new PortugueseDurationExtractorConfiguration(this));
            TimePeriodExtractor     = new BaseTimePeriodExtractor(new PortugueseTimePeriodExtractorConfiguration(this));
            TimeZoneExtractor       = new BaseTimeZoneExtractor(new PortugueseTimeZoneExtractorConfiguration(this));
        }
 public SpanishMergedExtractorConfiguration(DateTimeOptions options) : base(options)
 {
     DateExtractor           = new BaseDateExtractor(new SpanishDateExtractorConfiguration());
     TimeExtractor           = new BaseTimeExtractor(new SpanishTimeExtractorConfiguration(options));
     DateTimeExtractor       = new BaseDateTimeExtractor(new SpanishDateTimeExtractorConfiguration(options));
     DatePeriodExtractor     = new BaseDatePeriodExtractor(new SpanishDatePeriodExtractorConfiguration());
     TimePeriodExtractor     = new BaseTimePeriodExtractor(new SpanishTimePeriodExtractorConfiguration());
     DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new SpanishDateTimePeriodExtractorConfiguration());
     DurationExtractor       = new BaseDurationExtractor(new SpanishDurationExtractorConfiguration());
     SetExtractor            = new BaseSetExtractor(new SpanishSetExtractorConfiguration());
     DateTimeAltExtractor    = new BaseDateTimeAltExtractor(new SpanishDateTimeAltExtractorConfiguration());
     HolidayExtractor        = new BaseHolidayExtractor(new SpanishHolidayExtractorConfiguration());
     IntegerExtractor        = new Number.Spanish.IntegerExtractor();
 }
Example #8
0
 public ItalianMergedExtractorConfiguration(DateTimeOptions options) : base(options)
 {
     DateExtractor           = new BaseDateExtractor(new ItalianDateExtractorConfiguration());
     TimeExtractor           = new BaseTimeExtractor(new ItalianTimeExtractorConfiguration(options));
     DateTimeExtractor       = new BaseDateTimeExtractor(new ItalianDateTimeExtractorConfiguration(options));
     DatePeriodExtractor     = new BaseDatePeriodExtractor(new ItalianDatePeriodExtractorConfiguration());
     TimePeriodExtractor     = new BaseTimePeriodExtractor(new ItalianTimePeriodExtractorConfiguration());
     DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new ItalianDateTimePeriodExtractorConfiguration());
     DurationExtractor       = new BaseDurationExtractor(new ItalianDurationExtractorConfiguration());
     SetExtractor            = new BaseSetExtractor(new ItalianSetExtractorConfiguration());
     HolidayExtractor        = new BaseHolidayExtractor(new ItalianHolidayExtractorConfiguration());
     DateTimeAltExtractor    = new BaseDateTimeAltExtractor(new ItalianDateTimeAltExtractorConfiguration());
     IntegerExtractor        = new Number.Italian.IntegerExtractor();
 }
        public PortugueseCommonDateTimeParserConfiguration(IDateTimeOptionsConfiguration config)
            : base(config)
        {
            UtilityConfiguration = new PortugueseDatetimeUtilityConfiguration();

            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.Portuguese.CardinalExtractor.GetInstance(numConfig);
            IntegerExtractor  = Number.Portuguese.IntegerExtractor.GetInstance(numConfig);
            OrdinalExtractor  = Number.Portuguese.OrdinalExtractor.GetInstance(numConfig);

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

            // Do not change order. The order of initialization can lead to side-effects
            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));

            DurationParser       = new BaseDurationParser(new PortugueseDurationParserConfiguration(this));
            DateParser           = new BaseDateParser(new PortugueseDateParserConfiguration(this));
            TimeParser           = new BaseTimeParser(new PortugueseTimeParserConfiguration(this));
            DateTimeParser       = new BaseDateTimeParser(new PortugueseDateTimeParserConfiguration(this));
            DatePeriodParser     = new BaseDatePeriodParser(new PortugueseDatePeriodParserConfiguration(this));
            TimePeriodParser     = new BaseTimePeriodParser(new PortugueseTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new BaseDateTimePeriodParser(new PortugueseDateTimePeriodParserConfiguration(this));
        }
Example #10
0
 public FrenchMergedExtractorConfiguration(DateTimeOptions options) : base(options)
 {
     DateExtractor           = new BaseDateExtractor(new FrenchDateExtractorConfiguration(this));
     TimeExtractor           = new BaseTimeExtractor(new FrenchTimeExtractorConfiguration(this));
     DateTimeExtractor       = new BaseDateTimeExtractor(new FrenchDateTimeExtractorConfiguration(this));
     DatePeriodExtractor     = new BaseDatePeriodExtractor(new FrenchDatePeriodExtractorConfiguration(this));
     TimePeriodExtractor     = new BaseTimePeriodExtractor(new FrenchTimePeriodExtractorConfiguration(this));
     DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new FrenchDateTimePeriodExtractorConfiguration(this));
     DurationExtractor       = new BaseDurationExtractor(new FrenchDurationExtractorConfiguration(this));
     SetExtractor            = new BaseSetExtractor(new FrenchSetExtractorConfiguration(this));
     HolidayExtractor        = new BaseHolidayExtractor(new FrenchHolidayExtractorConfiguration(this));
     TimeZoneExtractor       = new BaseTimeZoneExtractor(new FrenchTimeZoneExtractorConfiguration(this));
     DateTimeAltExtractor    = new BaseDateTimeAltExtractor(new FrenchDateTimeAltExtractorConfiguration(this));
     IntegerExtractor        = Number.French.IntegerExtractor.GetInstance();
 }
Example #11
0
 public ItalianMergedExtractorConfiguration(IOptionsConfiguration config) : base(config)
 {
     DateExtractor           = new BaseDateExtractor(new ItalianDateExtractorConfiguration(this));
     TimeExtractor           = new BaseTimeExtractor(new ItalianTimeExtractorConfiguration(this));
     DateTimeExtractor       = new BaseDateTimeExtractor(new ItalianDateTimeExtractorConfiguration(this));
     DatePeriodExtractor     = new BaseDatePeriodExtractor(new ItalianDatePeriodExtractorConfiguration(this));
     TimePeriodExtractor     = new BaseTimePeriodExtractor(new ItalianTimePeriodExtractorConfiguration(this));
     DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new ItalianDateTimePeriodExtractorConfiguration(this));
     DurationExtractor       = new BaseDurationExtractor(new ItalianDurationExtractorConfiguration(this));
     SetExtractor            = new BaseSetExtractor(new ItalianSetExtractorConfiguration(this));
     HolidayExtractor        = new BaseHolidayExtractor(new ItalianHolidayExtractorConfiguration(this));
     TimeZoneExtractor       = new BaseTimeZoneExtractor(new ItalianTimeZoneExtractorConfiguration(this));
     DateTimeAltExtractor    = new BaseDateTimeAltExtractor(new ItalianDateTimeAltExtractorConfiguration(this));
     IntegerExtractor        = Number.Italian.IntegerExtractor.GetInstance();
 }
Example #12
0
 public SpanishMergedExtractorConfiguration(IDateTimeOptionsConfiguration config)
     : base(config)
 {
     DateExtractor           = new BaseDateExtractor(new SpanishDateExtractorConfiguration(this));
     TimeExtractor           = new BaseTimeExtractor(new SpanishTimeExtractorConfiguration(this));
     DateTimeExtractor       = new BaseDateTimeExtractor(new SpanishDateTimeExtractorConfiguration(this));
     DatePeriodExtractor     = new BaseDatePeriodExtractor(new SpanishDatePeriodExtractorConfiguration(this));
     TimePeriodExtractor     = new BaseTimePeriodExtractor(new SpanishTimePeriodExtractorConfiguration(this));
     DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new SpanishDateTimePeriodExtractorConfiguration(this));
     DurationExtractor       = new BaseDurationExtractor(new SpanishDurationExtractorConfiguration(this));
     SetExtractor            = new BaseSetExtractor(new SpanishSetExtractorConfiguration(this));
     DateTimeAltExtractor    = new BaseDateTimeAltExtractor(new SpanishDateTimeAltExtractorConfiguration(this));
     HolidayExtractor        = new BaseHolidayExtractor(new SpanishHolidayExtractorConfiguration(this));
     TimeZoneExtractor       = new BaseTimeZoneExtractor(new SpanishTimeZoneExtractorConfiguration(this));
     IntegerExtractor        = Number.Spanish.IntegerExtractor.GetInstance();
 }
 public PortugueseMergedExtractorConfiguration(IDateTimeOptionsConfiguration config)
     : base(config)
 {
     DateExtractor           = new BaseDateExtractor(new PortugueseDateExtractorConfiguration(this));
     TimeExtractor           = new BaseTimeExtractor(new PortugueseTimeExtractorConfiguration(this));
     DateTimeExtractor       = new BaseDateTimeExtractor(new PortugueseDateTimeExtractorConfiguration(this));
     DatePeriodExtractor     = new BaseDatePeriodExtractor(new PortugueseDatePeriodExtractorConfiguration(this));
     TimePeriodExtractor     = new BaseTimePeriodExtractor(new PortugueseTimePeriodExtractorConfiguration(this));
     DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new PortugueseDateTimePeriodExtractorConfiguration(this));
     DurationExtractor       = new BaseDurationExtractor(new PortugueseDurationExtractorConfiguration(this));
     SetExtractor            = new BaseSetExtractor(new PortugueseSetExtractorConfiguration(this));
     HolidayExtractor        = new BaseHolidayExtractor(new PortugueseHolidayExtractorConfiguration(this));
     TimeZoneExtractor       = new BaseTimeZoneExtractor(new PortugueseTimeZoneExtractorConfiguration(this));
     IntegerExtractor        = Number.Portuguese.IntegerExtractor.GetInstance();
     DateTimeAltExtractor    = new BaseDateTimeAltExtractor(new PortugueseDateTimeAltExtractorConfiguration(this));
 }
Example #14
0
        public GermanMergedExtractorConfiguration(DateTimeOptions options) : base(options)
        {
            DateExtractor           = new BaseDateExtractor(new GermanDateExtractorConfiguration(this));
            TimeExtractor           = new BaseTimeExtractor(new GermanTimeExtractorConfiguration(this));
            DateTimeExtractor       = new BaseDateTimeExtractor(new GermanDateTimeExtractorConfiguration(this));
            DatePeriodExtractor     = new BaseDatePeriodExtractor(new GermanDatePeriodExtractorConfiguration(this));
            TimePeriodExtractor     = new BaseTimePeriodExtractor(new GermanTimePeriodExtractorConfiguration(this));
            DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new GermanDateTimePeriodExtractorConfiguration(this));
            DurationExtractor       = new BaseDurationExtractor(new GermanDurationExtractorConfiguration(this));
            SetExtractor            = new BaseSetExtractor(new GermanSetExtractorConfiguration(this));
            HolidayExtractor        = new BaseHolidayExtractor(new GermanHolidayExtractorConfiguration(this));
            TimeZoneExtractor       = new BaseTimeZoneExtractor(new GermanTimeZoneExtractorConfiguration(this));
            IntegerExtractor        = Number.German.IntegerExtractor.GetInstance();
            DateTimeAltExtractor    = new BaseDateTimeAltExtractor(new GermanDateTimeAltExtractorConfiguration(this));

            AmbiguityFiltersDict = DefinitionLoader.LoadAmbiguityFilters(DateTimeDefinitions.AmbiguityFiltersDict);
        }
Example #15
0
        public FrenchMergedExtractorConfiguration(IDateTimeOptionsConfiguration config)
            : base(config)
        {
            DateExtractor           = new BaseDateExtractor(new FrenchDateExtractorConfiguration(this));
            TimeExtractor           = new BaseTimeExtractor(new FrenchTimeExtractorConfiguration(this));
            DateTimeExtractor       = new BaseDateTimeExtractor(new FrenchDateTimeExtractorConfiguration(this));
            DatePeriodExtractor     = new BaseDatePeriodExtractor(new FrenchDatePeriodExtractorConfiguration(this));
            TimePeriodExtractor     = new BaseTimePeriodExtractor(new FrenchTimePeriodExtractorConfiguration(this));
            DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new FrenchDateTimePeriodExtractorConfiguration(this));
            DurationExtractor       = new BaseDurationExtractor(new FrenchDurationExtractorConfiguration(this));
            SetExtractor            = new BaseSetExtractor(new FrenchSetExtractorConfiguration(this));
            HolidayExtractor        = new BaseHolidayExtractor(new FrenchHolidayExtractorConfiguration(this));
            TimeZoneExtractor       = new BaseTimeZoneExtractor(new FrenchTimeZoneExtractorConfiguration(this));
            DateTimeAltExtractor    = new BaseDateTimeAltExtractor(new FrenchDateTimeAltExtractorConfiguration(this));
            IntegerExtractor        = Number.French.IntegerExtractor.GetInstance();

            AmbiguityFiltersDict = DefinitionLoader.LoadAmbiguityFilters(DateTimeDefinitions.AmbiguityFiltersDict);
        }
        public ThaiMergedExtractorConfiguration(DateTimeOptions options)
        {
            Options                 = options | DateTimeOptions.Format24;
            DateExtractor           = new BaseDateExtractor(new ThaiDateExtractorConfiguration());
            TimeExtractor           = new BaseTimeExtractor(new ThaiTimeExtractorConfiguration(options));
            DateTimeExtractor       = new BaseDateTimeExtractor(new ThaiDateTimeExtractorConfiguration(options));
            DatePeriodExtractor     = new BaseDatePeriodExtractor(new ThaiDatePeriodExtractorConfiguration());
            TimePeriodExtractor     = new BaseTimePeriodExtractor(new ThaiTimePeriodExtractorConfiguration(options));
            DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new ThaiDateTimePeriodExtractorConfiguration(options));
            DurationExtractor       = new BaseDurationExtractor(new ThaiDurationExtractorConfiguration(options));
            SetExtractor            = null;
            HolidayExtractor        = null;
            TimeZoneExtractor       = null;
            DateTimeAltExtractor    = null;
            IntegerExtractor        = Number.Thai.IntegerExtractor.GetInstance();

            // if ((options & DateTimeOptions.EnablePreview) != 0)
            // {
            //     SuperfluousWordMatcher.Init(DateTimeDefinitions.SuperfluousWordList);
            // }
        }
        public EnglishMergedExtractorConfiguration(DateTimeOptions options)
        {
            Options                 = options;
            DateExtractor           = new BaseDateExtractor(new EnglishDateExtractorConfiguration());
            TimeExtractor           = new BaseTimeExtractor(new EnglishTimeExtractorConfiguration(options));
            DateTimeExtractor       = new BaseDateTimeExtractor(new EnglishDateTimeExtractorConfiguration(options));
            DatePeriodExtractor     = new BaseDatePeriodExtractor(new EnglishDatePeriodExtractorConfiguration());
            TimePeriodExtractor     = new BaseTimePeriodExtractor(new EnglishTimePeriodExtractorConfiguration(options));
            DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new EnglishDateTimePeriodExtractorConfiguration(options));
            DurationExtractor       = new BaseDurationExtractor(new EnglishDurationExtractorConfiguration(options));
            SetExtractor            = new BaseSetExtractor(new EnglishSetExtractorConfiguration());
            HolidayExtractor        = new BaseHolidayExtractor(new EnglishHolidayExtractorConfiguration());
            TimeZoneExtractor       = new BaseTimeZoneExtractor(new EnglishTimeZoneExtractorConfiguration(options));
            DateTimeAltExtractor    = new BaseDateTimeAltExtractor(new EnglishDateTimeAltExtractorConfiguration());
            IntegerExtractor        = Number.English.IntegerExtractor.GetInstance();

            if ((options & DateTimeOptions.EnablePreview) != 0)
            {
                SuperfluousWordMatcher.Init(DateTimeDefinitions.SuperfluousWordList);
            }
        }
Example #18
0
        public HindiMergedExtractorConfiguration(IDateTimeOptionsConfiguration config)
            : base(config)
        {
            DateExtractor           = new BaseDateExtractor(new HindiDateExtractorConfiguration(this));
            TimeExtractor           = new BaseTimeExtractor(new HindiTimeExtractorConfiguration(this));
            DateTimeExtractor       = new BaseDateTimeExtractor(new HindiDateTimeExtractorConfiguration(this));
            DatePeriodExtractor     = new BaseDatePeriodExtractor(new HindiDatePeriodExtractorConfiguration(this));
            TimePeriodExtractor     = new BaseTimePeriodExtractor(new HindiTimePeriodExtractorConfiguration(this));
            DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new HindiDateTimePeriodExtractorConfiguration(this));
            DurationExtractor       = new BaseDurationExtractor(new HindiDurationExtractorConfiguration(this));
            SetExtractor            = new BaseSetExtractor(new HindiSetExtractorConfiguration(this));
            HolidayExtractor        = new BaseHolidayExtractor(new HindiHolidayExtractorConfiguration(this));
            DateTimeAltExtractor    = new BaseDateTimeAltExtractor(new HindiDateTimeAltExtractorConfiguration(this));
            IntegerExtractor        = Number.Hindi.IntegerExtractor.GetInstance();

            AmbiguityFiltersDict = DefinitionLoader.LoadAmbiguityFilters(DateTimeDefinitions.AmbiguityFiltersDict);

            if ((Options & DateTimeOptions.EnablePreview) != 0)
            {
                SuperfluousWordMatcher.Init(DateTimeDefinitions.SuperfluousWordList);
            }
        }
Example #19
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 ArabicDateTimePeriodExtractorConfiguration(IDateTimeOptionsConfiguration config)
            : base(config)
        {
            TokenBeforeDate = DateTimeDefinitions.TokenBeforeDate;

            var numOptions = NumberOptions.None;

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

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

            CardinalExtractor = Number.Arabic.CardinalExtractor.GetInstance(numConfig);

            SingleDateExtractor     = new BaseDateExtractor(new ArabicDateExtractorConfiguration(this));
            SingleTimeExtractor     = new BaseTimeExtractor(new ArabicTimeExtractorConfiguration(this));
            SingleDateTimeExtractor = new BaseDateTimeExtractor(new ArabicDateTimeExtractorConfiguration(this));
            DurationExtractor       = new BaseDurationExtractor(new ArabicDurationExtractorConfiguration(this));
            TimePeriodExtractor     = new BaseTimePeriodExtractor(new ArabicTimePeriodExtractorConfiguration(this));
        }
 public SpanishCommonDateTimeParserConfiguration()
 {
     UnitMap           = InitUnitMap();
     UnitValueMap      = InitUnitValueMap();
     SeasonMap         = InitSeasonMap();
     CardinalMap       = InitCardinalMap();
     DayOfWeek         = InitDayOfWeek();
     MonthOfYear       = InitMonthOfYear();
     Numbers           = InitNumbers();
     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());
     DateParser        = new BaseDateParser(new SpanishDateParserConfiguration(this));
     TimeParser        = new BaseTimeParser(new SpanishTimeParserConfiguration(this));
     DateTimeParser    = new BaseDateTimeParser(new SpanishDateTimeParserConfiguration(this));
     DurationParser    = new BaseDurationParser(new SpanishDurationParserConfiguration(this));
 }
Example #22
0
        public SwedishMergedExtractorConfiguration(IDateTimeOptionsConfiguration config)
            : base(config)
        {
            DateExtractor           = new BaseDateExtractor(new SwedishDateExtractorConfiguration(this));
            TimeExtractor           = new BaseTimeExtractor(new SwedishTimeExtractorConfiguration(this));
            DateTimeExtractor       = new BaseDateTimeExtractor(new SwedishDateTimeExtractorConfiguration(this));
            DatePeriodExtractor     = new BaseDatePeriodExtractor(new SwedishDatePeriodExtractorConfiguration(this));
            TimePeriodExtractor     = new BaseTimePeriodExtractor(new SwedishTimePeriodExtractorConfiguration(this));
            DateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new SwedishDateTimePeriodExtractorConfiguration(this));
            DurationExtractor       = new BaseDurationExtractor(new SwedishDurationExtractorConfiguration(this));
            SetExtractor            = new BaseSetExtractor(new SwedishSetExtractorConfiguration(this));
            HolidayExtractor        = new BaseHolidayExtractor(new SwedishHolidayExtractorConfiguration(this));
            TimeZoneExtractor       = new BaseTimeZoneExtractor(new SwedishTimeZoneExtractorConfiguration(this));
            DateTimeAltExtractor    = new BaseDateTimeAltExtractor(new SwedishDateTimeAltExtractorConfiguration(this));

            var numOptions = NumberOptions.None;

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

            if ((config.Options & DateTimeOptions.ExperimentalMode) != 0)
            {
                SinceRegex = SinceRegexExp;
            }

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

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

            AmbiguityFiltersDict = DefinitionLoader.LoadAmbiguityFilters(DateTimeDefinitions.AmbiguityFiltersDict);

            if ((Options & DateTimeOptions.EnablePreview) != 0)
            {
                SuperfluousWordMatcher.Init(DateTimeDefinitions.SuperfluousWordList);
            }
        }
        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));
        }
 public TestDateTimeParser()
 {
     referenceTime = new DateObject(2016, 11, 7, 0, 0, 0);
     extractor     = new BaseDateTimeExtractor(new SpanishDateTimeExtractorConfiguration());
     parser        = new BaseDateTimeParser(new SpanishDateTimeParserConfiguration(new SpanishCommonDateTimeParserConfiguration()));
 }