<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/language/v1/language_service.proto

namespace Google\Cloud\Language\V1\PartOfSpeech;

use UnexpectedValueException;

/**
 * Gender classes of nouns reflected in the behaviour of associated words.
 *
 * Protobuf type <code>google.cloud.language.v1.PartOfSpeech.Gender</code>
 */
class Gender
{
    /**
     * Gender is not applicable in the analyzed language or is not predicted.
     *
     * Generated from protobuf enum <code>GENDER_UNKNOWN = 0;</code>
     */
    const GENDER_UNKNOWN = 0;
    /**
     * Feminine
     *
     * Generated from protobuf enum <code>FEMININE = 1;</code>
     */
    const FEMININE = 1;
    /**
     * Masculine
     *
     * Generated from protobuf enum <code>MASCULINE = 2;</code>
     */
    const MASCULINE = 2;
    /**
     * Neuter
     *
     * Generated from protobuf enum <code>NEUTER = 3;</code>
     */
    const NEUTER = 3;

    private static $valueToName = [
        self::GENDER_UNKNOWN => 'GENDER_UNKNOWN',
        self::FEMININE => 'FEMININE',
        self::MASCULINE => 'MASCULINE',
        self::NEUTER => 'NEUTER',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Gender::class, \Google\Cloud\Language\V1\PartOfSpeech_Gender::class);

