File: /home/padewitte/projets/webcomponents/myscript-js/src/input/text/textParameter.js
'use strict';
(function (scope) {
/**
* Parameters used for text recognition
*
* @class TextParameter
* @extends AbstractParameter
* @constructor
*/
function TextParameter(obj) {
scope.AbstractParameter.call(this, obj);
this.textProperties = new scope.TextProperties();
if (obj) {
if (obj.language) {
this.language = obj.language;
}
if (obj.textInputMode) {
this.textInputMode = obj.textInputMode;
}
if (obj.contentTypes) {
this.contentTypes = obj.contentTypes;
}
if (obj.subsetKnowledges) {
this.subsetKnowledges = obj.subsetKnowledges;
}
if (obj.userResources) {
this.userResources = obj.userResources;
}
if (obj.userLkWords) {
this.userLkWords = obj.userLkWords;
}
if (obj.resultDetail) {
this.resultDetail = obj.resultDetail;
}
if (obj.textProperties) {
this.textProperties = new scope.TextProperties(obj.textProperties);
}
}
}
/**
* Inheritance property
*/
TextParameter.prototype = new scope.AbstractParameter();
/**
* Constructor property
*/
TextParameter.prototype.constructor = TextParameter;
/**
* Get recognition language
*
* @method getLanguage
* @returns {String}
*/
TextParameter.prototype.getLanguage = function () {
return this.language;
};
/**
* Set recognition language
*
* @method getLanguage
* @param {String} language
*/
TextParameter.prototype.setLanguage = function (language) {
this.language = language;
};
/**
* Get input mode
*
* @method getInputMode
* @returns {'CURSIVE'|'ISOLATED'|'SUPERIMPOSED'|'VERTICAL'}
*/
TextParameter.prototype.getInputMode = function () {
return this.textInputMode;
};
/**
* Set input mode
*
* @method setInputMode
* @param {'CURSIVE'|'ISOLATED'|'SUPERIMPOSED'|'VERTICAL'} inputMode
*/
TextParameter.prototype.setInputMode = function (inputMode) {
this.textInputMode = inputMode;
};
/**
* Get content types
*
* @method getContentTypes
* @returns {Array}
*/
TextParameter.prototype.getContentTypes = function () {
return this.contentTypes;
};
/**
* Set content types
*
* @method setContentTypes
* @param {Array} contentTypes
*/
TextParameter.prototype.setContentTypes = function (contentTypes) {
this.contentTypes = contentTypes;
};
/**
* Get SK
*
* @method getSubsetKnowledges
* @returns {Array}
*/
TextParameter.prototype.getSubsetKnowledges = function () {
return this.subsetKnowledges;
};
/**
* Set SK
*
* @method setSubsetKnowledges
* @param {Array} subsetKnowledges
*/
TextParameter.prototype.setSubsetKnowledges = function (subsetKnowledges) {
this.subsetKnowledges = subsetKnowledges;
};
/**
* Get user resources
*
* @method getUserResources
* @returns {Array}
*/
TextParameter.prototype.getUserResources = function () {
return this.userResources;
};
/**
* Set user resources
*
* @method setUserResources
* @param {Array} userResources
*/
TextParameter.prototype.setUserResources = function (userResources) {
this.userResources = userResources;
};
/**
* Get user LK words
*
* @method getUserLkWords
* @returns {Array}
*/
TextParameter.prototype.getUserLkWords = function () {
return this.userLkWords;
};
/**
* Set user LK words
*
* @method setUserLkWords
* @param {Array} userLkWords
*/
TextParameter.prototype.setUserLkWords = function (userLkWords) {
this.userLkWords = userLkWords;
};
/**
* Get result detail (e.g. TEXT, WORD ...)
*
* @method getResultDetail
* @returns {'TEXT'|'WORD'|'CHARACTER'}
*/
TextParameter.prototype.getResultDetail = function () {
return this.resultDetail;
};
/**
* Set result detail (e.g. TEXT, WORD ...)
*
* @method setResultDetail
* @param {'TEXT'|'WORD'|'CHARACTER'} resultDetail
*/
TextParameter.prototype.setResultDetail = function (resultDetail) {
this.resultDetail = resultDetail;
};
/**
* Get text properties
*
* @method getTextProperties
* @returns {TextProperties}
*/
TextParameter.prototype.getTextProperties = function () {
return this.textProperties;
};
/**
* Set text properties
*
* @method setTextProperties
* @param {TextProperties} properties
*/
TextParameter.prototype.setTextProperties = function (textProperties) {
this.textProperties = textProperties;
};
// Export
scope.TextParameter = TextParameter;
})(MyScript);