Google\Cloud\NaturalLanguage\Annotation::tokensByTag PHP Method

tokensByTag() public method

Example: $tokens = $annotation->tokensByTag('NOUN'); foreach ($tokens as $token) { echo $token['lemma']; }
See also: https://cloud.google.com/natural-language/reference/rest/v1beta1/documents/annotateText#tag Token tags documentation
public tokensByTag ( $tag ) : array | null
return array | null
    public function tokensByTag($tag)
    {
        return $this->filter($this->tokens(), ['partOfSpeech', 'tag'], $tag);
    }