Skip to content

Instantly share code, notes, and snippets.

@tagazok
Created September 27, 2018 07:13
Show Gist options
  • Select an option

  • Save tagazok/145fc9228b41f006d909623480fc9182 to your computer and use it in GitHub Desktop.

Select an option

Save tagazok/145fc9228b41f006d909623480fc9182 to your computer and use it in GitHub Desktop.
Botfuel-snippets
"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