Ejemplo n.º 1
0
 public EnglishTimeZoneExtractorConfiguration(DateTimeOptions options = DateTimeOptions.None) : base(options)
 {
     if ((options & DateTimeOptions.EnablePreview) != 0)
     {
         CityMatcher.Init(TimeZoneDefinitions.MajorLocations.Select(o => FormatUtility.RemoveDiacritics(o.ToLowerInvariant())));
     }
 }
Ejemplo n.º 2
0
        public List <ExtractResult> Extract(string text, DateObject reference)
        {
            var normalizedText = FormatUtility.RemoveDiacritics(text);
            var tokens         = new List <Token>();

            tokens.AddRange(TimeZoneMatch(normalizedText));
            tokens.AddRange(CityTimeMatch(normalizedText));
            return(Token.MergeAllTokens(tokens, text, ExtractorName));
        }