Exemplo n.º 1
0
        public GermanDateParserConfiguration(ICommonDateTimeParserConfiguration config)
            : base(config)
        {
            DateTokenPrefix   = DateTimeDefinitions.DateTokenPrefix;
            IntegerExtractor  = config.IntegerExtractor;
            OrdinalExtractor  = config.OrdinalExtractor;
            CardinalExtractor = config.CardinalExtractor;
            NumberParser      = config.NumberParser;
            DurationExtractor = config.DurationExtractor;
            DateExtractor     = config.DateExtractor;
            DurationParser    = config.DurationParser;
            HolidayParser     = new BaseHolidayParser(new GermanHolidayParserConfiguration(this));

            DateRegexes              = new GermanDateExtractorConfiguration(this).DateRegexList;
            OnRegex                  = GermanDateExtractorConfiguration.OnRegex;
            SpecialDayRegex          = GermanDateExtractorConfiguration.SpecialDayRegex;
            SpecialDayWithNumRegex   = GermanDateExtractorConfiguration.SpecialDayWithNumRegex;
            NextRegex                = GermanDateExtractorConfiguration.NextDateRegex;
            ThisRegex                = GermanDateExtractorConfiguration.ThisRegex;
            LastRegex                = GermanDateExtractorConfiguration.LastDateRegex;
            UnitRegex                = GermanDateExtractorConfiguration.DateUnitRegex;
            WeekDayRegex             = GermanDateExtractorConfiguration.WeekDayRegex;
            MonthRegex               = GermanDateExtractorConfiguration.MonthRegex;
            WeekDayOfMonthRegex      = GermanDateExtractorConfiguration.WeekDayOfMonthRegex;
            ForTheRegex              = GermanDateExtractorConfiguration.ForTheRegex;
            WeekDayAndDayOfMothRegex = GermanDateExtractorConfiguration.WeekDayAndDayOfMothRegex;
            WeekDayAndDayRegex       = GermanDateExtractorConfiguration.WeekDayAndDayRegex;
            RelativeMonthRegex       = GermanDateExtractorConfiguration.RelativeMonthRegex;
            StrictRelativeRegex      = GermanDateExtractorConfiguration.StrictRelativeRegex;
            YearSuffix               = GermanDateExtractorConfiguration.YearSuffix;
            BeforeAfterRegex         = GermanDateExtractorConfiguration.BeforeAfterRegex;
            RelativeWeekDayRegex     = GermanDateExtractorConfiguration.RelativeWeekDayRegex;
            RelativeDayRegex         = new Regex(DateTimeDefinitions.RelativeDayRegex, RegexOptions.Singleline);
            NextPrefixRegex          = new Regex(DateTimeDefinitions.NextPrefixRegex, RegexOptions.Singleline);
            AfterNextPrefixRegex     = new Regex(DateTimeDefinitions.AfterNextPrefixRegex, RegexOptions.Singleline);
            PreviousPrefixRegex      = new Regex(DateTimeDefinitions.PreviousPrefixRegex, RegexOptions.Singleline);
            UpcomingPrefixRegex      = new Regex(DateTimeDefinitions.UpcomingPrefixRegex, RegexOptions.Singleline);
            PastPrefixRegex          = new Regex(DateTimeDefinitions.PastPrefixRegex, RegexOptions.Singleline);

            DayOfMonth           = config.DayOfMonth;
            DayOfWeek            = config.DayOfWeek;
            MonthOfYear          = config.MonthOfYear;
            CardinalMap          = config.CardinalMap;
            UnitMap              = config.UnitMap;
            UtilityConfiguration = config.UtilityConfiguration;
            SameDayTerms         = DateTimeDefinitions.SameDayTerms.ToImmutableList();
            PlusOneDayTerms      = DateTimeDefinitions.PlusOneDayTerms.ToImmutableList();
            PlusTwoDayTerms      = DateTimeDefinitions.PlusTwoDayTerms.ToImmutableList();
            MinusOneDayTerms     = DateTimeDefinitions.MinusOneDayTerms.ToImmutableList();
            MinusTwoDayTerms     = DateTimeDefinitions.MinusTwoDayTerms.ToImmutableList();
        }
Exemplo n.º 2
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();
 }
