File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- CONJUNCTIONS = set ([
1+ CONJUNCTIONS = {
22 '&' ,
33 'and' ,
44 'et' ,
77 'the' ,
88 'und' ,
99 'y' ,
10- ])
10+ }
1111"""
1212Pieces that should join to their neighboring pieces, e.g. "and", "y" and "&".
1313"of" and "the" are also include to facilitate joining multiple titles,
Original file line number Diff line number Diff line change 99#: means that name is not auto-fixed, whereas a wrong member misparses a real
1010#: person. Must stay a subset of :py:data:`PREFIXES` and disjoint from
1111#: :py:data:`~nameparser.config.bound_first_names.BOUND_FIRST_NAMES`.
12- NON_FIRST_NAME_PREFIXES = set ([
12+ NON_FIRST_NAME_PREFIXES = {
1313 "'t" ,
1414 'af' ,
1515 'auf' ,
3232 'vd' ,
3333 'vom' ,
3434 'zu' ,
35- ])
35+ }
3636
3737#: Name pieces that appear before a last name. Prefixes join to the piece
3838#: that follows them to make one new piece. They can be chained together, e.g
4848#: is guaranteed to also be a prefix (and still join forward), with no drift --
4949#: mirroring ``TITLES = FIRST_NAME_TITLES | {...}`` in
5050#: :py:mod:`nameparser.config.titles`.
51- PREFIXES = NON_FIRST_NAME_PREFIXES | set ([
51+ PREFIXES = NON_FIRST_NAME_PREFIXES | {
5252 'aan' ,
5353 'aen' ,
5454 'abu' ,
8686 'vander' ,
8787 'vel' ,
8888 'von' ,
89- ])
89+ }
9090
9191# Guard the two invariants the docstring above promises, so a future edit that
9292# breaks them fails at import time instead of silently drifting until a test
Original file line number Diff line number Diff line change 1- SUFFIX_NOT_ACRONYMS = set ([
1+ SUFFIX_NOT_ACRONYMS = {
22 'dr' ,
33 'esq' ,
44 'esquire' ,
2121 # literally instead of going through nickname/suffix disambiguation).
2222 'ret' ,
2323 'vet' ,
24- ])
24+ }
2525"""
2626
2727Post-nominal pieces that are not acronyms. The parser does not remove periods
2828when matching against these pieces.
2929
3030"""
31- SUFFIX_ACRONYMS_AMBIGUOUS = set ([
31+ SUFFIX_ACRONYMS_AMBIGUOUS = {
3232 # Suffix acronyms that also commonly work as given-name nicknames on
3333 # their own (e.g. "Ed", "JD"). Read only by HumanName.parse_nicknames()
3434 # when deciding whether parenthesized/quoted content is a nickname or a
4242 # certifications/degrees (e.g. 'mba', 'cpa', 'phd') don't need an entry.
4343 'ed' ,
4444 'jd' ,
45- ])
45+ }
4646"""
4747
4848Acronym suffixes from SUFFIX_ACRONYMS that also plausibly collide with a
4949common given-name nickname. Not a partition of SUFFIX_ACRONYMS -- a small,
5050standalone exception list consulted only by parse_nicknames().
5151
5252"""
53- SUFFIX_ACRONYMS = set ([
53+ SUFFIX_ACRONYMS = {
5454 '8-vsb' ,
5555 'aas' ,
5656 'aba' ,
683683 'vcp' ,
684684 'vd' ,
685685 'vrd' ,
686- ])
686+ }
687687"""
688688
689689Post-nominal acronyms. Titles, degrees and other things people stick after their name
Original file line number Diff line number Diff line change 1- FIRST_NAME_TITLES = set ([
1+ FIRST_NAME_TITLES = {
22 'aunt' ,
33 'auntie' ,
44 'brother' ,
2121 'shaikh' ,
2222 'cheikh' ,
2323 'shekh' ,
24- ])
24+ }
2525"""
2626When these titles appear with a single other name, that name is a first name, e.g.
2727"Sir John", "Sister Mary", "Queen Elizabeth".
3131#: Many of these from wikipedia: https://en.wikipedia.org/wiki/Title.
3232#: The parser recognizes chains of these including conjunctions allowing
3333#: recognition titles like "Deputy Secretary of State".
34- TITLES = FIRST_NAME_TITLES | set ([
34+ TITLES = FIRST_NAME_TITLES | {
3535 "attaché" ,
3636 "chargé d'affaires" ,
3737 "king's" ,
683683 'woodman' ,
684684 'writer' ,
685685 'zoologist' ,
686- ])
686+ }
You can’t perform that action at this time.
0 commit comments