0

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.

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
  • This question appears to be off-topic because it is about an example that isn't related to programming. – Daniel A. White Aug 06 '13 at 20:21
  • 4
    @DanielA.White: I disagree. That "example" is the only documentation of the meaning of these constants, so the question is about the meaning of the constants in the `Gender` library. – ruakh Aug 06 '13 at 20:27
  • 1
    The library seems to built on the original owner's determination. You might need to contact Joerg Michael (as the writer of the original C code) or Anatol Belski (as the owner of the pecl distribution) to find out how they made the distinctions. – aynber Aug 06 '13 at 20:29

1 Answers1

4

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.

Community
  • 1
  • 1