Source/NFX/Parsing/NaturalTextGenerator.cs
/// <summary>
/// Generates a string that looks like a human name
/// </summary>
Generates a string that looks like a human name
Generates a string that looks like a human name
public static string GenerateFullName(bool middle = false)
    {
      var fname = GenerateFirstName();
      var lname = GenerateLastName();
      if (!middle) return fname + " " + lname;
      var rnd = ExternalRandomGenerator.Instance.NextRandomInteger;
      var mname = string.Empty;
      if (rnd>0)
      {
        if ((rnd & 1) == 0)
          mname += (char)((int)'A'+(rnd % 25));
        else
          mname = GenerateFirstName();
        return fname + " " + mname + " "+ lname;
      }
      return fname + " " + lname;
    }
public static string GenerateFullName ( bool middle = false ) { var fname = GenerateFirstName ( ) ; var lname = GenerateLastName ( ) ; if ( ! middle ) return fname + " " + lname ; var rnd = ExternalRandomGenerator . Instance . NextRandomInteger ; var mname = string . Empty ; if ( rnd > 0 ) { if ( ( rnd & 1 ) == 0 ) mname += ( char ) ( ( int ) ' ' + ( rnd % 25 ) ) ; else mname = GenerateFirstName ( ) ; return fname + " " + mname + " " + lname ; } return fname + " " + lname ; }
Generates a string that looks like a human name
Generates a string that looks like a human name
middle
bool