Skip to content

Professional suffix "P.Eng"  #108

@blinklet

Description

@blinklet

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions