"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IntentsProcessor = void 0;
var object_tools_1 = require("./util/object-tools");
var IntentsProcessor = /** @class */ (function () {
    function IntentsProcessor() {
        this._encoder = {};
        this._decoder = {};
    }
    Object.defineProperty(IntentsProcessor.prototype, "intentsCount", {
        get: function () {
            return Object.entries(this._encoder).length;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IntentsProcessor.prototype, "decoder", {
        get: function () {
            return this._decoder;
        },
        enumerable: false,
        configurable: true
    });
    IntentsProcessor.prototype.loadEncoderDecoder = function (decoder) {
        this._encoder = object_tools_1.flipObject(decoder);
        this._decoder = decoder;
    };
    IntentsProcessor.prototype.generateEncoderDecoder = function (data) {
        var _this = this;
        var id = 0;
        data.forEach(function (sample) {
            if (!(sample.label in _this._encoder)) {
                _this._encoder[sample.label] = id;
                id++;
            }
        });
        this._decoder = object_tools_1.flipObject(this._encoder);
    };
    IntentsProcessor.prototype.encode = function (intents) {
        return this._encoder[intents];
    };
    IntentsProcessor.prototype.decode = function (intentId) {
        return this._decoder[intentId];
    };
    return IntentsProcessor;
}());
exports.IntentsProcessor = IntentsProcessor;
//# sourceMappingURL=intents-processor.js.map