/// <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()); }
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; }
public PatternExtractorVisitor() { matcher = new TokenMatcher(); // Support UTC DateTimes matcher.RegisterTransformer <ToDateTimeUtcTransformer>(); Embedded.Patterns.Domains.ForEach((name, pattern) => { matcher.AddPattern(pattern, name); }); }
public void RegisterPatternTransformer <T>() where T : ITokenTransformer { matcher.RegisterTransformer <T>(); }