You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
repr(ParsedName) prints ['suffix-or-name', 'suffix-or-name'] for two different words #431
They are not duplicates. They are two distinct Ambiguity objects about two different words, each with its own detail:
kind: suffix-or-name | tokens: ['V'] | detail: "'V' is a roman numeral, so it reads as a
generational suffix; any other single letter there would be a middle initial"
kind: suffix-or-name | tokens: ['MA'] | detail: "'MA' written without periods is both a
post-nominal and an ordinary name; read as a suffix rather than a name part"
ParsedName.__repr__ (nameparser/_types.py:606) renders [a.kind.value for a in self.ambiguities], discarding both the token and the detail.
The SUFFIX_OR_NAME docstring (nameparser/_types.py:372) states the contract this breaks in as many words:
Which name part was declined depends on position and name_order, so detail names it rather than the kind.
The cost is diagnostic rather than parse correctness, but the failure mode is bad in a specific way: a lossy repr reads as a double-emit bug in the emitter, which is where the investigation goes first.
Suggested: include the token, e.g. ambiguities: ['suffix-or-name: MA', 'suffix-or-name: V'], matching Ambiguity.__repr__, which already prints Ambiguity('suffix-or-name': 'V').
Activity
fix(_types): ParsedName repr names the token behind each ambiguity (d…