Esempio n. 1
0
        /// <summary>
        /// Creates a new instance of the <see cref="WhoisParser"/> class.
        /// </summary>
        public WhoisParser()
        {
            matcher      = new TokenMatcher();
            reader       = new ResourceReader();
            statusParser = new WhoisStatusParser();
            FixUps       = new List <IFixup>();

            // Register default transformers
            matcher.RegisterTransformer <CleanDomainStatusTransformer>();
            matcher.RegisterTransformer <ToHostNameTransformer>();

            // Register default FixUps
            FixUps.Add(new MultipleContactFixup());
            FixUps.Add(new WhoisIsocOrgIlFixup());
        }
Esempio n. 2
0
        private TokenMatcher CreateIanaTemplate()
        {
            var matcher = new TokenMatcher();
            matcher.RegisterTransformer<CleanDomainStatusTransformer>();
            matcher.RegisterTransformer<ToHostNameTransformer>();

            var resourceNames = resourceReader.GetNames("whois.iana.org");

            foreach (var resourceName in resourceNames)
            {
                var content = resourceReader.GetContent(resourceName);
            
                matcher.RegisterTemplate(content);
            }
            
            return matcher;
        }
Esempio n. 3
0
        public PatternExtractorVisitor()
        {
            matcher = new TokenMatcher();

            // Support UTC DateTimes
            matcher.RegisterTransformer <ToDateTimeUtcTransformer>();

            Embedded.Patterns.Domains.ForEach((name, pattern) =>
            {
                matcher.AddPattern(pattern, name);
            });
        }
Esempio n. 4
0
 public void RegisterPatternTransformer <T>() where T : ITokenTransformer
 {
     matcher.RegisterTransformer <T>();
 }