gl_translate_detect: Detect the language of text within a request

Description Usage Arguments Details Value See Also Examples

View source: R/translate.R

Description

Detect the language of text within a request

Usage

1

Arguments

string

A character vector of text to detect language for

Details

Consider using library(cld2) and cld2::detect_language instead offline, since that is free and local without needing a paid API call.

gl_translate also returns a detection of the language, so you could also wish to do it in one step via that function.

Value

A tibble of the detected languages with columns confidence, isReliable, language, and text of length equal to the vector of text you passed in.

See Also

https://cloud.google.com/translate/docs/reference/detect

Other translations: gl_translate_languages(), gl_translate()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 

gl_translate_detect("katten sidder på måtten")
# Detecting language: 39 characters - katten sidder på måtten...
# confidence isReliable language                    text
# 1   0.536223      FALSE       da katten sidder på måtten



## End(Not run)

googleLanguageR documentation built on April 19, 2020, 3:58 p.m.