options() = #{min_length => integer(), whitelist => [efranc_lang:code()], blacklist => [efranc_lang:code()], details => true | false}
detect/1 | Equivalent to detect(Value, #{}). |
detect/2 | Detect the language of text. |
detect_all/1 | Equivalent to detect_all(Value, #{}). |
detect_all/2 | Detect the language of text. |
detect(Value::string()) -> efranc_lang:code()
Equivalent to detect(Value, #{})
.
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(Value::string()) -> [{efranc_lang:code(), float()}]
Equivalent to detect_all(Value, #{})
.
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)