Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get ceb missing key on Emoji letters #9

Open
confact opened this issue Apr 28, 2021 · 1 comment
Open

Get ceb missing key on Emoji letters #9

confact opened this issue Apr 28, 2021 · 1 comment

Comments

@confact
Copy link

confact commented Apr 28, 2021

I tried to use this emoji and word array and makes it a string:

 "[\"💜\", \"\", \"snart helg 💜\", \"🤩\", \"🤍\", \"Söndagar\", \"☀️🥱\", \"🌌\", \"lördag ☔️💜\", \"Kvälls☀️\"]"

Then run this code:

      code = Cadmium::LanguageDetector.new.detect(sentence)

      Cadmium::Language::IsoCode3To1.new.codes[code] if code

Then I get this error:

Unhandled exception: Missing hash key: "ceb" (KeyError)
@watzon
Copy link
Member

watzon commented Apr 28, 2021

I'm guessing the key error is coming from IsoCode3to1 and not LanguageDetector? Not all languages have a 2 character code, specifically lesser used languages like Cebuano which is apparently what the language detector guessed. In this case we should probably throw our own error, but either way you'd want to catch it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants