Skip to contents

Parses a character vector of raw names into a data frame of structured name components. Names are sanitized once up front and then parsed in parallel with furrr::future_map_dfr().

Usage

parse_names(x, prefixes = prx, suffixes = sfx, ...)

Arguments

x

A character vector of raw names to parse.

prefixes

A character vector of salutations/prefixes to remove. Defaults to prx.

suffixes

A character vector of suffixes to remove. Defaults to sfx.

...

Reserved for future arguments; currently unused.

Value

A data.frame with one row per input name and columns name (the original input) plus the parsed components returned by parse_name(): salutation, first_name, middle_name, last_name, suffix, status, gender, and gender_confidence.

Examples

x <- c("livingston III,  Mr. MICHAEL JOHN9", "THOMAS H VON KAMECKE")
parse_names(x)
#>                                 name salutation first_name middle_name
#> 1 livingston III,  Mr. MICHAEL JOHN9         MR    MICHAEL        JOHN
#> 2               THOMAS H VON KAMECKE                THOMAS           H
#>     last_name suffix status gender gender_confidence
#> 1  LIVINGSTON    III             M              99.6
#> 2 VON-KAMECKE                    M              99.8