Source/NFX/Parsing/NaturalTextGenerator.cs
/// <summary>
/// Generates a string that resembles a human first name
/// </summary>
Generates a string that resembles a human first name
Generates a string that resembles a human first name
public static string GenerateFirstName()
    {
      var rnd = ExternalRandomGenerator.Instance.NextRandomInteger;
      if (rnd>-1500000000)
        return POPULAR_FIRST_NAMES[(0x7fFFFFFF & rnd) % POPULAR_FIRST_NAMES.Length];
      var  prefix = LAST_NAME_SUFFIXES[(0x7fFFFFFF & ExternalRandomGenerator.Instance.NextRandomInteger) % LAST_NAME_SUFFIXES.Length];
      var suffix = LAST_NAME_SUFFIXES[(0x7fFFFFFF & rnd) % LAST_NAME_SUFFIXES.Length];
      prefix = Char.ToUpperInvariant(prefix[0]) + prefix.Substring(1).ToLowerInvariant();
      return prefix + suffix;
    }
public static string GenerateFirstName ( ) { var rnd = ExternalRandomGenerator . Instance . NextRandomInteger ; if ( rnd > - 1500000000 ) return POPULAR_FIRST_NAMES [ ( 0x7fFFFFFF & rnd ) % POPULAR_FIRST_NAMES . Length ] ; var prefix = LAST_NAME_SUFFIXES [ ( 0x7fFFFFFF & ExternalRandomGenerator . Instance . NextRandomInteger ) % LAST_NAME_SUFFIXES . Length ] ; var suffix = LAST_NAME_SUFFIXES [ ( 0x7fFFFFFF & rnd ) % LAST_NAME_SUFFIXES . Length ] ; prefix = Char . ToUpperInvariant ( prefix [ 0 ] ) + prefix . Substring ( 1 ) . ToLowerInvariant ( ) ; return prefix + suffix ; }
Generates a string that resembles a human first name
Generates a string that resembles a human first name