publicclassYourSkillextendsSkill{// ...// A list of words that should get preference in the recognizer.privateList<String>phrases=Arrays.asList("Furhat","London","Amsterdam","Paris","Helsinki","Stockholm","Oslo");// ...@Overridepublicvoidinit()throwsException{SkillHandlerhandler=getSkillHandler();// Pass in the phrases array to the OpenVocabularyContexthandler.loadContext("context_with_phrases",newOpenVocabularyContext(language,phrases));handler.loadContext("context_with_phrases",newSemanticGrammarContext(newSRGSGrammar(getPackageFile("YourGrammar.xml"))));handler.setDefaultContext("context_with_phrases");// ...}}
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.