textPrepare: Preparing text vector for gender prediction

Description Usage Arguments Value Examples

View source: R/textPrepare.R

Description

The textPrepare function takes a text vector as an argument and converts it into a vector of unique terms. This function is used by default by the findGivenNames function as a text pre-processor before sending a query to the genderize.io API.

Usage

1
textPrepare(x, textPrepMessages = FALSE)

Arguments

x

A vector of character strings.

textPrepMessages

If TRUE verbose output of the preparing process is shown on the console (default is FALSE).

Value

A vector of unique terms with at least two characters.

Examples

1
2
3
4
5
6
7
x = c("Winston J. Durant, ASHP past president, dies at 84", 
      "Gold Badge of Honour of the DGAI Prof. Dr. med. Norbert R. Roewer Wuerzburg",
      "The contribution of professor Yu.S. Martynov (1921-2008) to Russian neurology", 
      "JAN BASZKIEWICZ (3 JANUARY 1930 - 27 JANUARY 2011) IN MEMORIAM", 
      "Maria Sklodowska-Curie")

head(textPrepare(x))

kalimu/genderizeR documentation built on Aug. 6, 2019, 1:37 a.m.