cld3: Compact Language Detector 3

cld3R Documentation

Compact Language Detector 3

Description

The function detect_language() is vectorised and guesses the the language of each string in text or returns NA if the language could not reliably be determined. The function detect_language_multi() is not vectorised and detects all languages inside the entire character vector as a whole.

Usage

detect_language(text)

detect_language_mixed(text, size = 3)

Arguments

text

a string with text to classify or a connection to read from

size

number of languages to detect

Examples

# Vectorized best guess
text <- c("To be or not to be?", "Ce n'est pas grave.",
  "Hij heeft de klok horen luiden maar weet niet waar de klepel hangt.")
detect_language(text)

# Multiple languages in one text (doesn't seem to work well)
detect_language_mixed(text)

cld3 documentation built on Oct. 4, 2024, 5:08 p.m.

Related to cld3 in cld3...