language: Detects language of the text

Description Usage Arguments Value See Also Examples

Description

Given input text, returns a probability distribution over 33 possible languages of what language the text was written in.

Usage

1
language(text, local.api = FALSE)

Arguments

text

text for analysis

local.api

logical, whether use local or remote API

Value

List with language probability pairs

See Also

political, sentiment

Examples

1
2
3
4
5
6
7
8
languages <- language("Monday: Delightful with mostly sunny skies.
                            Highs in the low 70s.")
languages
most.possible <- sort(unlist(languages), decreasing = TRUE)[1:2]
cat(sprintf("Detected %s language with probability %0.4f.\n",
            names(most.possible)[1], most.possible[1]))
cat(sprintf("Next possible is %s with probability %0.4f.",
            names(most.possible)[2], most.possible[2]))

redmode/indicoio documentation built on May 27, 2019, 4:03 a.m.