Source/NFX/Parsing/NaturalTextGenerator.cs
/// <summary>
/// Generates a string that looks like an email
/// </summary>
Generates a string that looks like an email
Generates a string that looks like an email
public static string GenerateEMail()
    {
       var rnd = ExternalRandomGenerator.Instance.NextRandomInteger;
       string domain;
       var user = GenerateFirstName();
       if (rnd%5==0) user += "."+GenerateLastName();
       if (rnd%7==0) user += (1900+Math.Abs(rnd%115)).ToString();
       if (rnd<-1500000000)
        domain = DOMAIN_NAMES[(0x7fFFFFFF & ExternalRandomGenerator.Instance.NextRandomInteger) % DOMAIN_NAMES.Length];
       else
       {
         if (rnd%3==0 && user.Length<11)
           domain = GenerateWord()+"."+GenerateCityName()+TLD_NAMES[(0x7fFFFFFF & ExternalRandomGenerator.Instance.NextRandomInteger) % TLD_NAMES.Length];
         else
           domain = GenerateWord(8)+TLD_NAMES[(0x7fFFFFFF & ExternalRandomGenerator.Instance.NextRandomInteger) % TLD_NAMES.Length];
       }
       var rnd2 = ExternalRandomGenerator.Instance.NextRandomInteger;
       if (user.Length<5 && rnd2%17!=0) user += Math.Abs(rnd%99).ToString();
       if (rnd2<1700000000) user = user.ToLowerInvariant();
       return (user+"@"+domain.ToLowerInvariant()).Replace('\'','.').Replace(' ', '.');
    }
public static string GenerateEMail ( ) { var rnd = ExternalRandomGenerator . Instance . NextRandomInteger ; string domain ; var user = GenerateFirstName ( ) ; if ( rnd % 5 == 0 ) user += " " + GenerateLastName ( ) ; if ( rnd % 7 == 0 ) user += ( 1900 + Math . Abs ( rnd % 115 ) ) . ToString ( ) ; if ( rnd < - 1500000000 ) domain = DOMAIN_NAMES [ ( 0x7fFFFFFF & ExternalRandomGenerator . Instance . NextRandomInteger ) % DOMAIN_NAMES . Length ] ; else { if ( rnd % 3 == 0 && user . Length < 11 ) domain = GenerateWord ( ) + " " + GenerateCityName ( ) + TLD_NAMES [ ( 0x7fFFFFFF & ExternalRandomGenerator . Instance . NextRandomInteger ) % TLD_NAMES . Length ] ; else domain = GenerateWord ( 8 ) + TLD_NAMES [ ( 0x7fFFFFFF & ExternalRandomGenerator . Instance . NextRandomInteger ) % TLD_NAMES . Length ] ; } var rnd2 = ExternalRandomGenerator . Instance . NextRandomInteger ; if ( user . Length < 5 && rnd2 % 17 != 0 ) user += Math . Abs ( rnd % 99 ) . ToString ( ) ; if ( rnd2 < 1700000000 ) user = user . ToLowerInvariant ( ) ; return ( user + " " + domain . ToLowerInvariant ( ) ) . Replace ( ' \' ' , ' ' ) . Replace ( ' ' , ' ' ) ; }
Generates a string that looks like an email
Generates a string that looks like an email