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

namespace Google\Cloud\Language\V1beta2\PartOfSpeech;

use UnexpectedValueException;

/**
 * Count distinctions.
 *
 * Protobuf type <code>google.cloud.language.v1beta2.PartOfSpeech.Number</code>
 */
class Number
{
    /**
     * Number is not applicable in the analyzed language or is not predicted.
     *
     * Generated from protobuf enum <code>NUMBER_UNKNOWN = 0;</code>
     */
    const NUMBER_UNKNOWN = 0;
    /**
     * Singular
     *
     * Generated from protobuf enum <code>SINGULAR = 1;</code>
     */
    const SINGULAR = 1;
    /**
     * Plural
     *
     * Generated from protobuf enum <code>PLURAL = 2;</code>
     */
    const PLURAL = 2;
    /**
     * Dual
     *
     * Generated from protobuf enum <code>DUAL = 3;</code>
     */
    const DUAL = 3;

    private static $valueToName = [
        self::NUMBER_UNKNOWN => 'NUMBER_UNKNOWN',
        self::SINGULAR => 'SINGULAR',
        self::PLURAL => 'PLURAL',
        self::DUAL => 'DUAL',
    ];

    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(Number::class, \Google\Cloud\Language\V1beta2\PartOfSpeech_Number::class);

