Skip to main content

gender

Returns the gender for the input name. Possible results are 'male', 'female', and 'none'.

The names are taken from a census database of American first names. For names assigned to males and females, the function returns the most common gender for the name.

Parameters

  • NAME (string)

    The input name.

Examples

ATL in Script

Result

[[gender('Chris')]]

male

[[gender('Chrissie')]]

female

[[gender('Lesley')]]

female

[[gender('Les')]]

male

[[gender('Zaphod')]]

none

You could write a user-defined function (UDF) to get 'unknown' (or any other string) instead of 'none'.

#value getGender(name)

[[gender(name) == 'none' ? 'unknown' : gender(name)]]

This content creates a UDF called getGender. The UDF takes one parameter (name), to which you input the name in STRING form. The UDF uses gender to check if the gender is 'none'. If true, it returns 'unknown'. If false, it runs the name through the gender function, meaning it returns 'male' or 'female'. For example:

ATL in Script

Result

[[getGender('Emma')]]

female

[[getGender('Godfrey')]]

male

[[getGender('Zaphod')]]

unknown