Skip to content

Commit

Permalink
#28 #29 fixed merging conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Plugsocket committed Dec 17, 2018
2 parents 1f2da57 + 2f0bd1e commit f5c6152
Show file tree
Hide file tree
Showing 28 changed files with 1,200 additions and 301 deletions.
140 changes: 109 additions & 31 deletions models/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
"name": "AMAZON.StopIntent",
"samples": []
},
{
"name": "HauptmenueIntent",
"slots": [],
"samples": [
"zum Hauptmenue",
"zurueck"
]
},
{
"name": "TellMeCategoriesIntent",
"slots": [],
Expand All @@ -24,13 +32,24 @@
"sag mir alle Kategorien"
]
},
{
"name": "TellMeIngredientsIntent",
"slots": [],
"samples": [
"welche Zutaten brauche ich",
"was fuer Zutaten werden benoetigt",
"sag mir alle Zutaten",
"Zutatenliste vorlesen"
]
},
{
"name": "SetFavoriteIntent",
"slots": [],
"samples": [
"ich moechte ein Rezept favorisieren",
"ich habe einen Favoriten",
"speicherst du einen Favorit fuer mich"
"Rezept favorisieren",
"Favorit waehlen",
"Favoriten waehlen"

]
},
{
Expand All @@ -42,8 +61,8 @@
}
],
"samples": [
"ich moechte meine Favoriten vorlesen lassen",
"welche Favoriten kann ich waehlen",
"Favoriten vorlesen",
"welche Favoriten habe ich",
"lese mir meine Favoriten vor"
]
},
Expand All @@ -66,7 +85,7 @@
"name": "SelectRecipeByNameStartIntent",
"slots": [],
"samples": [
"ich moechte direkt ein Rezept auswaehlen ",
"Rezept direkt auswaehlen",
"Rezeptnamen sagen ",
"zur Namenauswahl "
]
Expand All @@ -80,10 +99,10 @@
}
],
"samples": [
"Ich moechte das Rezept {Recipe} anhoeren",
"Rezept {Recipe} anhoeren",
"Ich haette gerne das Rezept {Recipe}",
"Kannst du das Rezept {Recipe} vorlesen",
"Ich moechte {Recipe} kochen"
"Rezept {Recipe} vorlesen",
"{Recipe} kochen"
]
},
{
Expand All @@ -105,8 +124,8 @@
"name": "SaveRecipeToFavoriteIntent",
"slots": [
{
"name": "FavoritRecipe",
"type": "FavoritRecipes"
"name": "Recipe",
"type": "LIST_OF_RECIPES"
}
],
"samples": [
Expand All @@ -121,16 +140,30 @@
"weiter",
"kannst du mir die Rezeptschritte sagen",
"welche Schritte muss ich befolge",
"was fuer Schritte sind wichtig"
"was fuer Schritte sind wichtig",
"Rezeptschritte vorlesen"
]
},
{
"name": "ModifyRecipeIntent",
"slots": [],
"samples": [
"ich moechte das Rezept aendern",
"kann ich ein Rezept aendern",
"aendere ein Rezept fuer mich"
"Rezept aendern",
"aendere ein Rezept"
]
},
{
"name": "SelectRecipeByFavoritsSelectorIntent",
"slots": [
{
"name": "Recipe",
"type": "LIST_OF_RECIPES"
}
],
"samples": [
"Ich waehle {Recipe} aus Favoriten aus",
"Nehme {Recipe} aus meinen Favoriten",
"Kannst du {Recipe} auswaehlen"
]
},
{
Expand All @@ -143,26 +176,16 @@
{
"name": "Ingredient",
"type": "Ingredient"
}
],
"samples": [
"{Ingredient} anpassen",
"kann ich ein Rezept nach Zutaten aendern",
"{Ingredient} auf {Ingredient_Value} anpassen"
]
},
{
"name": "SelectRecipeByFavoritsSelectorIntent",
"slots": [
},
{
"name": "FavoritRecipe",
"type": "FavoritRecipes"
"name": "Unit",
"type": "Unit"
}
],
"samples": [
"ich moechte einen Favoriten auswaehlen",
"ich waehle einen Favoriten aus der Liste",
"zur Favoritenauswahl"
"{Ingredient} anpassen",
"Rezept nach Zutaten aendern",
"{Ingredient} auf {Ingredient_Value} {Unit} anpassen"
]
},
{
Expand Down Expand Up @@ -253,10 +276,20 @@
{
"name": "FavoritRecipes",
"values": [
{
"name": {
"value": "nudeln"
}
},
{
"name": {
"value": "schnitzel"
}
},
{
"name": {
"value": "milchshake"
}
}
]
},
Expand Down Expand Up @@ -324,6 +357,51 @@
}
}
]
},
{
"name": "Unit",
"values": [
{
"name": {
"value": "milliliter"
}
},
{
"name": {
"value": "gramm"
}
},
{
"name": {
"value": "stueck"
}
},
{
"name": {
"value": "teeloeffel"
}
},
{
"name": {
"value": "essloeffel"
}
},
{
"name": {
"value": "brise"
}
},
{
"name": {
"value": "schuss"
}
},
{
"name": {
"value": "tasse"
}
}
]
}
]
}
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/verkocht/VerkochtStreamHandler.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Expand All @@ -24,7 +23,7 @@
import verkocht.handlers.LaunchRequestHandler;
import verkocht.handlers.ModifyRecipeByUnitsIntentHandler;
import verkocht.handlers.ModifyRecipeIntentHandler;
import verkocht.handlers.SaveRecipeToFavoriteIntentHandler;
import verkocht.handlers.SaveRecipeToFavoriteHandler;
import verkocht.handlers.SelectRecipeByCategoryIntentHandler;
import verkocht.handlers.SelectRecipeByFavoritsSelectorIntentHandler;
import verkocht.handlers.SelectRecipeByFavoritsStartIntentHandler;
Expand All @@ -35,6 +34,7 @@
import verkocht.handlers.SetFavoriteIntentHandler;
import verkocht.handlers.SetNumberOfPeopleIntentHandler;
import verkocht.handlers.TellMeCategoriesIntentHandler;
import verkocht.handlers.TellMeIngredientsIntentHandler;
import verkocht.handlers.TellRecipeStepsIntentHandler;

public class VerkochtStreamHandler extends SkillStreamHandler {
Expand All @@ -48,7 +48,7 @@ private static Skill getSkill() {
new LaunchRequestHandler(),
new ModifyRecipeIntentHandler(),
new ModifyRecipeByUnitsIntentHandler(),
new SaveRecipeToFavoriteIntentHandler(),
new SaveRecipeToFavoriteHandler(),
new SelectRecipeByCategoryIntentHandler(),
new SelectRecipeByFavoritsSelectorIntentHandler(),
new SelectRecipeByFavoritsStartIntentHandler(),
Expand All @@ -59,8 +59,9 @@ private static Skill getSkill() {
new SetFavoriteIntentHandler(),
new SetNumberOfPeopleIntentHandler(),
new TellRecipeStepsIntentHandler(),
new TellMeIngredientsIntentHandler(),
new TellMeCategoriesIntentHandler())
.withSkillId("amzn1.ask.skill.4c560721-fd0a-48db-9101-37b3f9c67a4d")
// .withSkillId("amzn1.ask.skill.c5bc074f-b96e-4343-ba1e-393f8084fe94")
.build();
}

Expand Down
42 changes: 42 additions & 0 deletions src/main/java/verkocht/handlers/HauptmenueIntentHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
except in compliance with the License. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
the specific language governing permissions and limitations under the License.
*/

package verkocht.handlers;

import static com.amazon.ask.request.Predicates.intentName;

import java.util.Optional;

import com.amazon.ask.dispatcher.request.handler.HandlerInput;
import com.amazon.ask.dispatcher.request.handler.RequestHandler;
import com.amazon.ask.model.Response;

import verkocht.model.PhrasesForAlexa;
import verkocht.model.Recipe;

public class HauptmenueIntentHandler implements RequestHandler {

@Override
public boolean canHandle(HandlerInput input) {
return input.matches(intentName("HauptmenueIntent"));
}

@Override
public Optional<Response> handle(HandlerInput input) {
String speechText = PhrasesForAlexa.HAUPTMENUE;
Recipe.saveRecipe(null);

return input.getResponseBuilder().withSpeech(speechText).withSimpleCard("ZumHauptmenue", speechText)
.withReprompt("Wie kann ich dir helfen?").withShouldEndSession(false).build();
}
}
Loading

0 comments on commit f5c6152

Please sign in to comment.