Keywords are identified from the transformed Text to identify which set of actions needs to be performed by Aryan.
Below code snippet provides the list of keywords that are identified and respective set of actions that are triggered by Aryan.
If no keyword is identified for pre-defined set of actions, then flow fall backs on Wikipedia to get the answer. In case of any exceptions control fall backs to starting point of the Worker script and Aryan requests Human on "How can I Help?"
For example: If you say News or Headlines then News flow is triggered, if Human says quote or quotes then QuoteFlow is triggered. This are the keywords
ifsubStrCheck(transformedSpeech,"timezone")orsubStrCheck(transformedSpeech,"time zone"):getTimeZone(rawspeech,aifriend)elif subStrCheck(transformedSpeech,"date") or subStrCheck(transformedSpeech,"time") or subStrCheck(transformedSpeech,"year") or subStrCheck(transformedSpeech,"month"):
TimeQuery(transformedSpeech,rawspeech,aifriend)elifsubStrCheck(transformedSpeech,"can you sneeze")orsubStrCheck(transformedSpeech,"sneeze"):CanyouSneeze(aifriend)elifsubStrCheck(transformedSpeech,"bad word")orsubStrCheck(transformedSpeech,"bad words"):SayaBadWord(aifriend)elifsubStrCheck(transformedSpeech,"play song")orsubStrCheck(transformedSpeech,"play"):playSong(aifriend)elifsubStrCheck(transformedSpeech,"latitude")orsubStrCheck(transformedSpeech,"longitude"):getLatitudeLongitude(rawspeech,aifriend)elifsubStrCheck(transformedSpeech,"weather"):CheckForEmailFlow(weatherByCity,rawspeech,transformedSpeech,aifriend)elifsubStrCheck(transformedSpeech,"jokes")orsubStrCheck(transformedSpeech,"joke"):getJokes(transformedSpeech,aifriend)elif subStrCheck(transformedSpeech,"bore") or subStrCheck(transformedSpeech,"boredem") or subStrCheck(transformedSpeech,"bored"):
removeBoredomFlow(transformedSpeech,aifriend)elifsubStrCheck(transformedSpeech,"repeat after")orsubStrCheck(transformedSpeech,"repeat"):repeatAfterMe(aifriend)elifsubStrCheck(transformedSpeech,"introduce yourself")orsubStrCheck(transformedSpeech,"introduce"):introduceYourself(aifriend)elif subStrCheck(transformedSpeech,"news") or subStrCheck(transformedSpeech,"headline") or subStrCheck(transformedSpeech,"headlines"):
CheckForEmailFlow(getNews,rawspeech,transformedSpeech,aifriend)elifsubStrCheck(transformedSpeech,"currency")orsubStrCheck(transformedSpeech,"currencies"):getCurrency(rawspeech,aifriend)elifsubStrCheck(transformedSpeech,"capital")orsubStrCheck(transformedSpeech,"capitals"):getCapital(rawspeech,aifriend)elif subStrCheck(transformedSpeech,"zodiac") or subStrCheck(transformedSpeech,"astro sign") or subStrCheck(transformedSpeech,"sun sign"):
getZodiacFlow(rawspeech,aifriend)elif subStrCheck(transformedSpeech,"record") or subStrCheck(transformedSpeech,"record audio") or subStrCheck(transformedSpeech,"record voice"):
SaveAudio(aifriend)elif subStrCheck(transformedSpeech,"skills") or subStrCheck(transformedSpeech,"describe skill") or subStrCheck(transformedSpeech,"describe skills"):
DescribeSkills(aifriend)elifsubStrCheck(transformedSpeech,"quote")orsubStrCheck(transformedSpeech,"quotes"):ifsubStrCheck(rawspeech,"list")orsubStrCheck(rawspeech,"what")orsubStrCheck(rawspeech,"describe"):ListofQuotesCategory(aifriend)else:identifyQuoteCategory(transformedSpeech,aifriend)elifsubStrCheck(transformedSpeech,"send email")orsubStrCheck(transformedSpeech,"email"):sendEmail(aifriend)else:wikiSearch(transformedSpeech,detailFlag,aifriend)