Jokes Process Flow

Identify the Jokes Category

Jokes category is identified based on the User Request, Jokes are currently spoken by Aryan in English language only
  • If the user request is for "geeky/nerdy" jokes then the category is neutral
  • If the user request is for "Chuck Norris" jokes then the category is chuck
  • In case of no specific user request or neither of this categories then the category is defaulted as "all"

Get the Jokes

Python pyjokes package is used to get the Jokes based on Language and category.
pyjokes packages is used for one line jokes for programmers (jokes as a service)
  • Get Jokes for category as neutral
1
My_joke = pyjokes.get_joke(language="en", category="neutral")
2
PrintText(aifriend,"Geeky Joke for you is: " + My_joke)
3
SpeakText(aifriend,"Geeky Joke for you is: " + My_joke)
Copied!
  • Get Jokes for category as neutral
1
My_joke = pyjokes.get_joke(language="en", category="chuck")
2
PrintText(aifriend,"Chuck Norris Joke for you is: " + My_joke)
3
SpeakText(aifriend,"Chuck Norris Joke for you is: " + My_joke)
Copied!
  • Get Jokes for category as ALL
1
My_joke = pyjokes.get_joke(language="en", category="all")
2
PrintText(aifriend,"Joke for you is: " + My_joke)
3
SpeakText(aifriend,"Joke for you is: " + My_joke)
Copied!
Respective jokes are provided to user and thereafter control is returned to NextStep