Whatlangex (whatlangex v0.2.1)

Documentation for Whatlang.

Link to this section Summary

Functions

Get full language name (in English) from language code.

Get full language name (native) from language code.

Detect the language of the given sentence.

Link to this section Functions

Link to this function

code_to_eng_name(sentence)

@spec code_to_eng_name(String.t()) :: {:ok, String.t()} | :not_found

Get full language name (in English) from language code.

examples

Examples

iex> code_to_name("eng")
"English"
Link to this function

code_to_name(sentence)

@spec code_to_name(String.t()) :: {:ok, String.t()} | :not_found

Get full language name (native) from language code.

examples

Examples

iex> code_to_eng_name("fra")
"Français"
Link to this function

detect(sentence)

@spec detect(String.t()) :: {:ok, Whatlangex.Detection.t()} | :none

Detect the language of the given sentence.

examples

Examples

iex> detect("This is a cool sentence.")
"eng"