Skip to content

Commit 38ddf65

Browse files
committed
Updated for recent changes to PHP version
1 parent 7816702 commit 38ddf65

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
/.vs
2+
/HumanNameParser/bin
3+
/HumanNameParser/obj
4+
/HumanNameParser.Tests/bin
5+
/HumanNameParser.Tests/obj
6+
/packages

HumanNameParser.Tests/testNames.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Björn O'Malley Jr||Björn|||O'Malley|Jr
2121
B O'Malley||B|||O'Malley|
2222
William Carlos Williams||William||Carlos|Williams|
2323
C. Björn Roger O'Malley|C.|Björn||Roger|O'Malley|
24+
C. Ben O'Malley|C.|Ben|||O'Malley|
2425
B. C. O'Malley||B.||C.|O'Malley|
2526
B C O'Malley||B||C|O'Malley|
2627
B.J. Thomas||B.J.|||Thomas|

HumanNameParser.sln

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26730.12
4+
VisualStudioVersion = 15.0.27004.2008
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HumanNameParser", "HumanNameParser\HumanNameParser.csproj", "{A82EE7B7-9EAF-44C1-ADA4-D39AE7442E3F}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HumanNameParser", "HumanNameParser\HumanNameParser.csproj", "{A82EE7B7-9EAF-44C1-ADA4-D39AE7442E3F}"
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HumanNameParser.Tests", "HumanNameParser.Tests\HumanNameParser.Tests.csproj", "{FC768726-D3B5-4F3E-BB30-5BE4158B91C5}"
99
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2B2C5EC8-A9B0-4CF6-B458-82E82BB01BF8}"
11+
ProjectSection(SolutionItems) = preProject
12+
LICENSE = LICENSE
13+
EndProjectSection
14+
EndProject
1015
Global
1116
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1217
Debug|Any CPU = Debug|Any CPU

HumanNameParser/Parser.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace HumanNameParser
88
public class Parser
99
{
1010

11-
private static readonly string[] _suffixes = { "esq", "esquire", "jr", "sr", "2", "ii", "iii", "iv" };
11+
private static readonly string[] _suffixes = { "esq", "esquire", "jr", "sr", "2", "ii", "iii", "iv" , "v", "phd"};
1212
private static readonly string[] _prefixes = {"bar","ben","bin","da","dal","de la", "de", "del","der","di", "ibn","la","le","san","st","ste","van", "van der", "van den", "vel","von" };
1313

1414
const RegexOptions _options = RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Multiline;
@@ -49,10 +49,10 @@ public ParsedName Parse(string name)
4949
pname.Suffix = chopWithRegex(_suffixRegex, 1);
5050
_name = flip(_name, ',');
5151

52-
pname.Last = chopWithRegex(_lastRegex, 0);
53-
5452
pname.LeadingInitial = chopWithRegex(_leadingInitRegex, 1);
5553

54+
pname.Last = chopWithRegex(_lastRegex, 0);
55+
5656
pname.First = chopWithRegex(_firstRegex, 0);
5757

5858
pname.Middle = _name.Trim();

0 commit comments

Comments
 (0)