Merge pull request #109 from ethanaward/feature/issues-86

Feature/issues 86
pull/117/head
aatchison 2016-06-07 20:50:27 -05:00
commit b84756e970
13 changed files with 81 additions and 8 deletions

View File

@ -26,23 +26,40 @@ __author__ = 'eward'
LOGGER = getLogger(__name__)
class WelcomeSkill(MycroftSkill):
class HelloWorldSkill(MycroftSkill):
def __init__(self):
super(WelcomeSkill, self).__init__(name="WelcomeSkill")
super(HelloWorldSkill, self).__init__(name="HelloWorldSkill")
def initialize(self):
self.load_data_files(dirname(__file__))
welcome_intent = IntentBuilder("WelcIntent").require("WelcKey").build()
self.register_intent(welcome_intent, self.handle_welcome_intent)
thank_you_intent = IntentBuilder("ThankYouIntent").\
require("ThankYouKeyword").build()
self.register_intent(thank_you_intent, self.handle_thank_you_intent)
def handle_welcome_intent(self, message):
self.speak_dialog("Welcome")
how_are_you_intent = IntentBuilder("HowAreYouIntent").\
require("HowAreYouKeyword").build()
self.register_intent(how_are_you_intent,
self.handle_how_are_you_intent)
hello_world_intent = IntentBuilder("HelloWorldIntent").\
require("HelloWorldKeyword").build()
self.register_intent(hello_world_intent,
self.handle_hello_world_intent)
def handle_thank_you_intent(self, message):
self.speak_dialog("welcome")
def handle_how_are_you_intent(self, message):
self.speak_dialog("how.are.you")
def handle_hello_world_intent(self, message):
self.speak_dialog("hello.world")
def stop(self):
pass
def create_skill():
return WelcomeSkill()
return HelloWorldSkill()

View File

@ -0,0 +1,3 @@
Hello world
Hello
Hi to you too

View File

@ -0,0 +1,6 @@
I'm doing well
Pretty well
Not bad
I'm doing excellent
Could be better
I'm doing very well

View File

@ -3,4 +3,4 @@ Glad to be of service.
Glad to help.
My Pleasure.
No problem.
You're welcome.
You're welcome.

View File

@ -0,0 +1,7 @@
{
"utterance": "Thank you",
"intent_type": "ThankYouIntent",
"intent": {
"ThankYouKeyword": "thank you"
}
}

View File

@ -0,0 +1,7 @@
{
"utterance": "Thanks",
"intent_type": "ThankYouIntent",
"intent": {
"ThankYouKeyword": "thanks"
}
}

View File

@ -0,0 +1,7 @@
{
"utterance": "Hello world",
"intent_type": "HelloWorldIntent",
"intent": {
"HelloWorldKeyword": "hello world"
}
}

View File

@ -0,0 +1,7 @@
{
"utterance": "Greetings",
"intent_type": "HelloWorldIntent",
"intent": {
"HelloWorldKeyword": "greetings"
}
}

View File

@ -0,0 +1,7 @@
{
"utterance": "How are you doing",
"intent_type": "HowAreYouIntent",
"intent": {
"HowAreYouKeyword": "how are you"
}
}

View File

@ -0,0 +1,7 @@
{
"utterance": "How has your day been",
"intent_type": "HowAreYouIntent",
"intent": {
"HowAreYouKeyword": "how has your day been"
}
}

View File

@ -0,0 +1,2 @@
hello world
greetings

View File

@ -0,0 +1,3 @@
how are you
how have you been
how has your day been