Cadmium::LanguageDetector
Inherits Cadmium::Language / Reference / Object
Cadmium::LanguageDetector is a Language Identification algorithm which identifies up to 400 different languages.
Constructors
new(whitelist : Array(String) = [] of String, blacklist : Array(String) = [] of String)
A LanguageDetector object can be initiampized with a whitelist and/or blacklist of languages. Those lists have to be Tuple of String.
Instance methods
detect(text : String) : String
Returns a two letters string corresponding to the ISO-868-1 code of the detected language.
detect_all(text : String) : Hash(String, Float64)
Returns an Hash of two letters string corresponding to the ISO-868-1 code of the detected language mapped to their probability.