示例#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());
        }
示例#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;
        }
示例#3
0
        public PatternExtractorVisitor()
        {
            matcher = new TokenMatcher();

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

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