|
MediaWiki master
|
Gender. More...
Public Member Functions | |
| process (string $value, array $options) | |
| Selects the appropriate text variant based on gender. | |
Gender.
The Gender class selects the appropriate text variant based on a provided gender value. It accepts a gender identifier along with an array of text options for male, female, and other, returning the corresponding text.
Usage Example: echo $gender->process( 'female', [ 'he', 'she', 'they' ] );
Definition at line 25 of file Gender.php.
| Wikimedia\Leximorph\Handler\Gender::process | ( | string | $value, |
| array | $options ) |
Selects the appropriate text variant based on gender.
This method converts the provided gender value to lowercase and returns the text variant from the supplied options that corresponds to 'male', 'female', or a default value for any other or unspecified gender.
| string | $value | The gender value (e.g., "male", "female", or another). |
| string[] | $options | An array containing text variants for male, female, and other. All three elements are optional. |
Definition at line 41 of file Gender.php.