Created
September 27, 2018 07:13
-
-
Save tagazok/145fc9228b41f006d909623480fc9182 to your computer and use it in GitHub Desktop.
Botfuel-snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "Create botfuel dialog": { | |
| "prefix": "botfuel.dialog", | |
| "description": "Create a new botfuel dialog", | |
| "body": [ | |
| "const { ${1}Dialog } = require('botfuel-dialog');", | |
| "class ${2}Dialog extends ${1}Dialog {", | |
| "}", | |
| "", | |
| "${2}Dialog.params = {", | |
| "\tnamespace: '${3}',", | |
| "\tentities: {", | |
| "\t},", | |
| "};", | |
| "module.exports = ${2}Dialog;", | |
| ], | |
| }, | |
| "Create botfuel view": { | |
| "prefix": "botfuel.view", | |
| "description": "Create a new botfuel view", | |
| "body": [ | |
| "const { View } = require('botfuel-dialog');", | |
| "class ${1}View extends View {", | |
| "\trender() {", | |
| "\t\treturn [", | |
| "\t\t];", | |
| "\t}", | |
| "}", | |
| "", | |
| "module.exports = ${1}View;" | |
| ], | |
| }, | |
| "Create botfuel Ws Extractor": { | |
| "prefix": "botfuel.extractor-ws", | |
| "description": "Create botfuel ws extractor", | |
| "body": [ | |
| "const { WsExtractor } = require('botfuel-dialog');", | |
| "", | |
| "class ${1}Extractor extends WsExtractor {}", | |
| "", | |
| "${1}Extractor.params = {", | |
| "\tdimensions: [${2}],", | |
| "};", | |
| "", | |
| "module.exports = ${1}Extractor;" | |
| ], | |
| }, | |
| "Create botfuel Corpus Extractor": { | |
| "prefix": "botfuel.extractor-corpus", | |
| "description": "Create botfuel corpus extractor", | |
| "body": [ | |
| "const { CorpusExtractor, FileCorpus } = require('botfuel-dialog');", | |
| "", | |
| "class ${1}Extractor extends CorpusExtractor {", | |
| "\tconstructor() {", | |
| "\t\tsuper({", | |
| "\t\t\tdimension: '${2}',", | |
| "\t\t\tcorpus: new FileCorpus(`${__dirname}/../corpora/${3}.txt`),", | |
| "\t\t\toptions: {},", | |
| "\t\t});", | |
| "\t}", | |
| "}", | |
| "", | |
| "module.exports = ${1}Extractor;" | |
| ], | |
| }, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment