Natural language detection for Elixir
API Documentation | Hex Package
Add paasaa
to your list of dependencies in mix.exs
:
def deps do
[{:paasaa, "~> 0.6.0"}]
end
After you are done, run mix deps.get
in your shell to fetch and compile Paasaa.
Detect a language:
iex> Paasaa.detect "Detect this!"
"eng"
Detect language and return a scored list of languages:
iex> Paasaa.all("Detect this!")
[
{"eng", 1.0},
{"sco", 0.8675529295913343},
{"nob", 0.6065977351058591},
{"swe", 0.5923190546528804},
...
]
mix bench
mix run script/generate_language_data.exs
Paasaa is a derivative work from Franc (JavaScript, MIT) by Titus Wormer.