-
Notifications
You must be signed in to change notification settings - Fork 73
Open
Description
In Canada, professional engineers will place the accreditation "P.Eng" after their name. ProbablePeople incorrectly identifies the suffix "P.Eng" as a second "GivenName", which results in the following error:
$ python
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import probablepeople as pp
>>> pp.parse("Brian Ellis Linkletter, P.Eng")
[('Brian', 'GivenName'), ('Ellis', 'MiddleName'), ('Linkletter,', 'Surname'), ('P.Eng', 'GivenName')]
>>> pp.parse("Brian Ellis Linkletter, M.D.")
[('Brian', 'GivenName'), ('Ellis', 'MiddleName'), ('Linkletter,', 'Surname'), ('M.D.', 'SuffixOther')]
>>> pp.tag("Brian Ellis Linkletter, P.Eng")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/brian/Projects/learning/parser/venv/lib/python3.10/site-packages/probablepeople/__init__.py", line 132, in tag
raise RepeatedLabelError(raw_string, parse(raw_string), label)
probablepeople.RepeatedLabelError:
ERROR: Unable to tag this string because more than one area of the string has the same label
ORIGINAL STRING: Brian Ellis Linkletter, P.Eng
PARSED TOKENS: [('Brian', 'GivenName'), ('Ellis', 'MiddleName'), ('Linkletter,', 'Surname'), ('P.Eng', 'GivenName')]
UNCERTAIN LABEL: GivenName
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels