Tongue (Tongue v2.2.0)

Provides language detection functions

Examples

iex> Tongue.detect("The octopus is a soft-bodied, eight-armed mollusc of the order Octopoda, with around 300 known species. Along with squids, cuttlefish and nautiloids, they are classed as cephalopods.")
[en: 0.9999986358008764]

Link to this section Summary

Functions

Detects a language. Returns a keyword of scored languages.

Returns the list of languages which Tongue is able to detect

Link to this section Functions

Specs

detect(String.t()) :: keyword(char())

Detects a language. Returns a keyword of scored languages.

Parameters

  • text - a text string

Examples

iex> Tongue.detect("El microprocesador (o simplemente procesador) es el circuito integrado central más complejo de un sistema informático; a modo de ilustración, se le suele llamar por analogía el «cerebro» de un ordenador.")
[es: 0.9999977345738683]

Specs

languages() :: [atom()]

Returns the list of languages which Tongue is able to detect