Exemplo n.º 3
0
 public FrenchMergedParserConfiguration(IOptionsConfiguration config)
     : base(config)
 {
     BeforeRegex            = FrenchMergedExtractorConfiguration.BeforeRegex;
     AfterRegex             = FrenchMergedExtractorConfiguration.AfterRegex;
     SinceRegex             = FrenchMergedExtractorConfiguration.SinceRegex;
     AroundRegex            = FrenchMergedExtractorConfiguration.AroundRegex;
     SuffixAfter            = FrenchMergedExtractorConfiguration.SuffixAfterRegex;
     YearRegex              = FrenchDatePeriodExtractorConfiguration.YearRegex;
     SuperfluousWordMatcher = FrenchMergedExtractorConfiguration.SuperfluousWordMatcher;
     SetParser              = new BaseSetParser(new FrenchSetParserConfiguration(this));
     HolidayParser          = new BaseHolidayParser(new FrenchHolidayParserConfiguration(this));
     TimeZoneParser         = new DummyTimeZoneParser();
 }
        public PortugueseMergedParserConfiguration(DateTimeOptions options) : base(options)
        {
            BeforeRegex    = PortugueseMergedExtractorConfiguration.BeforeRegex;
            AfterRegex     = PortugueseMergedExtractorConfiguration.AfterRegex;
            SinceRegex     = PortugueseMergedExtractorConfiguration.SinceRegex;
            YearAfterRegex = PortugueseMergedExtractorConfiguration.YearAfterRegex;
            YearRegex      = PortugueseDatePeriodExtractorConfiguration.YearRegex;

            DatePeriodParser     = new BaseDatePeriodParser(new PortugueseDatePeriodParserConfiguration(this));
            TimePeriodParser     = new BaseTimePeriodParser(new PortugueseTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new DateTimePeriodParser(new PortugueseDateTimePeriodParserConfiguration(this));
            GetParser            = new BaseSetParser(new PortugueseSetParserConfiguration(this));
            HolidayParser        = new BaseHolidayParser(new PortugueseHolidayParserConfiguration());
        }
Exemplo n.º 5
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();
 }
Exemplo n.º 6
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();
 }
        public SpanishMergedParserConfiguration(IOptionsConfiguration config) : base(config)
        {
            BeforeRegex            = SpanishMergedExtractorConfiguration.BeforeRegex;
            AfterRegex             = SpanishMergedExtractorConfiguration.AfterRegex;
            SinceRegex             = SpanishMergedExtractorConfiguration.SinceRegex;
            YearAfterRegex         = SpanishMergedExtractorConfiguration.YearAfterRegex;
            YearRegex              = SpanishDatePeriodExtractorConfiguration.YearRegex;
            SuperfluousWordMatcher = SpanishMergedExtractorConfiguration.SuperfluousWordMatcher;

            DatePeriodParser     = new BaseDatePeriodParser(new SpanishDatePeriodParserConfiguration(this));
            TimePeriodParser     = new BaseTimePeriodParser(new SpanishTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new DateTimePeriodParser(new SpanishDateTimePeriodParserConfiguration(this));
            SetParser            = new BaseSetParser(new SpanishSetParserConfiguration(this));
            HolidayParser        = new BaseHolidayParser(new SpanishHolidayParserConfiguration(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();
 }
Exemplo n.º 9
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 PortugueseMergedParserConfiguration(IOptionsConfiguration config) : base(config)
        {
            BeforeRegex            = PortugueseMergedExtractorConfiguration.BeforeRegex;
            AfterRegex             = PortugueseMergedExtractorConfiguration.AfterRegex;
            SinceRegex             = PortugueseMergedExtractorConfiguration.SinceRegex;
            AroundRegex            = PortugueseMergedExtractorConfiguration.AroundRegex;
            DateAfter              = PortugueseMergedExtractorConfiguration.DateAfterRegex;
            YearRegex              = PortugueseDatePeriodExtractorConfiguration.YearRegex;
            SuperfluousWordMatcher = PortugueseMergedExtractorConfiguration.SuperfluousWordMatcher;

            DatePeriodParser     = new BaseDatePeriodParser(new PortugueseDatePeriodParserConfiguration(this));
            TimePeriodParser     = new BaseTimePeriodParser(new PortugueseTimePeriodParserConfiguration(this));
            DateTimePeriodParser = new DateTimePeriodParser(new PortugueseDateTimePeriodParserConfiguration(this));
            SetParser            = new BaseSetParser(new PortugueseSetParserConfiguration(this));
            HolidayParser        = new BaseHolidayParser(new PortugueseHolidayParserConfiguration(this));
            TimeZoneParser       = new BaseTimeZoneParser();
        }
        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();
        }
Exemplo n.º 12
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));
        }
Exemplo n.º 13
0
 public TestHolidayParser()
 {
     refrenceDay = new DateObject(2016, 11, 7);
     parser      = new BaseHolidayParser(new EnglishHolidayParserConfiguration());
     extractor   = new BaseHolidayExtractor(new EnglishHolidayExtractorConfiguration());
 }