* $languageService = new Google\Service\CloudNaturalLanguage(...); * $documents = $languageService->documents; * */ class Documents extends \Google\Service\Resource { /** * Finds named entities (currently proper names and common nouns) in the text * along with entity types, salience, mentions for each entity, and other * properties. (documents.analyzeEntities) * * @param AnalyzeEntitiesRequest $postBody * @param array $optParams Optional parameters. * @return AnalyzeEntitiesResponse */ public function analyzeEntities(AnalyzeEntitiesRequest $postBody, $optParams = []) { $params = ['postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('analyzeEntities', [$params], AnalyzeEntitiesResponse::class); } /** * Finds entities, similar to AnalyzeEntities in the text and analyzes sentiment * associated with each entity and its mentions. * (documents.analyzeEntitySentiment) * * @param AnalyzeEntitySentimentRequest $postBody * @param array $optParams Optional parameters. * @return AnalyzeEntitySentimentResponse */ public function analyzeEntitySentiment(AnalyzeEntitySentimentRequest $postBody, $optParams = []) { $params = ['postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('analyzeEntitySentiment', [$params], AnalyzeEntitySentimentResponse::class); } /** * Analyzes the sentiment of the provided text. (documents.analyzeSentiment) * * @param AnalyzeSentimentRequest $postBody * @param array $optParams Optional parameters. * @return AnalyzeSentimentResponse */ public function analyzeSentiment(AnalyzeSentimentRequest $postBody, $optParams = []) { $params = ['postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('analyzeSentiment', [$params], AnalyzeSentimentResponse::class); } /** * Analyzes the syntax of the text and provides sentence boundaries and * tokenization along with part of speech tags, dependency trees, and other * properties. (documents.analyzeSyntax) * * @param AnalyzeSyntaxRequest $postBody * @param array $optParams Optional parameters. * @return AnalyzeSyntaxResponse */ public function analyzeSyntax(AnalyzeSyntaxRequest $postBody, $optParams = []) { $params = ['postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('analyzeSyntax', [$params], AnalyzeSyntaxResponse::class); } /** * A convenience method that provides all the features that analyzeSentiment, * analyzeEntities, and analyzeSyntax provide in one call. * (documents.annotateText) * * @param AnnotateTextRequest $postBody * @param array $optParams Optional parameters. * @return AnnotateTextResponse */ public function annotateText(AnnotateTextRequest $postBody, $optParams = []) { $params = ['postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('annotateText', [$params], AnnotateTextResponse::class); } /** * Classifies a document into categories. (documents.classifyText) * * @param ClassifyTextRequest $postBody * @param array $optParams Optional parameters. * @return ClassifyTextResponse */ public function classifyText(ClassifyTextRequest $postBody, $optParams = []) { $params = ['postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('classifyText', [$params], ClassifyTextResponse::class); } } // Adding a class alias for backwards compatibility with the previous class name. class_alias(Documents::class, 'Google_Service_CloudNaturalLanguage_Resource_Documents');