class Cadmium::LanguageDetector
- Cadmium::LanguageDetector
- Reference
- Object
Overview
Cadmium::LanguageDetector
is a Language Identification algorithm which identifies up to 400 different languages.
Included Modules
Defined in:
cadmium/language_detector/language_detector.crConstructors
-
.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.
Instance Method Summary
-
#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.
Constructor Detail
A LanguageDetector object can be initiampized with a whitelist and/or blacklist of languages. Those lists have to be Tuple of String.
Instance Method Detail
Returns a two letters string corresponding to the ISO-868-1 code of the detected language.
Returns an Hash of two letters string corresponding to the ISO-868-1 code of the detected language mapped to their probability.