analyze_syntax {googlenlp}R Documentation

analyze_syntax

Description

Send a request, and retrieve the sentences, tokens, and language responses. This function retrieves the results from the analyzeSyntax method.

Usage

analyze_syntax(text_body, flatten = TRUE)

Arguments

text_body

The text string to send to the API.

flatten

If TRUE (default), then the results of each method are flattened and converted to a data frame.

Value

A list containing three elements: sentences, tokens, and language.

If flatten is TRUE, then the sentences and tokens elements are each converted to data frames.

Examples

## Not run: 
sample_syntax <- analyze_syntax(text_body = "Google, headquartered in Mountain View, unveiled
                                       the new Android phone at the Consumer Electronic Show.
                                       Sundar Pichai said in his keynote that users love
                                       their new Android phones.",
                                flatten = TRUE)
sample_syntax$sentences
sample_syntax$tokens
sample_syntax$language

## End(Not run)


[Package googlenlp version 0.2.0 Index]