cadmiumcr / language_detector

Detects the language of a text sample
MIT License
7 stars 0 forks source link

Returns 3-letter language instead of 2 #8

Open confact opened 3 years ago

confact commented 3 years ago

Hi,

According to the document, it should return a 2-letter language code but is returning a 3-letter code.

That's okay as I found IsoCode3To1 in the code and are using that.

Might go through the document so it is 3-letter and not 2-letter

For reference, this is how I did it:

code = Cadmium::LanguageDetector.new.detect(text)
Cadmium::Language::IsoCode3To1.new.codes[code]
watzon commented 3 years ago

What is the code that the first line is returning? Or the text you're testing on?