-
Notifications
You must be signed in to change notification settings - Fork 0
/
BasicParseName.cs
41 lines (34 loc) · 2 KB
/
BasicParseName.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Linq;
namespace Polar.NameExplorer.Examples
{
public class BasicParseName
{
public static void Run()
{
Console.WriteLine("\nBasic Parse Name:");
Analytics analytics = new Analytics();
ResultNames resultNames = analytics.ParseName("Mary Johnson");
ParseName parseName = resultNames.ParseNames.FirstOrDefault();
Console.WriteLine($"Full Name: {parseName.FirstName + " " + parseName.LastName}");//"Mary Johnson"
Console.WriteLine($"FirstName: {parseName.FirstName}");//"Mary"
Console.WriteLine($"LastName: {parseName.LastName}");//"Johnson"
//Gender:
Console.WriteLine($"Gender: {parseName.GenderData.Gender}");//"f"
Console.WriteLine($"FemalePercent: {parseName.GenderData.FemalePercent}");
Console.WriteLine($"MalePercent: {parseName.GenderData.MalePercent}");
Console.WriteLine("\nCountry First Name:");
CountryElement countryElement = parseName.CountryData.FirstNameCountryPhrases.First().CountryElements.First();
Console.WriteLine($"Country: {countryElement.Country}");
Console.WriteLine($"Frequency: {countryElement.Frequency}");
Console.WriteLine($"Certainty: {countryElement.Certainty}");
Console.WriteLine($"Percent: {countryElement.Percent}");
Console.WriteLine("\nCountry Last Name:");
countryElement = parseName.CountryData.LastNameCountryPhrases.First().CountryElements.First();
Console.WriteLine($"Country: {countryElement.Country}");
Console.WriteLine($"Frequency: {countryElement.Frequency}");
Console.WriteLine($"Certainty: {countryElement.Certainty}");
Console.WriteLine($"Percent: {countryElement.Percent}");
}
}
}