Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pragmatismo-io-framework

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pragmatismo-io-framework - npm Package Compare versions

Comparing version 1.0.12 to 1.0.13

README.md

6

dist/AzureSearch.js

@@ -65,6 +65,6 @@ "use strict";

createIndex(schema, dataSourceName, cb) {
let _this = this;
let _this_ = this;
this.client.createIndex(schema, (err, schemaReturned) => {
let schemaIndexer = {
name: _this.searchIndexer,
name: _this_.searchIndexer,
dataSourceName: dataSourceName,

@@ -86,2 +86,2 @@ targetIndexName: this.searchIndex,

exports.AzureSearch = AzureSearch;
//# sourceMappingURL=C:/Sources/opensource/pragmatismo-io-framework/node/dist/AzureSearch.js.map
//# sourceMappingURL=C:/Jorge/Pragmatismo/GIT/GeneralBot/pragmatismo-io-framework/Node/dist/AzureSearch.js.map

@@ -1,34 +0,1 @@

/*****************************************************************************\
| ( )_ _ |
| _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ |
| ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ `\ /'_`\ |
| | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) |( (_) ) |
| | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/' |
| | | ( )_) | |
| (_) \___/' |
| |
| Copyright (c) Pragmatismo.io. All rights reserved. |
| Licensed under the MIT license |
| |
| MIT License: |
| Permission is hereby granted, free of charge, to any person obtaining |
| a copy of this software and associated documentation files (the |
| "Software"), to deal in the Software without restriction, including |
| without limitation the rights to use, copy, modify, merge, publish, |
| distribute, sublicense, and/or sell copies of the Software, and to |
| permit persons to whom the Software is furnished to do so, subject to |
| the following conditions: |
| |
| The above copyright notice and this permission notice shall be |
| included in all copies or substantial portions of the Software. |
| |
| THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, |
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
| LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
| OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| |
\*****************************************************************************/
export declare class AzureText {

@@ -35,0 +2,0 @@ static getSpelledText(key: string, text: string, cb: any): void;

@@ -170,2 +170,2 @@ /*****************************************************************************\

exports.AzureText = AzureText;
//# sourceMappingURL=C:/Sources/opensource/pragmatismo-io-framework/node/dist/AzureText.js.map
//# sourceMappingURL=C:/Jorge/Pragmatismo/GIT/GeneralBot/pragmatismo-io-framework/Node/dist/AzureText.js.map

@@ -1,35 +0,2 @@

/*****************************************************************************\
| ( )_ _ |
| _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ |
| ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| | | |/',__)/' _ `\ /'_`\ |
| | (_) )| | ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| ( ) |( (_) ) |
| | ,__/'(_) `\__,_)`\__ |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/' |
| | | ( )_) | |
| (_) \___/' |
| |
| Copyright (c) Pragmatismo.io. All rights reserved. |
| Licensed under the MIT license |
| |
| MIT License: |
| Permission is hereby granted, free of charge, to any person obtaining |
| a copy of this software and associated documentation files (the |
| "Software"), to deal in the Software without restriction, including |
| without limitation the rights to use, copy, modify, merge, publish, |
| distribute, sublicense, and/or sell copies of the Software, and to |
| permit persons to whom the Software is furnished to do so, subject to |
| the following conditions: |
| |
| The above copyright notice and this permission notice shall be |
| included in all copies or substantial portions of the Software. |
| |
| THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, |
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
| LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
| OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| |
\*****************************************************************************/
export { AzureText } from './AzureText';
export { AzureSearch } from './AzureSearch';

@@ -40,2 +40,2 @@ /*****************************************************************************\

exports.AzureSearch = AzureSearch_1.AzureSearch;
//# sourceMappingURL=C:/Sources/opensource/pragmatismo-io-framework/node/dist/index.js.map
//# sourceMappingURL=C:/Jorge/Pragmatismo/GIT/GeneralBot/pragmatismo-io-framework/Node/dist/index.js.map
var typedoc = typedoc || {};
typedoc.search = typedoc.search || {};
typedoc.search.data = {"kinds":{"1":"External module","32":"Variable","128":"Class","512":"Constructor","1024":"Property","2048":"Method"},"rows":[{"id":0,"kind":1,"name":"\"AzureSearch\"","url":"modules/_azuresearch_.html","classes":"tsd-kind-external-module"},{"id":1,"kind":128,"name":"AzureSearch","url":"classes/_azuresearch_.azuresearch.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"\"AzureSearch\""},{"id":2,"kind":1024,"name":"client","url":"classes/_azuresearch_.azuresearch.html#client","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"AzureSearch\".AzureSearch"},{"id":3,"kind":1024,"name":"searchKey","url":"classes/_azuresearch_.azuresearch.html#searchkey","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"AzureSearch\".AzureSearch"},{"id":4,"kind":1024,"name":"searchIndex","url":"classes/_azuresearch_.azuresearch.html#searchindex","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"AzureSearch\".AzureSearch"},{"id":5,"kind":1024,"name":"searchIndexer","url":"classes/_azuresearch_.azuresearch.html#searchindexer","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"AzureSearch\".AzureSearch"},{"id":6,"kind":512,"name":"constructor","url":"classes/_azuresearch_.azuresearch.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"AzureSearch\".AzureSearch"},{"id":7,"kind":2048,"name":"search","url":"classes/_azuresearch_.azuresearch.html#search","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AzureSearch\".AzureSearch"},{"id":8,"kind":2048,"name":"deleteIndex","url":"classes/_azuresearch_.azuresearch.html#deleteindex","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AzureSearch\".AzureSearch"},{"id":9,"kind":2048,"name":"createIndex","url":"classes/_azuresearch_.azuresearch.html#createindex","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AzureSearch\".AzureSearch"},{"id":10,"kind":1,"name":"\"AzureText\"","url":"modules/_azuretext_.html","classes":"tsd-kind-external-module"},{"id":11,"kind":128,"name":"AzureText","url":"classes/_azuretext_.azuretext.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"\"AzureText\""},{"id":12,"kind":2048,"name":"getSpelledText","url":"classes/_azuretext_.azuretext.html#getspelledtext","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"AzureText\".AzureText"},{"id":13,"kind":2048,"name":"isIntentYes","url":"classes/_azuretext_.azuretext.html#isintentyes","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"AzureText\".AzureText"},{"id":14,"kind":2048,"name":"isIntentNo","url":"classes/_azuretext_.azuretext.html#isintentno","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"AzureText\".AzureText"},{"id":15,"kind":2048,"name":"isNumeric","url":"classes/_azuretext_.azuretext.html#isnumeric","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"AzureText\".AzureText"},{"id":16,"kind":2048,"name":"getSentiment","url":"classes/_azuretext_.azuretext.html#getsentiment","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"AzureText\".AzureText"},{"id":17,"kind":2048,"name":"getKeywords","url":"classes/_azuretext_.azuretext.html#getkeywords","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AzureText\".AzureText"},{"id":18,"kind":32,"name":"UrlJoin","url":"modules/_azuretext_.html#urljoin","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"\"AzureText\""},{"id":19,"kind":1,"name":"\"index\"","url":"modules/_index_.html","classes":"tsd-kind-external-module"}]};
{
"version": "1.0.12",
"name": "pragmatismo-io-framework",
"version": "1.0.13",
"description": "Anything reusable turned into classes.",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"name": "pragmatismo-io-framework",
"description": "Anything reusable turned into classes.",
"homepage": "https://github.com/pragmatismo-io/pragmatismo-io-framework",
"contributors": [
"Rodrigo Rodriguez <me@rodrigorodriguez.com>",
"Jorge Ramos <jramos@pobox.com>"
],
"license": "MIT",
"repository": {

@@ -11,9 +17,12 @@ "type": "git",

},
"license": "MIT",
"dependencies": {
"azure-search": "0.0.20",
"azure-search": "^0.0.20",
"cogserv-text-analytics": "^0.3.2",
"sequelize-typescript": "^0.6.4",
"url-join": "^4.0.0"
},
"devDependencies": {
"@types/url-join": "^0.8.2",
"typedoc": "^0.11.1",
"typescript": "^2.8.3"
}
}

@@ -75,6 +75,6 @@ /*****************************************************************************\

createIndex(schema, dataSourceName, cb: any) {
let _this = this;
let _this_ = this;
this.client.createIndex(schema, (err, schemaReturned)=> {
let schemaIndexer = {
name: _this.searchIndexer,
name: _this_.searchIndexer,
dataSourceName: dataSourceName,

@@ -81,0 +81,0 @@ targetIndexName: this.searchIndex,

@@ -34,27 +34,26 @@ /*****************************************************************************\

\*****************************************************************************/
"use strict";
import { Length } from 'sequelize-typescript';
"use strict";
var UrlJoin = require("url-join");
export class AzureText {
static getSpelledText(
key: string,
text: string,
cb: any
) {
"use strict";
let https = require("https");
let host = "api.cognitive.microsoft.com";
let path = "/bing/v7.0/spellcheck";
let mkt = "pt-PT";
let mode = "spell";
let query_string = "?mkt=" + mkt + "&mode=" + mode;
let request_params = {
method: "POST",
export class AzureText {
static getSpelledText(
key: string,
text: string,
cb: any
) {
"use strict";
let https = require("https");
let host = "api.cognitive.microsoft.com";
let path = "/bing/v7.0/spellcheck";
let mkt = "pt-PT";
let mode = "spell";
let query_string = "?mkt=" + mkt + "&mode=" + mode;
let request_params = {
method: "POST",
hostname: host,

@@ -72,9 +71,8 @@ path: path + query_string,

let getWordIndexByWordOffsetInText = function(text, wordOffsetInText) {
let index =0;
let getWordIndexByWordOffsetInText = function (text, wordOffsetInText) {
let index = 0;
let currentWordIndex = 0;
text = text.split(" ");
text.forEach(element=>{
if (index >= wordOffsetInText)
{
text.forEach(element => {
if (index >= wordOffsetInText) {
return false;

@@ -87,3 +85,3 @@ }

};
let replaceWordAtIndex = function(text, index, replacement) {
let replaceWordAtIndex = function (text, index, replacement) {
text = text.split(" ");

@@ -95,24 +93,24 @@ text[index] = replacement;

// IMPROVE ACCURACY.
let index = 0;
if (response.flaggedTokens){
response.flaggedTokens.forEach(element => {
index = getWordIndexByWordOffsetInText(sourceText, element.offset);
sourceText = replaceWordAtIndex(sourceText, index, element.suggestions[0].suggestion);
index++;
});
}
if (response.flaggedTokens) {
response.flaggedTokens.forEach(element => {
index = getWordIndexByWordOffsetInText(sourceText, element.offset);
sourceText = replaceWordAtIndex(sourceText, index, element.suggestions[0].suggestion);
index++;
});
}
return sourceText;
};
let response_handler = function(response) {
let response_handler = function (response) {
let body = "";
response.on("data", function(d) {
response.on("data", function (d) {
body += d;
});
response.on("end", function() {
cb( getCorrectedText(text, JSON.parse(body)), null);
response.on("end", function () {
cb(getCorrectedText(text, JSON.parse(body)), null);
});
response.on("error", function(e) {
response.on("error", function (e) {
cb(null, e.message);

@@ -119,0 +117,0 @@ });

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc