class Cadmium::LanguageDetector

Overview

Cadmium::LanguageDetector is a Language Identification algorithm which identifies up to 400 different languages.

Included Modules

Defined in:

cadmium/language_detector/language_detector.cr

Constructors

Instance Method Summary

Constructor Detail

def self.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.


[View source]

Instance Method Detail

def detect(text : String) : String #

Returns a two letters string corresponding to the ISO-868-1 code of the detected language.


[View source]
def 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.


[View source]