@@ -29,7 +29,7 @@ var helper = require('../../lib/helper');
29
29
* @param {string } params.password Password
30
30
* @constructor
31
31
*/
32
- function LanguageTranslation ( options ) {
32
+ function LanguageTranslator ( options ) {
33
33
// Default URL
34
34
var serviceDefaults = {
35
35
url : 'https://gateway.watsonplatform.net/language-translation/api'
@@ -49,7 +49,7 @@ function LanguageTranslation(options) {
49
49
* @param {string } params.source Filter by source language
50
50
* @param {string } params.target Filter by target language
51
51
*/
52
- LanguageTranslation . prototype . getModels = function ( params , callback ) {
52
+ LanguageTranslator . prototype . getModels = function ( params , callback ) {
53
53
params = params || { } ;
54
54
55
55
var parameters = {
@@ -68,7 +68,7 @@ LanguageTranslation.prototype.getModels = function(params, callback) {
68
68
* Return the translation model
69
69
* @param {string } params.model_id The model identifier
70
70
*/
71
- LanguageTranslation . prototype . getModel = function ( params , callback ) {
71
+ LanguageTranslator . prototype . getModel = function ( params , callback ) {
72
72
params = params || { } ;
73
73
74
74
var parameters = {
@@ -92,7 +92,7 @@ LanguageTranslation.prototype.getModel = function(params, callback) {
92
92
* @param {stream } params.parallel_corpus A UTF-8 encoded TMX file that contains matching phrases in the source and target language that serve as examples for Watson. Parallel corpora differ from glossaries because they do not overwrite the original domain data.
93
93
* @param {stream } params.monolingual_corpus A UTF-8 encoded plain text file that contains a body of text in the target language that is related to what you are translating. A monolingual corpus helps improve literal translations to be more fluent and human.
94
94
*/
95
- LanguageTranslation . prototype . createModel = function ( params , callback ) {
95
+ LanguageTranslator . prototype . createModel = function ( params , callback ) {
96
96
params = params || { } ;
97
97
98
98
var missingParams = helper . getMissingParams ( params , [ 'base_model_id' ] ) ;
@@ -129,7 +129,7 @@ LanguageTranslation.prototype.createModel = function(params, callback) {
129
129
* Deletes a model
130
130
* @param {string } params.model_id The model identifier
131
131
*/
132
- LanguageTranslation . prototype . deleteModel = function ( params , callback ) {
132
+ LanguageTranslator . prototype . deleteModel = function ( params , callback ) {
133
133
params = params || { } ;
134
134
135
135
var parameters = {
@@ -150,7 +150,7 @@ LanguageTranslation.prototype.deleteModel = function(params, callback) {
150
150
* @param {string } params.source Source language
151
151
* @param {string } params.target Target language
152
152
*/
153
- LanguageTranslation . prototype . translate = function ( params , callback ) {
153
+ LanguageTranslator . prototype . translate = function ( params , callback ) {
154
154
params = params || { } ;
155
155
156
156
if ( ! ( params . model_id || ( params . source && params . target ) ) ) {
@@ -174,7 +174,7 @@ LanguageTranslation.prototype.translate = function(params, callback) {
174
174
/**
175
175
* Returns the identifiable languages
176
176
*/
177
- LanguageTranslation . prototype . getIdentifiableLanguages = function ( params , callback ) {
177
+ LanguageTranslator . prototype . getIdentifiableLanguages = function ( params , callback ) {
178
178
params = params || { } ;
179
179
180
180
var parameters = {
@@ -193,7 +193,7 @@ LanguageTranslation.prototype.getIdentifiableLanguages = function(params, callba
193
193
* Identify the text based on the identifiable languages
194
194
* @param {string } params.text text to identify
195
195
*/
196
- LanguageTranslation . prototype . identify = function ( params , callback ) {
196
+ LanguageTranslator . prototype . identify = function ( params , callback ) {
197
197
if ( ! params || ! params . text ) {
198
198
callback ( new Error ( 'Missing required parameters: text' ) ) ;
199
199
return ;
@@ -216,4 +216,4 @@ LanguageTranslation.prototype.identify = function(params, callback) {
216
216
return requestFactory ( parameters , callback ) ;
217
217
} ;
218
218
219
- module . exports = LanguageTranslation ;
219
+ module . exports = LanguageTranslator ;
0 commit comments