Sunday, August 21, 2011

GuessWho a sample data library

I just published by first nuget package.  It is a library for generating sample identity information.  It allows you to write code like this:

var randomName = new NameGenerator();
const int takeCount = 2;
Console.WriteLine("First {0} male names", takeCount);
foreach (var name in randomName.MaleNames().Take(takeCount))
Console.WriteLine(name);
Console.WriteLine();
Console.WriteLine("First {0} female names", takeCount);
foreach (var name in randomName.FemaleNames().Take(takeCount))
Console.WriteLine(name);
Console.WriteLine();
Console.WriteLine("First {0} all names", takeCount);
foreach (var name in randomName.Names().Take(takeCount))
Console.WriteLine(name);

Which produces this output:

First 2 male names
Steve Ashcraft
Christopher Timothy Bischoff
First 2 female names
Denise Jan Dellinger
Brigida Carpenter
First 2 all names
Ivan Brent Duffey
Christy Mildred Clark
view raw Output hosted with ❤ by GitHub

For more information I recommend you check out the project page over at github or bitbucket.

1 comment:

  1. Cool idea! Idle thought, not sure for whom it would be useful, but I've always found the "outliers" and international variations on names interesting. For testing purposes it would be cool to generate those out of the library too.... :)

    ReplyDelete