Skip to content

Latest commit

 

History

History
101 lines (54 loc) · 2.73 KB

efranc.md

File metadata and controls

101 lines (54 loc) · 2.73 KB

Module efranc

Data Types


options() = #{min_length => integer(), whitelist => [efranc_lang:code()], blacklist => [efranc_lang:code()], details => true | false}

Function Index

detect/1Equivalent to detect(Value, #{}).
detect/2 Detect the language of text.
detect_all/1Equivalent to detect_all(Value, #{}).
detect_all/2 Detect the language of text.

Function Details

detect/1


detect(Value::string()) -> efranc_lang:code()

Equivalent to detect(Value, #{}).

detect/2


detect(Value::string(), Options::options()) -> efranc_lang:code() | efranc_lang:iso6393()

Detect the language of text. Return the ISO-639-3 code.

Options:

  • min_length: integer() : minimum length to accept (default: 10)

  • withlist: [string()] : allow languages (default: all)

  • blacklist: [string()] : disallow languages (default: none)

  • details: true | false : return ISO-639-3 details (default: false)

detect_all/1


detect_all(Value::string()) -> [{efranc_lang:code(), float()}]

Equivalent to detect_all(Value, #{}).

detect_all/2


detect_all(Value::string(), Options::options()) -> [{efranc_lang:code() | efranc_lang:iso6393(), float()}]

Detect the language of text. Return a list of ISO-639-3 codes with weight.

Options:

  • min_length: integer() : minimum length to accept (default: 10)

  • withlist: [string()] : allow languages (default: all)

  • blacklist: [string()] : disallow languages (default: none)