node-nlp
Version:
Library for NLU (Natural Language Understanding) done in Node.js
42 lines (41 loc) • 1.73 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var ActionSet_1 = require("./ActionSet");
var ResumeReason;
(function (ResumeReason) {
ResumeReason[ResumeReason["completed"] = 0] = "completed";
ResumeReason[ResumeReason["notCompleted"] = 1] = "notCompleted";
ResumeReason[ResumeReason["canceled"] = 2] = "canceled";
ResumeReason[ResumeReason["back"] = 3] = "back";
ResumeReason[ResumeReason["forward"] = 4] = "forward";
ResumeReason[ResumeReason["reprompt"] = 5] = "reprompt";
})(ResumeReason = exports.ResumeReason || (exports.ResumeReason = {}));
var Dialog = (function (_super) {
__extends(Dialog, _super);
function Dialog() {
return _super !== null && _super.apply(this, arguments) || this;
}
Dialog.prototype.begin = function (session, args) {
this.replyReceived(session);
};
Dialog.prototype.dialogResumed = function (session, result) {
if (result.error) {
session.error(result.error);
}
};
Dialog.prototype.recognize = function (context, cb) {
cb(null, { score: 0.1 });
};
return Dialog;
}(ActionSet_1.ActionSet));
exports.Dialog = Dialog;
;