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

namespace Google\Cloud\Speech\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Provides "hints" to the speech recognizer to favor specific words and phrases
 * in the results.
 *
 * Generated from protobuf message <code>google.cloud.speech.v1.SpeechContext</code>
 */
class SpeechContext extends \Google\Protobuf\Internal\Message
{
    /**
     * A list of strings containing words and phrases "hints" so that
     * the speech recognition is more likely to recognize them. This can be used
     * to improve the accuracy for specific words and phrases, for example, if
     * specific commands are typically spoken by the user. This can also be used
     * to add additional words to the vocabulary of the recognizer. See
     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
     * List items can also be set to classes for groups of words that represent
     * common concepts that occur in natural language. For example, rather than
     * providing phrase hints for every month of the year, using the $MONTH class
     * improves the likelihood of correctly transcribing audio that includes
     * months.
     *
     * Generated from protobuf field <code>repeated string phrases = 1;</code>
     */
    private $phrases;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $phrases
     *           A list of strings containing words and phrases "hints" so that
     *           the speech recognition is more likely to recognize them. This can be used
     *           to improve the accuracy for specific words and phrases, for example, if
     *           specific commands are typically spoken by the user. This can also be used
     *           to add additional words to the vocabulary of the recognizer. See
     *           [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
     *           List items can also be set to classes for groups of words that represent
     *           common concepts that occur in natural language. For example, rather than
     *           providing phrase hints for every month of the year, using the $MONTH class
     *           improves the likelihood of correctly transcribing audio that includes
     *           months.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Speech\V1\CloudSpeech::initOnce();
        parent::__construct($data);
    }

    /**
     * A list of strings containing words and phrases "hints" so that
     * the speech recognition is more likely to recognize them. This can be used
     * to improve the accuracy for specific words and phrases, for example, if
     * specific commands are typically spoken by the user. This can also be used
     * to add additional words to the vocabulary of the recognizer. See
     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
     * List items can also be set to classes for groups of words that represent
     * common concepts that occur in natural language. For example, rather than
     * providing phrase hints for every month of the year, using the $MONTH class
     * improves the likelihood of correctly transcribing audio that includes
     * months.
     *
     * Generated from protobuf field <code>repeated string phrases = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getPhrases()
    {
        return $this->phrases;
    }

    /**
     * A list of strings containing words and phrases "hints" so that
     * the speech recognition is more likely to recognize them. This can be used
     * to improve the accuracy for specific words and phrases, for example, if
     * specific commands are typically spoken by the user. This can also be used
     * to add additional words to the vocabulary of the recognizer. See
     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
     * List items can also be set to classes for groups of words that represent
     * common concepts that occur in natural language. For example, rather than
     * providing phrase hints for every month of the year, using the $MONTH class
     * improves the likelihood of correctly transcribing audio that includes
     * months.
     *
     * Generated from protobuf field <code>repeated string phrases = 1;</code>
     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setPhrases($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->phrases = $arr;

        return $this;
    }

}

