예제 #1
0
        public static IDateTimeExtractor GetPortugueseExtractor(DateTimeExtractors extractorName)
        {
            var config = new BaseOptionsConfiguration();

            switch (extractorName)
            {
            case DateTimeExtractors.Date:
                return(new BaseDateExtractor(new PortugueseDateExtractorConfiguration(config)));

            case DateTimeExtractors.Time:
                return(new BaseTimeExtractor(new PortugueseTimeExtractorConfiguration(config)));

            case DateTimeExtractors.DatePeriod:
                return(new BaseDatePeriodExtractor(new PortugueseDatePeriodExtractorConfiguration(config)));

            case DateTimeExtractors.TimePeriod:
                return(new BaseTimePeriodExtractor(new PortugueseTimePeriodExtractorConfiguration(config)));

            case DateTimeExtractors.DateTime:
                return(new BaseDateTimeExtractor(new PortugueseDateTimeExtractorConfiguration(config)));

            case DateTimeExtractors.DateTimePeriod:
                return(new BaseDateTimePeriodExtractor(new PortugueseDateTimePeriodExtractorConfiguration(config)));

            case DateTimeExtractors.Duration:
                return(new BaseDurationExtractor(new PortugueseDurationExtractorConfiguration(config)));

            case DateTimeExtractors.Holiday:
                return(new BaseHolidayExtractor(new PortugueseHolidayExtractorConfiguration(config)));

            case DateTimeExtractors.Set:
                return(new BaseSetExtractor(new PortugueseSetExtractorConfiguration(config)));

            case DateTimeExtractors.Merged:
                return(new BaseMergedDateTimeExtractor(new PortugueseMergedExtractorConfiguration(DateTimeOptions.None)));
            }

            throw new Exception($"Extractor '{extractorName}' for Portuguese not supported");
        }
예제 #2
0
        public static IExtractor GetSpanishExtractor(DateTimeExtractors extractorName)
        {
            switch (extractorName)
            {
            case DateTimeExtractors.Date:
                return(new BaseDateExtractor(new SpanishDateExtractorConfiguration()));

            case DateTimeExtractors.Time:
                return(new BaseTimeExtractor(new SpanishTimeExtractorConfiguration()));

            case DateTimeExtractors.DatePeriod:
                return(new BaseDatePeriodExtractor(new SpanishDatePeriodExtractorConfiguration()));

            case DateTimeExtractors.TimePeriod:
                return(new BaseTimePeriodExtractor(new SpanishTimePeriodExtractorConfiguration()));

            case DateTimeExtractors.DateTime:
                return(new BaseDateTimeExtractor(new SpanishDateTimeExtractorConfiguration()));

            case DateTimeExtractors.DateTimePeriod:
                return(new BaseDateTimePeriodExtractor(new SpanishDateTimePeriodExtractorConfiguration()));

            case DateTimeExtractors.Duration:
                return(new BaseDurationExtractor(new SpanishDurationExtractorConfiguration()));

            case DateTimeExtractors.Holiday:
                return(new BaseHolidayExtractor(new SpanishHolidayExtractorConfiguration()));

            case DateTimeExtractors.Set:
                return(new BaseSetExtractor(new SpanishSetExtractorConfiguration()));

            case DateTimeExtractors.Merged:
                return(new BaseMergedExtractor(new SpanishMergedExtractorConfiguration(), DateTimeOptions.None));
            }

            throw new Exception($"Extractor '{extractorName}' for Spanish not supported");
        }