In PHP's Gender\Gender class, what is the difference between IS_UNISEX_NAME and IS_A_COUPLE?

StackOverflow https://stackoverflow.com/questions/18089675

  •  23-06-2022
  •  | 
  •  

Question

I was looking at the Gender class usage example, which contains this snippet:

case Gender::IS_UNISEX_NAME:
    printf("The name %s is unisex in %s\n", $name, $data['country']);
break;


case Gender::IS_A_COUPLE:
    printf("The name %s is both male and female in %s\n", $name, $data['country']);
break;

That gives me the impression that IS_UNISEX_NAME and IS_A_COUPLE are the same thing, which makes me wonder why there are two different constants for it.

It also makes me think that it could be due to a historical reason. Or maybe it's just an oversight.

Was it helpful?

Solution

I took aynber's suggestion and emailed Anatol Belski, the current maintainer of the Gender extension. Here's his response (published with his permission):

Basically that's the same thing. In PHP 'is couple' is done almost for the compatibility reasons, as nothing blocks one to change the name dictionary. Defining same forename as male and female (so two lines) means couple. Using '?' means it being unisex. The terms how they're meant - couple is a name common to both male and female, unisex could be for example a female name given to male person. With the default dataset you can simply join that two cases in the switch. For the database format just look into data/nam_dict.txt in the package.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top