Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Professional suffix "P.Eng" #108

Open
blinklet opened this issue Jun 7, 2024 · 0 comments
Open

Professional suffix "P.Eng" #108

blinklet opened this issue Jun 7, 2024 · 0 comments

Comments

@blinklet
Copy link

blinklet commented Jun 7, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant