diff --git a/core/skills-endpoints.json b/core/skills-endpoints.json index d81fcbcc..351db5bd 100644 --- a/core/skills-endpoints.json +++ b/core/skills-endpoints.json @@ -1,5 +1,35 @@ { "endpoints": [ + { + "method": "GET", + "route": "/api/action/leon/birthday/leon_birthday", + "params": [] + }, + { + "method": "GET", + "route": "/api/action/leon/birthday/when_birthday", + "params": [] + }, + { + "method": "GET", + "route": "/api/action/leon/birthday/my_birthday", + "params": [] + }, + { + "method": "GET", + "route": "/api/action/leon/birthday/color_meaning", + "params": [] + }, + { + "method": "GET", + "route": "/api/action/leon/birthday/specific_color_meaning", + "params": [] + }, + { + "method": "GET", + "route": "/api/action/leon/birthday/why", + "params": [] + }, { "method": "GET", "route": "/api/action/leon/color/favorite_color", diff --git a/server/src/core/ner.js b/server/src/core/ner.js index 9f42c704..5fc3339e 100644 --- a/server/src/core/ner.js +++ b/server/src/core/ner.js @@ -80,7 +80,10 @@ class Ner { const conditionMethod = `add${string.snakeToPascalCase(condition.type)}Condition` if (condition.type === 'between') { - // e.g. list.addBetweenCondition('en', 'list', 'create a', 'list') + /** + * Conditions: https://github.com/axa-group/nlp.js/blob/master/docs/v3/ner-manager.md#trim-named-entities + * e.g. list.addBetweenCondition('en', 'list', 'create a', 'list') + */ this.ner[conditionMethod](lang, entity.name, condition.from, condition.to) } else if (condition.type.indexOf('after') !== -1) { const rule = { diff --git a/skills/leon/birthday/README.md b/skills/leon/birthday/README.md new file mode 100644 index 00000000..e69de29b diff --git a/skills/leon/birthday/memory/.gitkeep b/skills/leon/birthday/memory/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/skills/leon/birthday/nlu/en.json b/skills/leon/birthday/nlu/en.json new file mode 100644 index 00000000..406314d9 --- /dev/null +++ b/skills/leon/birthday/nlu/en.json @@ -0,0 +1,66 @@ +{ + "actions": { + "leon_birthday": { + "type": "dialog", + "utterance_samples": [ + "What's your birth date?", + "How old are you?", + "When are you born?", + "May I know when is your birthday?" + ], + "answers": [ + "I'm born in February 2019.", + "My first version has been released in February 2019." + ] + }, + "when_birthday": { + "type": "logic", + "utterance_samples": [ + "Do you know when is my birthday?", + "Do you remember when I am born?", + "Do you know my birth date?", + "When is Phoebe's birthday?", + "Give me my birth date" + ], + "entities": [ + { + "type": "trim", + "name": "person", + "conditions": [ + { + "type": "before_last", + "to": ["birthday", "birth date"] + }, + { + "type": "between", + "from": ["when"], + "to": ["am","was"] + } + ] + } + ], + "slots": [ + { + "name": "birth_date", + "type": "date" + } + ], + "answers": { + "birthday_found": [ + "%person%'s birthday is the %birth_date%", + "%person% is born the %birth_date%" + ], + "birthday_not_found": [ + "I'm not sure to remember, would you please tell me what is %person%'s birth date?", + "I do not know, please share %person% birth date." + ] + } + }, + "my_birthday": { + "utterance_samples": [ + "My birthday is the 6th of August", + "I am born the @day of @month " + ] + } + } +} diff --git a/skills/leon/birthday/skill.json b/skills/leon/birthday/skill.json new file mode 100644 index 00000000..ff56779a --- /dev/null +++ b/skills/leon/birthday/skill.json @@ -0,0 +1,12 @@ +{ + "name": "Birthday", + "type": "dialog", + "bridge": null, + "version": "1.0.0", + "description": "Leon remembers birthdays and talk about his.", + "author": { + "name": "Louis Grenard", + "email": "louis.grenard@gmail.com", + "url": "https://github.com/louistiti" + } +} diff --git a/skills/leon/birthday/test/.gitkeep b/skills/leon/birthday/test/.gitkeep new file mode 100644 index 00000000..e69de29b