Whatlang NIF bindings for Elixir.
- Elixir
1.15
or more - Erlang OTP
24
or more
The package can be installed by adding whatlangex
to your list of dependencies in mix.exs
:
def deps do
[
{:whatlangex, "~> 0.3.0"}
]
end
To detect the language of a sentence:
iex> Whatlangex.detect("¿Cómo te llamas?")
%Whatlangex.Detection{
lang: "spa",
script: "Latin",
confidence: 0.6848222396112233
}
To get the full language name from language code:
iex> Whatlangex.code_to_eng_name("spa")
"Spanish"
iex> Whatlangex.code_to_name("spa")
"Español"