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

Language problem #21

Open
luismanson opened this issue Jun 15, 2020 · 4 comments
Open

Language problem #21

luismanson opened this issue Jun 15, 2020 · 4 comments

Comments

@luismanson
Copy link

Hello, i got this exeption. Im using the Pi edition of Mycroft and stting up spanish language. I told 'tell me a joke' in my language.

Traceback (most recent call last):
  File "/home/pi/mycroft-core/mycroft/skills/mycroft_skill/event_container.py", line 66, in wrapper
    handler(message)
  File "/opt/mycroft/skills/mycroft-joke.mycroftai/__init__.py", line 37, in handle_general_joke
    self.speak_joke(self.lang[:-3], selected)
  File "/opt/mycroft/skills/mycroft-joke.mycroftai/__init__.py", line 32, in speak_joke
    self.speak(pyjokes.get_joke(language=lang, category=category))
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/pyjokes/pyjokes.py", line 63, in get_joke
    jokes = get_jokes(language, category)
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/pyjokes/pyjokes.py", line 44, in get_jokes
    raise CategoryNotFoundError('No such category %s in language %s' % (category, language))
pyjokes.pyjokes.CategoryNotFoundError: No such category chuck in language es
@krisgesling
Copy link
Contributor

Hi Luis, thanks for flagging this.

What's the exact phrase you used for "tell me a joke"?
Just wondering why it went searching for a Chuck Norris joke in particular.

If jokes are unavailable in a language we should be handling that exception and either saying so, or taking the english version and attempting an automated translation.

@luismanson
Copy link
Author

What's the exact phrase you used for "tell me a joke"?

voice.log:2020-06-15 01:51:46.343 | INFO | 532 | __main__:handle_utterance:72 | Utterance: ['contame un chiste']
It's literally Spanish for 'tell me a joke'.
No more, no less. (trying to be precise, not rude.)

Now that you say that... I did not notice the 'chuck' word in the log. Just tried that same phrase now and worked perfect. It's weird because that's the only logged mention and as you can see, it's not in the utterance log...

Thanks for your help!

@luismanson
Copy link
Author

Nevermind...
pyjokes.pyjokes.CategoryNotFoundError: No such category chuck in language es ^--- NEWEST ---^

Same phrase, 'tell me a joke'

@forslund
Copy link
Collaborator

The skill randomized a category for that query so some sort of handling needs to be added if the language doesn't support all categories

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

No branches or pull requests

3 participants