compromise-paragraphs
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -1,6 +0,6 @@ | ||
/* compromise-paragraphs 0.0.4 MIT */ | ||
/* compromise-paragraphs 0.0.5 MIT */ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global = global || self, global.compromiseParagraphs = factory()); | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.compromiseParagraphs = factory()); | ||
}(this, (function () { 'use strict'; | ||
@@ -7,0 +7,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).compromiseParagraphs=n()}(this,(function(){"use strict";var t=function(t,n){var r={sentences:function(t){var r=[];this.paragraphs.forEach((function(t){t.forEach((function(t){r=r.concat(t.list)}))}));var e=new n(r,this.parent,this.world);return"number"==typeof t?e.eq(t):e},terms:function(t){var r=[];this.paragraphs.forEach((function(t){t.forEach((function(t){r=r.concat(t.terms().list)}))}));var e=new n(r,this.parent,this.world);return"number"==typeof t?e.eq(t):e},json:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.paragraphs.map((function(n){var r={text:n.map((function(t){return t.text()})).join(""),sentences:n.map((function(n){return n.json(t)}))};return t.normal&&(r.normal=n.map((function(t){return t.text("normal")})).join("")),r}))},text:function(t){var n="";return this.paragraphs.forEach((function(r){r.forEach((function(r){n+=r.text(t)}))})),n},eq:function(n){var r=[this.paragraphs[n]];return r=r.filter((function(t){return t})),new t(r,this,this.world)},first:function(){return this.eq(0)},last:function(){var t=this.length;return this.eq(t-1)},debug:function(){this.paragraphs.forEach((function(t){console.log("\n=-=-=-=-"),t.forEach((function(t){t.debug()}))}))},match:function(t){var r=[];return this.paragraphs.forEach((function(n){n.forEach((function(n){var e=n.match(t);e.found&&(r=r.concat(e.list))}))})),new n(r,this.parent,this.world)},not:function(t){var r=[];return this.paragraphs.forEach((function(n){n.forEach((function(n){var e=n.not(t);e.found&&(r=r.concat(e.list))}))})),new n(r,this.parent,this.world)},if:function(n){var r=this.paragraphs.filter((function(t){return t.some((function(t){return t.has(n)}))}));return new t(r,this,this.world)},ifNo:function(n){var r=this.paragraphs.filter((function(t){return t.some((function(t){return!1===t.has(n)}))}));return new t(r,this,this.world)},has:function(t){return this.paragraphs.some((function(n){return n.some((function(n){return n.has(t)}))}))},forEach:function(n){var r=this;return this.paragraphs.forEach((function(e){var a=new t([e],r,r.world);n(a)})),this},map:function(n){var r=this,e=this.paragraphs.map((function(e){var a=new t([e],r,r.world);return n(a)}));new t(e,this,this.world)},filter:function(t){return this.paragraphs=this.paragraphs.filter((function(n){return n.some(t)})),this}};r.get=r.eq,Object.keys(r).forEach((function(n){t.prototype[n]=r[n]}))},n=/\n\n/;return function(r){var e=function t(n,r,e){var a=this;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),Object.defineProperty(this,"paragraphs",{enumerable:!1,writable:!0,value:n}),this.parent=r,this.world=e,Object.defineProperty(this,"found",{get:function(){return a.paragraphs.length>0}}),Object.defineProperty(this,"length",{get:function(){return a.paragraphs.length}})};t(e,r),r.prototype.paragraphs=function(t){var r=this.all(),a=[],o=[];return r.forEach((function(t){o.push(t),n.test(t.post()[0])&&(a.push(o),o=[])})),o.length>0&&a.push(o),"number"==typeof t&&(a=a[t]?[a[t]]:[]),new e(a,this,this.world)}}})); | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).compromiseParagraphs=n()}(this,(function(){"use strict";var t=function(t,n){var r={sentences:function(t){var r=[];this.paragraphs.forEach((function(t){t.forEach((function(t){r=r.concat(t.list)}))}));var e=new n(r,this.parent,this.world);return"number"==typeof t?e.eq(t):e},terms:function(t){var r=[];this.paragraphs.forEach((function(t){t.forEach((function(t){r=r.concat(t.terms().list)}))}));var e=new n(r,this.parent,this.world);return"number"==typeof t?e.eq(t):e},json:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.paragraphs.map((function(n){var r={text:n.map((function(t){return t.text()})).join(""),sentences:n.map((function(n){return n.json(t)}))};return t.normal&&(r.normal=n.map((function(t){return t.text("normal")})).join("")),r}))},text:function(t){var n="";return this.paragraphs.forEach((function(r){r.forEach((function(r){n+=r.text(t)}))})),n},eq:function(n){var r=[this.paragraphs[n]];return r=r.filter((function(t){return t})),new t(r,this,this.world)},first:function(){return this.eq(0)},last:function(){var t=this.length;return this.eq(t-1)},debug:function(){this.paragraphs.forEach((function(t){console.log("\n=-=-=-=-"),t.forEach((function(t){t.debug()}))}))},match:function(t){var r=[];return this.paragraphs.forEach((function(n){n.forEach((function(n){var e=n.match(t);e.found&&(r=r.concat(e.list))}))})),new n(r,this.parent,this.world)},not:function(t){var r=[];return this.paragraphs.forEach((function(n){n.forEach((function(n){var e=n.not(t);e.found&&(r=r.concat(e.list))}))})),new n(r,this.parent,this.world)},if:function(n){var r=this.paragraphs.filter((function(t){return t.some((function(t){return t.has(n)}))}));return new t(r,this,this.world)},ifNo:function(n){var r=this.paragraphs.filter((function(t){return t.some((function(t){return!1===t.has(n)}))}));return new t(r,this,this.world)},has:function(t){return this.paragraphs.some((function(n){return n.some((function(n){return n.has(t)}))}))},forEach:function(n){var r=this;return this.paragraphs.forEach((function(e){var a=new t([e],r,r.world);n(a)})),this},map:function(n){var r=this,e=this.paragraphs.map((function(e){var a=new t([e],r,r.world);return n(a)}));new t(e,this,this.world)},filter:function(t){return this.paragraphs=this.paragraphs.filter((function(n){return n.some(t)})),this}};r.get=r.eq,Object.keys(r).forEach((function(n){t.prototype[n]=r[n]}))},n=/\n\n/;return function(r){var e=function t(n,r,e){var a=this;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),Object.defineProperty(this,"paragraphs",{enumerable:!1,writable:!0,value:n}),this.parent=r,this.world=e,Object.defineProperty(this,"found",{get:function(){return a.paragraphs.length>0}}),Object.defineProperty(this,"length",{get:function(){return a.paragraphs.length}})};t(e,r),r.prototype.paragraphs=function(t){var r=this.all(),a=[],o=[];return r.forEach((function(t){o.push(t),n.test(t.post()[0])&&(a.push(o),o=[])})),o.length>0&&a.push(o),"number"==typeof t&&(a=a[t]?[a[t]]:[]),new e(a,this,this.world)}}})); |
{ | ||
"name": "compromise-paragraphs", | ||
"description": "plugin for nlp-compromise", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"author": "Spencer Kelly <spencermountain@gmail.com> (http://spencermounta.in)", | ||
@@ -39,13 +39,13 @@ "main": "./builds/compromise-paragraphs.js", | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "11.0.1", | ||
"@rollup/plugin-json": "4.0.1", | ||
"@rollup/plugin-node-resolve": "7.0.0", | ||
"rollup": "1.30.1", | ||
"rollup-plugin-babel": "4.3.3", | ||
"@rollup/plugin-commonjs": "17.0.0", | ||
"@rollup/plugin-json": "4.1.0", | ||
"@rollup/plugin-node-resolve": "11.0.1", | ||
"rollup": "2.35.1", | ||
"rollup-plugin-babel": "4.4.0", | ||
"rollup-plugin-filesize-check": "0.0.1", | ||
"rollup-plugin-terser": "5.2.0", | ||
"tap-dancer": "0.2.0", | ||
"tape": "4.13.0" | ||
"rollup-plugin-terser": "7.0.2", | ||
"tap-dancer": "0.3.1", | ||
"tape": "5.0.1" | ||
}, | ||
"license": "MIT" | ||
} |
@@ -13,3 +13,3 @@ <div align="center"> | ||
<a href="https://unpkg.com/compromise-paragraphs/builds/compromise-paragraphs.min.js"> | ||
<img src="https://badge-size.herokuapp.com/spencermountain/compromise-paragraphs/master/builds/compromise-paragraphs.min.js" /> | ||
<img src="https://badge-size.herokuapp.com/spencermountain/compromise/master/plugins/paragraphs/builds/compromise-paragraphs.min.js" /> | ||
</a> | ||
@@ -16,0 +16,0 @@ <hr/> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
34900