rosette
- Accepts a Rosette API endpoint name and forwards user parameters to the endpoint
+ Accepts an Analytics API endpoint name and forwards user parameters to the endpoint
@@ -442,7 +442,7 @@
/**
- * Rosette API.
+ * Babel Street Analytics API.
*
- * @copyright 2016-2019 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -52,18 +52,20 @@
Source: Api.js
var addressSimilarity = require("./addressSimilarity")
var categories = require("./categories");
var entities = require("./entities");
+var events = require("./events");
var info = require("./info");
var language = require("./language");
var matchedName = require("./nameSimilarity");
var morphology = require("./morphology");
var nameDeduplication = require("./nameDeduplication");
var ping = require("./ping");
+var recordSimilarity = require("./recordSimilarity");
var relationships = require("./relationships");
var semanticVectors = require("./semanticVectors");
var sentences = require("./sentences");
var sentiment = require("./sentiment");
var similarTerms = require("./similarTerms");
-var syntax_dependencies = require("./syntax_dependencies");
+var syntaxDependencies = require("./syntax_dependencies");
var textEmbedding = require("./textEmbedding");
var tokens = require("./tokens");
var topics = require("./topics");
@@ -78,19 +80,19 @@
Source: Api.js
* Api server endpoints.
*
* @example var api = new API(userKey, serviceUrl);
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function Api(userKey, serviceURL) {
/**
* @type {string}
- * @desc The Rosette API key used for authentication
+ * @desc The Analytics API key used for authentication
*/
this.userKey = userKey;
/**
* @type {object}
- * @desc The Rosette API endpoint parameters
+ * @desc The Analytics API endpoint parameters
*/
this.parameters = new paramObj();
@@ -106,30 +108,33 @@
Source: Api.js
* @default
*/
if (serviceURL) {
- if (serviceURL.slice(-1) != '/') {
+ if (serviceURL.slice(-1) !== '/') {
serviceURL = serviceURL.concat('/')
this.serviceURL = serviceURL;
} else {
this.serviceURL = serviceURL;
}
} else {
- this.serviceURL = "https://api.rosette.com/rest/v1/";
+ this.serviceURL = "https://analytics.babelstreet.com/rest/v1/";
}
var urlParts = URL.parse(this.serviceURL);
if (urlParts.protocol === "http:") {
this.protocol = http;
}
-};
+}
/**
* @type {string}
- * @desc Accepts a Rosette API endpoint name and forwards user parameters to the endpoint
- * @param {string} endpoint - The Rosette API endpoint to be utilized
+ * @desc Accepts an Analytics API endpoint name and forwards user parameters to the endpoint
+ * @param {string} endpoint - The Analytics API endpoint to be utilized
*/
Api.prototype.rosette = function(endpoint, callback) {
var api = this;
+ if (typeof(api.parameters.genre) !== 'undefined' && api.parameters.genre != null) {
+ console.warn("The genre parameter is deprecated and will be removed in a future release.");
+ }
endpoint = require("./" + endpoint);
var e = new endpoint();
@@ -154,13 +159,13 @@
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2019 Basis Technology Corporation.
+ * @copyright 2019-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,19 +50,19 @@
Source: addressSimilarity.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function addressSimilarity() {
-
-};
+// Works as a constructor
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
addressSimilarity.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
@@ -92,13 +92,13 @@
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,37 +50,23 @@
Source: categories.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function categories() {
-
-};
+// constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
categories.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
-
- if (parameters.documentFile != null) {
- parameters.loadFile(parameters.documentFile, parameters, userKey, protocol, serviceURL, "categories", callback);
- } else {
- // validate parameters
- if (!parameters.loadParams().content && !parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Must supply one of content or contentUri", "bad arguments"));
- } else if (parameters.loadParams().content != null && parameters.loadParams().contentUri != null) {
- return callback(new RosetteException("badArgument", "Cannot supply content and contentUri", "bad arguments"));
- } else {
- // configure URL
- var urlParts = URL.parse(serviceURL + "categories");
- var req = new rosetteRequest();
- req.makeRequest('POST', userKey, protocol, urlParts, parameters, callback);
- }
- }
+ var req = new rosetteRequest();
+ req.makeDocumentRequest("categories", parameters, userKey, protocol, serviceURL, callback);
};
module.exports = categories;
@@ -94,13 +80,13 @@
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,37 +50,23 @@
Source: entities.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function entities() {
-
-};
+// constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
entities.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
-
- if (parameters.documentFile != null) {
- parameters.loadFile(parameters.documentFile, parameters, userKey, protocol, serviceURL, "entities", callback);
- } else {
- // validate parameters
- if (!parameters.loadParams().content && !parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Must supply one of Content or ContentUri", "bad arguments"));
- } else if (parameters.loadParams().content && parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Cannot supply both Content and ContentUri", "bad arguments"));
- } else {
- // configure URL
- var urlParts = URL.parse(serviceURL + "entities");
- var req = new rosetteRequest();
- req.makeRequest('POST', userKey, protocol, urlParts, parameters, callback);
- }
- }
+ var req = new rosetteRequest();
+ req.makeDocumentRequest("entities", parameters, userKey, protocol, serviceURL, callback);
};
module.exports = entities;
@@ -94,13 +80,13 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/events.js.html b/events.js.html
new file mode 100644
index 0000000..1bbf141
--- /dev/null
+++ b/events.js.html
@@ -0,0 +1,95 @@
+
+
+
+
+ JSDoc: Source: events.js
+
+
+
+
+
+
+
+
+
+
+
+
+
Source: events.js
+
+
+
+
+
+
+
+
+
/**
+ * Analytics API.
+ *
+ * @copyright 2024 Basis Technology Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * @license http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the License.
+ **/
+"use strict";
+
+var URL = require("url");
+
+var rosetteConstants = require("./rosetteConstants");
+var RosetteException = require("./rosetteExceptions");
+var rosetteRequest = require("./rosetteRequest");
+
+/**
+ * @class
+ *
+ * @copyright 2024 Basis Technology Corporation.
+ * @license http://www.apache.org/licenses/LICENSE-2.0
+ */
+function events() {
+// constructor function
+}
+
+/**
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
+ */
+events.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
+ var req = new rosetteRequest();
+ req.makeDocumentRequest("events", parameters, userKey, protocol, serviceURL, callback);
+};
+
+module.exports = events;
+
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,19 +50,19 @@
Source: info.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function info() {
-
-};
+//constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
info.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
@@ -83,13 +83,13 @@
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,37 +50,23 @@
Source: language.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function language() {
-
-};
+//constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
language.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
-
- if (parameters.documentFile != null) {
- parameters.loadFile(parameters.documentFile, parameters, userKey, protocol, serviceURL, "language", callback);
- } else {
- // validate parameters
- if (!parameters.loadParams().content && !parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Must supply one of Content or ContentUri", "bad arguments"));
- } else if (parameters.loadParams().content && parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Cannot supply both Content and ContentUri", "bad arguments"));
- } else {
- // configure URL
- var urlParts = URL.parse(serviceURL + "language");
- var req = new rosetteRequest();
- req.makeRequest('POST', userKey, protocol, urlParts, parameters, callback);
- }
- }
+ var req = new rosetteRequest();
+ req.makeDocumentRequest("language", parameters, userKey, protocol, serviceURL, callback);
};
module.exports = language;
@@ -94,13 +80,13 @@
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,35 +50,36 @@
Source: morphology.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function morphology() {
-
-};
+//constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
morphology.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
if (parameters.documentFile != null) {
- parameters.loadFile(parameters.documentFile, parameters, userKey, protocol, serviceURL, "morphology" + "/" + parameters.morphology, callback);
+ parameters.loadFile(parameters.documentFile, parameters, userKey, protocol, serviceURL, `morphology/${parameters.morphology}`, callback);
} else {
+ var responseMessage = "bad arguments";
// validate parameters
if (!parameters.loadParams().content && !parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Must supply one of Content or ContentUri", "bad arguments"));
+ return callback(new RosetteException("badArgument", "Must supply one of Content or ContentUri", responseMessage));
} else if (parameters.loadParams().content && parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Cannot supply both Content and ContentUri", "bad arguments"));
+ return callback(new RosetteException("badArgument", "Cannot supply both Content and ContentUri", responseMessage));
} else if (!parameters.morphology) {
- return callback(new RosetteException("badArgument", "Must supply type of morphology", "bad arguments"));
+ return callback(new RosetteException("badArgument", "Must supply type of morphology", responseMessage));
} else {
// configure URL
- var urlParts = URL.parse(serviceURL + "morphology" + "/" + parameters.morphology);
+ var urlParts = URL.parse(serviceURL + `morphology/${parameters.morphology}`);
var req = new rosetteRequest();
req.makeRequest('POST', userKey, protocol, urlParts, parameters, callback);
}
@@ -96,13 +97,13 @@
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,19 +50,19 @@
Source: nameDeduplication.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function nameDeduplication() {
-
-};
+//constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
nameDeduplication.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
@@ -92,13 +92,13 @@
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,19 +50,19 @@
Source: nameSimilarity.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function nameSimilarity() {
-
-};
+//constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
nameSimilarity.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
@@ -92,13 +92,13 @@
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,30 +50,30 @@
Source: nameTranslation.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function nameTranslation() {
-
-};
+//constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
nameTranslation.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
-
+ var responseMessage = "bad arguments";
if (parameters.documentFile != null) {
- return callback(new RosetteException("badArgument", "Name translation does not support documentFile", "bad arguments"));
+ return callback(new RosetteException("badArgument", "Name translation does not support documentFile", responseMessage));
} else {
// validate parameters
if (!parameters.loadParams().name) {
- return callback(new RosetteException("badArgument", "Must supply name parameter", "bad arguments"));
+ return callback(new RosetteException("badArgument", "Must supply name parameter", responseMessage));
} else if (!parameters.loadParams().targetLanguage) {
- return callback(new RosetteException("badArgument", "Must supply target language parameter", "bad arguments"));
+ return callback(new RosetteException("badArgument", "Must supply target language parameter", responseMessage));
} else {
// configure URL
var urlParts = URL.parse(serviceURL + "name-translation");
@@ -94,13 +94,13 @@
- Loads all non-null parameters into a new JSON that will be used as parameters for a Rosette API endpoint
+ Loads all non-null parameters into a new JSON that will be used as parameters for an Analytics API endpoint
Parameters that start with '_' are internal and not included in the endpoint request
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2019 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -58,12 +58,12 @@
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,19 +50,19 @@
Source: ping.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function ping() {
-
-};
+//constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
ping.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
@@ -83,13 +83,13 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/recordSimilarity.js.html b/recordSimilarity.js.html
new file mode 100644
index 0000000..98ad50e
--- /dev/null
+++ b/recordSimilarity.js.html
@@ -0,0 +1,109 @@
+
+
+
+
+ JSDoc: Source: recordSimilarity.js
+
+
+
+
+
+
+
+
+
+
+
+
+
Source: recordSimilarity.js
+
+
+
+
+
+
+
+
+
/**
+ * Analytics API.
+ *
+ * @copyright 2024 Basis Technology Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * @license http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the License.
+ **/
+"use strict";
+
+var URL = require("url");
+
+var rosetteConstants = require("./rosetteConstants");
+var RosetteException = require("./rosetteExceptions");
+var rosetteRequest = require("./rosetteRequest");
+
+/**
+ * @class
+ *
+ * @copyright 2024 Basis Technology Corporation.
+ * @license http://www.apache.org/licenses/LICENSE-2.0
+ */
+function recordSimilarity() {
+//constructor function
+}
+
+/**
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
+ */
+recordSimilarity.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
+
+ if (parameters.documentFile != null) {
+ return callback(new RosetteException("badArgument", "Record similarity does not support documentFile", "bad arguments"));
+ } else {
+ // validate parameters
+ if (!parameters.loadParams().records) {
+ return callback(new RosetteException("badArgument", "Required Record Similarity parameter is missing: 'records'"));
+ } else if (!parameters.loadParams().fields) {
+ return callback(new RosetteException("badArgument", "Required Record Similarity parameter is missing: 'fields'"));
+ } else {
+ // configure URL
+ var urlParts = URL.parse(serviceURL + "record-similarity");
+ var req = new rosetteRequest();
+ req.makeRequest('POST', userKey, protocol, urlParts, parameters, callback);
+ }
+ }
+};
+
+module.exports = recordSimilarity;
+
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,37 +50,23 @@
Source: relationships.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function relationships() {
-
-};
+//constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
relationships.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
-
- if (parameters.documentFile != null) {
- parameters.loadFile(parameters.documentFile, parameters, userKey, protocol, serviceURL, "relationships", callback);
- } else {
- // validate parameters
- if (!parameters.loadParams().content && !parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Must supply one of Content or ContentUri", "bad arguments"));
- } else if (parameters.loadParams().content && parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Cannot supply both Content and ContentUri", "bad arguments"));
- } else {
- // configure URL
- var urlParts = URL.parse(serviceURL + "relationships");
- var req = new rosetteRequest();
- req.makeRequest('POST', userKey, protocol, urlParts, parameters, callback);
- }
- }
+ var req = new rosetteRequest();
+ req.makeDocumentRequest("relationships", parameters, userKey, protocol, serviceURL, callback);
};
module.exports = relationships;
@@ -94,13 +80,13 @@
/**
- * Container for the Rosette Constants.
+ * Container for the Analytics Constants.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -66,8 +66,12 @@
Source: rosetteConstants.js
"COMPLETE": "complete"
};
+//todo make sure that version is overwritten here in rapid developer tools publishing
+var BINDING_VERSION = "1.31.0";
+
exports.dataFormat = dataFormat;
exports.morpholoyOutput = morphologyOutput;
+exports.BINDING_VERSION = BINDING_VERSION;
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -303,7 +303,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -56,29 +56,33 @@
Source: rosetteRequest.js
*
* @type string
*/
-var BINDING_VERSION = "1.14.4";
-var USER_AGENT = "rosetteapinode/" + BINDING_VERSION + "/" + process.version;
+var BINDING_VERSION = rosetteConstants.BINDING_VERSION;
+var USER_AGENT = `Babel-Street-Analytics-API-Node/${BINDING_VERSION}/${process.version}`;
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function rosetteRequest() {
+// constructor function
+}
-};
-
-rosetteRequest.prototype.bindingVersion = function() { return BINDING_VERSION; }
-rosetteRequest.prototype.userAgent = function() { return USER_AGENT; }
+rosetteRequest.prototype.bindingVersion = function() {
+ return BINDING_VERSION;
+}
+rosetteRequest.prototype.userAgent = function() {
+ return USER_AGENT;
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
* @param {string} requestType - GET/POST
- * @param {string} userKey - The Rosette API user access key
+ * @param {string} userKey - The Analytics API user access key
* @param {object} urlParts - Structure containing the url parameters
* @param {object} parameters - Structure containing the API parameters
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
rosetteRequest.prototype.makeRequest = function(requestType, userKey, protocol, urlParts, parameters, callback) {
var headers = {
@@ -86,14 +90,18 @@
Source: rosetteRequest.js
"accept-encoding": "gzip",
"content-type": "application/json",
"user-agent": USER_AGENT,
+ "X-BabelStreetAPI-Binding": "nodejs",
+ "X-BabelStreetAPI-Binding-Version": BINDING_VERSION,
+ //todo remove these in the future
"X-RosetteAPI-Binding": "nodejs",
"X-RosetteAPI-Binding-Version": BINDING_VERSION
}
if (userKey != null) {
- headers["X-RosetteAPI-Key"] = userKey;
+ headers["X-BabelStreetAPI-Key"] = userKey;
}
+ // to see custom headers format example in languages examples
if (parameters.customHeaders != null) {
parameters.customHeaders.forEach(function(element, index) {
headers[element[0]] = element[1];
@@ -104,7 +112,7 @@
Source: rosetteRequest.js
var path = urlParts.path;
if (parameters.urlParameters != null) {
- path = path + '?' + querystring.stringify(parameters.urlParameters);
+ path = `${path}?${querystring.stringify(parameters.urlParameters)}`;
}
var options = {
@@ -119,50 +127,67 @@
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,37 +50,23 @@
Source: semanticVectors.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function semanticVectors() {
-
-};
+//constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
semanticVectors.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
-
- if (parameters.documentFile != null) {
- parameters.loadFile(parameters.documentFile, parameters, userKey, protocol, serviceURL, "semantics/vector", callback);
- } else {
- // validate parameters
- if (!parameters.loadParams().content && !parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Must supply one of Content or ContentUri", "bad arguments"));
- } else if (parameters.loadParams().content && parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Cannot supply both Content and ContentUri", "bad arguments"));
- } else {
- // configure URL
- var urlParts = URL.parse(serviceURL + "semantics/vector");
- var req = new rosetteRequest();
- req.makeRequest('POST', userKey, protocol, urlParts, parameters, callback);
- }
- }
+ var req = new rosetteRequest();
+ req.makeDocumentRequest("semantics/vector", parameters, userKey, protocol, serviceURL, callback);
};
module.exports = semanticVectors;
@@ -94,13 +80,13 @@
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,37 +50,23 @@
Source: sentences.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function sentences() {
-
-};
+//constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
sentences.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
-
- if (parameters.documentFile != null) {
- parameters.loadFile(parameters.documentFile, parameters, userKey, protocol, serviceURL, "sentences", callback);
- } else {
- // validate parameters
- if (!parameters.loadParams().content && !parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Must supply one of Content or ContentUri", "bad arguments"));
- } else if (parameters.loadParams().content && parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Cannot supply both Content and ContentUri", "bad arguments"));
- } else {
- // configure URL
- var urlParts = URL.parse(serviceURL + "sentences");
- var req = new rosetteRequest();
- req.makeRequest('POST', userKey, protocol, urlParts, parameters, callback);
- }
- }
+ var req = new rosetteRequest();
+ req.makeDocumentRequest("sentences", parameters, userKey, protocol, serviceURL, callback);
};
module.exports = sentences;
@@ -94,13 +80,13 @@
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,37 +50,23 @@
Source: sentiment.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function sentiment() {
-
-};
+//constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
sentiment.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
-
- if (parameters.documentFile != null) {
- parameters.loadFile(parameters.documentFile, parameters, userKey, protocol, serviceURL, "sentiment", callback);
- } else {
- // validate parameters
- if (!parameters.loadParams().content && !parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Must supply one of Content or ContentUri", "bad arguments"));
- } else if (parameters.loadParams().content && parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Cannot supply both Content and ContentUri", "bad arguments"));
- } else {
- // configure URL
- var urlParts = URL.parse(serviceURL + "sentiment");
- var req = new rosetteRequest();
- req.makeRequest('POST', userKey, protocol, urlParts, parameters, callback);
- }
- }
+ var req = new rosetteRequest();
+ req.makeDocumentRequest("sentiment", parameters, userKey, protocol, serviceURL, callback);
};
module.exports = sentiment;
@@ -94,13 +80,13 @@
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2018 Basis Technology Corporation.
+ * @copyright 2018-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,40 +50,27 @@
Source: similarTerms.js
/**
* @class
*
- * @copyright 2018 Basis Technology Corporation.
+ * @copyright 2018-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function similarTerms() {
-
-};
+//constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
similarTerms.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
-
- if (parameters.documentFile != null) {
- parameters.loadFile(parameters.documentFile, parameters, userKey, protocol, serviceURL, "semantics/similar", callback);
- } else {
- // validate parameters
- if (!parameters.loadParams().content && !parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Must supply one of content or contentUri", "bad arguments"));
- } else if (parameters.loadParams().content != null && parameters.loadParams().contentUri != null) {
- return callback(new RosetteException("badArgument", "Cannot supply content and contentUri", "bad arguments"));
- } else {
- // configure URL
- var urlParts = URL.parse(serviceURL + "semantics/similar");
- var req = new rosetteRequest();
- req.makeRequest('POST', userKey, protocol, urlParts, parameters, callback);
- }
- }
+ var req = new rosetteRequest();
+ req.makeDocumentRequest("semantics/similar", parameters, userKey, protocol, serviceURL, callback);
};
-module.exports = similarTerms;
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,37 +50,23 @@
Source: syntax_dependencies.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function syntax_dependencies() {
-
-};
+//constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
syntax_dependencies.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
-
- if (parameters.documentFile != null) {
- parameters.loadFile(parameters.documentFile, parameters, userKey, protocol, serviceURL, "syntax/dependencies", callback);
- } else {
- // validate parameters
- if (!parameters.loadParams().content && !parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Must supply one of Content or ContentUri", "bad arguments"));
- } else if (parameters.loadParams().content && parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Cannot supply both Content and ContentUri", "bad arguments"));
- } else {
- // configure URL
- var urlParts = URL.parse(serviceURL + "syntax/dependencies");
- var req = new rosetteRequest();
- req.makeRequest('POST', userKey, protocol, urlParts, parameters, callback);
- }
- }
+ var req = new rosetteRequest();
+ req.makeDocumentRequest("syntax/dependencies", parameters, userKey, protocol, serviceURL, callback);
};
module.exports = syntax_dependencies;
@@ -94,13 +80,13 @@
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,37 +50,23 @@
Source: textEmbedding.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function textEmbedding() {
-
-};
+//constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
textEmbedding.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
-
- if (parameters.documentFile != null) {
- parameters.loadFile(parameters.documentFile, parameters, userKey, protocol, serviceURL, "text-embedding", callback);
- } else {
- // validate parameters
- if (!parameters.loadParams().content && !parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Must supply one of Content or ContentUri", "bad arguments"));
- } else if (parameters.loadParams().content && parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Cannot supply both Content and ContentUri", "bad arguments"));
- } else {
- // configure URL
- var urlParts = URL.parse(serviceURL + "text-embedding");
- var req = new rosetteRequest();
- req.makeRequest('POST', userKey, protocol, urlParts, parameters, callback);
- }
- }
+ var req = new rosetteRequest();
+ req.makeDocumentRequest("text-embedding", parameters, userKey, protocol, serviceURL, callback);
};
module.exports = textEmbedding;
@@ -94,13 +80,13 @@
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,37 +50,23 @@
Source: tokens.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function tokens() {
-
-};
+//constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
tokens.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
-
- if (parameters.documentFile != null) {
- parameters.loadFile(parameters.documentFile, parameters, userKey, protocol, serviceURL, "tokens", callback);
- } else {
- // validate parameters
- if (!parameters.loadParams().content && !parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Must supply one of Content or ContentUri", "bad arguments"));
- } else if (parameters.loadParams().content && parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Cannot supply both Content and ContentUri", "bad arguments"));
- } else {
- // configure URL
- var urlParts = URL.parse(serviceURL + "tokens");
- var req = new rosetteRequest();
- req.makeRequest('POST', userKey, protocol, urlParts, parameters, callback);
- }
- }
+ var req = new rosetteRequest();
+ req.makeDocumentRequest("tokens", parameters, userKey, protocol, serviceURL, callback);
};
module.exports = tokens;
@@ -94,13 +80,13 @@
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,37 +50,23 @@
Source: topics.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function topics() {
-
-};
+//constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
topics.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
-
- if (parameters.documentFile != null) {
- parameters.loadFile(parameters.documentFile, parameters, userKey, protocol, serviceURL, "topics", callback);
- } else {
- // validate parameters
- if (!parameters.loadParams().content && !parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Must supply one of Content or ContentUri", "bad arguments"));
- } else if (parameters.loadParams().content && parameters.loadParams().contentUri) {
- return callback(new RosetteException("badArgument", "Cannot supply both Content and ContentUri", "bad arguments"));
- } else {
- // configure URL
- var urlParts = URL.parse(serviceURL + "topics");
- var req = new rosetteRequest();
- req.makeRequest('POST', userKey, protocol, urlParts, parameters, callback);
- }
- }
+ var req = new rosetteRequest();
+ req.makeDocumentRequest("topics", parameters, userKey, protocol, serviceURL, callback);
};
module.exports = topics;
@@ -94,13 +80,13 @@
- Makes an HTTP request to the specified Rosette API endpoint and returns the result
+ Makes an HTTP request to the specified Analytics API endpoint and returns the result
@@ -211,7 +211,7 @@
Parameters:
-
The Rosette API endpoint parameters
+
The Analytics API endpoint parameters
@@ -234,7 +234,7 @@
Parameters:
-
The Rosette API user access key
+
The Analytics API user access key
@@ -257,7 +257,7 @@
Parameters:
-
The base service URL to be used to access the Rosette API
+
The base service URL to be used to access the Analytics API
@@ -280,7 +280,7 @@
Parameters:
-
Callback function to be exectuted after the function to which it is passed is complete
+
Callback function to be executed after the function to which it is passed is complete
/**
- * Rosette API.
+ * Analytics API.
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,34 +50,23 @@
Source: transliteration.js
/**
* @class
*
- * @copyright 2016-2018 Basis Technology Corporation.
+ * @copyright 2016-2024 Basis Technology Corporation.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
function transliteration() {
-
-};
+// constructor function
+}
/**
- * Makes an HTTP request to the specified Rosette API endpoint and returns the result
- * @param {string} parameters - The Rosette API endpoint parameters
- * @param {string} userKey - The Rosette API user access key
- * @param {string} serviceURL - The base service URL to be used to access the Rosette API
- * @param {function} callback - Callback function to be exectuted after the function to which it is passed is complete
+ * Makes an HTTP request to the specified Analytics API endpoint and returns the result
+ * @param {string} parameters - The Analytics API endpoint parameters
+ * @param {string} userKey - The Analytics API user access key
+ * @param {string} serviceURL - The base service URL to be used to access the Analytics API
+ * @param {function} callback - Callback function to be executed after the function to which it is passed is complete
*/
transliteration.prototype.getResults = function(parameters, userKey, protocol, serviceURL, callback) {
-
- if (parameters.documentFile != null) {
- parameters.loadFile(parameters.documentFile, parameters, userKey, protocol, serviceURL, "transliteration", callback);
- } else {
- // validate parameters
- if (!parameters.loadParams().content) {
- return callback(new RosetteException("badArgument", "Must supply Content", "bad arguments"));
- }
- // configure URL
- var urlParts = URL.parse(serviceURL + "transliteration");
- var req = new rosetteRequest();
- req.makeRequest('POST', userKey, protocol, urlParts, parameters, callback);
- }
+ var req = new rosetteRequest();
+ req.makeDocumentRequest("transliteration", parameters, userKey, protocol, serviceURL, callback);
};
module.exports = transliteration;
@@ -91,13 +80,13 @@