-
Notifications
You must be signed in to change notification settings - Fork 0
/
BasicExtracName.cs
30 lines (25 loc) · 1.28 KB
/
BasicExtracName.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
using System;
using System.Linq;
namespace Polar.NameExplorer.Examples
{
public class BasicExtracName
{
public static void Run()
{
Console.WriteLine("\nBasic Extract Name:");
Analytics analytics = new Analytics();
ResultNames resultNames = analytics.ExtractNames("My name is Mary Johnson, I'm from London, England ex-Europe.");
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}");
//Position:
Console.WriteLine($"Begin: {parseName.Begin}");//"Begin char position of name"
Console.WriteLine($"End: {parseName.End }");//"End char position of name"
}
}
}