Socket
Socket
Sign inDemoInstall

efrt

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

efrt - npm Package Compare versions

Comparing version 0.0.2 to 0.0.4

src/config.js

77

builds/efrt-unpack.js

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

/* efrt trie-compression v0.0.4 github.com/nlp-compromise/efrt - MIT */
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.unpack = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){

@@ -8,2 +9,4 @@ 'use strict';

TERMINAL_PREFIX: '!',
//characters banned from entering the trie
NOT_ALLOWED: new RegExp('[0-9A-Z,;!]'),
BASE: 36

@@ -141,2 +144,3 @@ };

var isPrefix = _dereq_('./prefix');
var unravel = _dereq_('./unravel');

@@ -152,2 +156,3 @@ //PackedTrie - Trie traversal of the Trie packed-string representation.

this.symCount = 0;
this._cache = null;
//process symbols, if they have them

@@ -191,4 +196,8 @@ if (str.match(':')) {

}
var crawl = function crawl(inode, prefix) {
var node = _this.nodes[inode];
//then, try cache-lookup
if (this._cache) {
return this._cache[want] || false;
}
var crawl = function crawl(index, prefix) {
var node = _this.nodes[index];
//the '!' means a prefix-alone is a good match

@@ -215,3 +224,2 @@ if (node[0] === '!') {

if (have === want) {
// console.log('::end');
return true;

@@ -225,4 +233,4 @@ }

if (isPrefix(have, want)) {
inode = _this.inodeFromRef(ref, inode);
return crawl(inode, have);
index = _this.indexFromRef(ref, index);
return crawl(index, have);
}

@@ -241,4 +249,4 @@ //nah, lets try the next branch..

}, {
key: 'inodeFromRef',
value: function inodeFromRef(ref, inode) {
key: 'indexFromRef',
value: function indexFromRef(ref, index) {
var dnode = fns.fromAlphaCode(ref);

@@ -248,4 +256,19 @@ if (dnode < this.symCount) {

}
return inode + dnode + 1 - this.symCount;
return index + dnode + 1 - this.symCount;
}
}, {
key: 'toArray',
value: function toArray() {
if (this._cache) {
return Object.keys(this._cache);
}
return Object.keys(unravel(this));
}
}, {
key: 'cache',
value: function cache() {
this._cache = unravel(this);
this.nodes = null;
this.syms = null;
}
}]);

@@ -258,3 +281,39 @@

},{"../config":1,"../fns":2,"./prefix":4}]},{},[3])(3)
},{"../config":1,"../fns":2,"./prefix":4,"./unravel":6}],6:[function(_dereq_,module,exports){
'use strict';
//spin-out all words from this trie
var unRavel = function unRavel(trie) {
var all = {};
var crawl = function crawl(index, prefix) {
var node = trie.nodes[index];
if (node[0] === '!') {
all[prefix] = true;
node = node.slice(1); //ok, we tried. remove it.
}
var matches = node.split(/([A-Z0-9,]+)/g);
for (var i = 0; i < matches.length; i += 2) {
var str = matches[i];
var ref = matches[i + 1];
if (!str) {
continue;
}
var have = prefix + str;
//branch's end
if (ref === ',' || ref === undefined) {
all[have] = true;
continue;
}
var newIndex = trie.indexFromRef(ref, index);
crawl(newIndex, have);
}
};
crawl(0, '');
return all;
};
module.exports = unRavel;
},{}]},{},[3])(3)
});

3

builds/efrt-unpack.min.js

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

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.unpack=e()}}(function(){return function e(n,r,t){function i(f,u){if(!r[f]){if(!n[f]){var s="function"==typeof require&&require;if(!u&&s)return s(f,!0);if(o)return o(f,!0);var a=new Error("Cannot find module '"+f+"'");throw a.code="MODULE_NOT_FOUND",a}var c=r[f]={exports:{}};n[f][0].call(c.exports,function(e){var r=n[f][1][e];return i(r?r:e)},c,c.exports,e,n,r,t)}return r[f].exports}for(var o="function"==typeof require&&require,f=0;f<t.length;f++)i(t[f]);return i}({1:[function(e,n,r){"use strict";n.exports={NODE_SEP:";",STRING_SEP:",",TERMINAL_PREFIX:"!",BASE:36}},{}],2:[function(e,n,r){"use strict";var t=e("./config"),i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",o=i.split("").reduce(function(e,n,r){return e[n]=r,e},{}),f=function(e){if(void 0!==i[e])return i[e];for(var n=1,r=t.BASE,o="";e>=r;e-=r,n++,r*=t.BASE);for(;n--;){var f=e%t.BASE;o=String.fromCharCode((f<10?48:55)+f)+o,e=(e-f)/t.BASE}return o},u=function(e){if(void 0!==o[e])return o[e];for(var n=0,r=1,i=t.BASE,f=1;r<e.length;n+=i,r++,i*=t.BASE);for(var u=e.length-1;u>=0;u--,f*=t.BASE){var s=e.charCodeAt(u)-48;s>10&&(s-=7),n+=s*f}return n},s=function(e){e.sort();for(var n=1;n<e.length;n++)e[n-1]===e[n]&&e.splice(n,1)},a=function(e,n){for(var r=Math.min(e.length,n.length);r>0;){var t=e.slice(0,r);if(t===n.slice(0,r))return t;r-=1}return""};n.exports={toAlphaCode:f,fromAlphaCode:u,unique:s,commonPrefix:a}},{"./config":1}],3:[function(e,n,r){"use strict";var t=e("./ptrie"),i=function(e){return new t(e)};n.exports=i},{"./ptrie":5}],4:[function(e,n,r){"use strict";var t=function(e,n){if(e===n)return!0;var r=e.length;return!(r>=n.length)&&(1===r?e===n[0]:n.slice(0,r)===e)};n.exports=t},{}],5:[function(e,n,r){"use strict";function t(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,n){for(var r=0;r<n.length;r++){var t=n[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}return function(n,r,t){return r&&e(n.prototype,r),t&&e(n,t),n}}(),o=e("../config"),f=e("../fns"),u=e("./prefix"),s=function(){function e(n){t(this,e),this.nodes=n.split(o.NODE_SEP),this.syms=[],this.symCount=0,n.match(":")&&this.initSymbols()}return i(e,[{key:"initSymbols",value:function(){for(var e=new RegExp("([0-9A-Z]+):([0-9A-Z]+)"),n=0;n<this.nodes.length;n++){var r=e.exec(this.nodes[n]);if(!r){this.symCount=n;break}this.syms[f.fromAlphaCode(r[1])]=f.fromAlphaCode(r[2])}this.nodes=this.nodes.slice(this.symCount,this.nodes.length)}},{key:"has",value:function(e){var n=this;if(!e)return!1;var r=function r(t,i){var o=n.nodes[t];if("!"===o[0]){if(i===e)return!0;o=o.slice(1)}for(var f=o.split(/([A-Z0-9,]+)/g),s=0;s<f.length;s+=2){var a=f[s],c=f[s+1];if(a){var l=i+a;if(","!==c&&void 0!==c){if(u(l,e))return t=n.inodeFromRef(c,t),r(t,l)}else if(l===e)return!0}}return!1};return r(0,"")}},{key:"inodeFromRef",value:function(e,n){var r=f.fromAlphaCode(e);return r<this.symCount?this.syms[r]:n+r+1-this.symCount}}]),e}();n.exports=s},{"../config":1,"../fns":2,"./prefix":4}]},{},[3])(3)});
/* efrt trie-compression v0.0.4 github.com/nlp-compromise/efrt - MIT */
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.unpack=e()}}(function(){return function e(n,t,r){function i(f,u){if(!t[f]){if(!n[f]){var s="function"==typeof require&&require;if(!u&&s)return s(f,!0);if(o)return o(f,!0);var c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c}var a=t[f]={exports:{}};n[f][0].call(a.exports,function(e){var t=n[f][1][e];return i(t?t:e)},a,a.exports,e,n,t,r)}return t[f].exports}for(var o="function"==typeof require&&require,f=0;f<r.length;f++)i(r[f]);return i}({1:[function(e,n,t){"use strict";n.exports={NODE_SEP:";",STRING_SEP:",",TERMINAL_PREFIX:"!",NOT_ALLOWED:new RegExp("[0-9A-Z,;!]"),BASE:36}},{}],2:[function(e,n,t){"use strict";var r=e("./config"),i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",o=i.split("").reduce(function(e,n,t){return e[n]=t,e},{}),f=function(e){if(void 0!==i[e])return i[e];for(var n=1,t=r.BASE,o="";e>=t;e-=t,n++,t*=r.BASE);for(;n--;){var f=e%r.BASE;o=String.fromCharCode((f<10?48:55)+f)+o,e=(e-f)/r.BASE}return o},u=function(e){if(void 0!==o[e])return o[e];for(var n=0,t=1,i=r.BASE,f=1;t<e.length;n+=i,t++,i*=r.BASE);for(var u=e.length-1;u>=0;u--,f*=r.BASE){var s=e.charCodeAt(u)-48;s>10&&(s-=7),n+=s*f}return n},s=function(e){e.sort();for(var n=1;n<e.length;n++)e[n-1]===e[n]&&e.splice(n,1)},c=function(e,n){for(var t=Math.min(e.length,n.length);t>0;){var r=e.slice(0,t);if(r===n.slice(0,t))return r;t-=1}return""};n.exports={toAlphaCode:f,fromAlphaCode:u,unique:s,commonPrefix:c}},{"./config":1}],3:[function(e,n,t){"use strict";var r=e("./ptrie"),i=function(e){return new r(e)};n.exports=i},{"./ptrie":5}],4:[function(e,n,t){"use strict";var r=function(e,n){if(e===n)return!0;var t=e.length;return!(t>=n.length)&&(1===t?e===n[0]:n.slice(0,t)===e)};n.exports=r},{}],5:[function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),o=e("../config"),f=e("../fns"),u=e("./prefix"),s=e("./unravel"),c=function(){function e(n){r(this,e),this.nodes=n.split(o.NODE_SEP),this.syms=[],this.symCount=0,this._cache=null,n.match(":")&&this.initSymbols()}return i(e,[{key:"initSymbols",value:function(){for(var e=new RegExp("([0-9A-Z]+):([0-9A-Z]+)"),n=0;n<this.nodes.length;n++){var t=e.exec(this.nodes[n]);if(!t){this.symCount=n;break}this.syms[f.fromAlphaCode(t[1])]=f.fromAlphaCode(t[2])}this.nodes=this.nodes.slice(this.symCount,this.nodes.length)}},{key:"has",value:function(e){var n=this;if(!e)return!1;if(this._cache)return this._cache[e]||!1;var t=function t(r,i){var o=n.nodes[r];if("!"===o[0]){if(i===e)return!0;o=o.slice(1)}for(var f=o.split(/([A-Z0-9,]+)/g),s=0;s<f.length;s+=2){var c=f[s],a=f[s+1];if(c){var l=i+c;if(","!==a&&void 0!==a){if(u(l,e))return r=n.indexFromRef(a,r),t(r,l)}else if(l===e)return!0}}return!1};return t(0,"")}},{key:"indexFromRef",value:function(e,n){var t=f.fromAlphaCode(e);return t<this.symCount?this.syms[t]:n+t+1-this.symCount}},{key:"toArray",value:function(){return this._cache?Object.keys(this._cache):Object.keys(s(this))}},{key:"cache",value:function(){this._cache=s(this),this.nodes=null,this.syms=null}}]),e}();n.exports=c},{"../config":1,"../fns":2,"./prefix":4,"./unravel":6}],6:[function(e,n,t){"use strict";var r=function(e){var n={},t=function t(r,i){var o=e.nodes[r];"!"===o[0]&&(n[i]=!0,o=o.slice(1));for(var f=o.split(/([A-Z0-9,]+)/g),u=0;u<f.length;u+=2){var s=f[u],c=f[u+1];if(s){var a=i+s;if(","!==c&&void 0!==c){var l=e.indexFromRef(c,r);t(l,a)}else n[a]=!0}}};return t(0,""),n};n.exports=r},{}]},{},[3])(3)});

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

/* efrt trie-compression v0.0.4 github.com/nlp-compromise/efrt - MIT */
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.efrt = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){

@@ -8,2 +9,4 @@ 'use strict';

TERMINAL_PREFIX: '!',
//characters banned from entering the trie
NOT_ALLOWED: new RegExp('[0-9A-Z,;!]'),
BASE: 36

@@ -355,2 +358,4 @@ };

var _pack = _dereq_('./pack');
var config = _dereq_('../config');
// const pack = require('./packer');

@@ -424,3 +429,5 @@ /*

for (var _i = 0; _i < words.length; _i++) {
this.insert(words[_i]);
if (words[_i].match(config.NOT_ALLOWED) === null) {
this.insert(words[_i]);
}
}

@@ -695,3 +702,3 @@ }

},{"../fns":2,"./pack":6}],8:[function(_dereq_,module,exports){
},{"../config":1,"../fns":2,"./pack":6}],8:[function(_dereq_,module,exports){
'use strict';

@@ -741,2 +748,3 @@

var isPrefix = _dereq_('./prefix');
var unravel = _dereq_('./unravel');

@@ -752,2 +760,3 @@ //PackedTrie - Trie traversal of the Trie packed-string representation.

this.symCount = 0;
this._cache = null;
//process symbols, if they have them

@@ -791,4 +800,8 @@ if (str.match(':')) {

}
var crawl = function crawl(inode, prefix) {
var node = _this.nodes[inode];
//then, try cache-lookup
if (this._cache) {
return this._cache[want] || false;
}
var crawl = function crawl(index, prefix) {
var node = _this.nodes[index];
//the '!' means a prefix-alone is a good match

@@ -815,3 +828,2 @@ if (node[0] === '!') {

if (have === want) {
// console.log('::end');
return true;

@@ -825,4 +837,4 @@ }

if (isPrefix(have, want)) {
inode = _this.inodeFromRef(ref, inode);
return crawl(inode, have);
index = _this.indexFromRef(ref, index);
return crawl(index, have);
}

@@ -841,4 +853,4 @@ //nah, lets try the next branch..

}, {
key: 'inodeFromRef',
value: function inodeFromRef(ref, inode) {
key: 'indexFromRef',
value: function indexFromRef(ref, index) {
var dnode = fns.fromAlphaCode(ref);

@@ -848,4 +860,19 @@ if (dnode < this.symCount) {

}
return inode + dnode + 1 - this.symCount;
return index + dnode + 1 - this.symCount;
}
}, {
key: 'toArray',
value: function toArray() {
if (this._cache) {
return Object.keys(this._cache);
}
return Object.keys(unravel(this));
}
}, {
key: 'cache',
value: function cache() {
this._cache = unravel(this);
this.nodes = null;
this.syms = null;
}
}]);

@@ -858,3 +885,39 @@

},{"../config":1,"../fns":2,"./prefix":9}]},{},[3])(3)
},{"../config":1,"../fns":2,"./prefix":9,"./unravel":11}],11:[function(_dereq_,module,exports){
'use strict';
//spin-out all words from this trie
var unRavel = function unRavel(trie) {
var all = {};
var crawl = function crawl(index, prefix) {
var node = trie.nodes[index];
if (node[0] === '!') {
all[prefix] = true;
node = node.slice(1); //ok, we tried. remove it.
}
var matches = node.split(/([A-Z0-9,]+)/g);
for (var i = 0; i < matches.length; i += 2) {
var str = matches[i];
var ref = matches[i + 1];
if (!str) {
continue;
}
var have = prefix + str;
//branch's end
if (ref === ',' || ref === undefined) {
all[have] = true;
continue;
}
var newIndex = trie.indexFromRef(ref, index);
crawl(newIndex, have);
}
};
crawl(0, '');
return all;
};
module.exports = unRavel;
},{}]},{},[3])(3)
});

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

!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.efrt=t()}}(function(){return function t(e,n,i){function o(s,u){if(!n[s]){if(!e[s]){var f="function"==typeof require&&require;if(!u&&f)return f(s,!0);if(r)return r(s,!0);var a=new Error("Cannot find module '"+s+"'");throw a.code="MODULE_NOT_FOUND",a}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return o(n?n:t)},c,c.exports,t,e,n,i)}return n[s].exports}for(var r="function"==typeof require&&require,s=0;s<i.length;s++)o(i[s]);return o}({1:[function(t,e,n){"use strict";e.exports={NODE_SEP:";",STRING_SEP:",",TERMINAL_PREFIX:"!",BASE:36}},{}],2:[function(t,e,n){"use strict";var i=t("./config"),o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",r=o.split("").reduce(function(t,e,n){return t[e]=n,t},{}),s=function(t){if(void 0!==o[t])return o[t];for(var e=1,n=i.BASE,r="";t>=n;t-=n,e++,n*=i.BASE);for(;e--;){var s=t%i.BASE;r=String.fromCharCode((s<10?48:55)+s)+r,t=(t-s)/i.BASE}return r},u=function(t){if(void 0!==r[t])return r[t];for(var e=0,n=1,o=i.BASE,s=1;n<t.length;e+=o,n++,o*=i.BASE);for(var u=t.length-1;u>=0;u--,s*=i.BASE){var f=t.charCodeAt(u)-48;f>10&&(f-=7),e+=f*s}return e},f=function(t){t.sort();for(var e=1;e<t.length;e++)t[e-1]===t[e]&&t.splice(e,1)},a=function(t,e){for(var n=Math.min(t.length,e.length);n>0;){var i=t.slice(0,n);if(i===e.slice(0,n))return i;n-=1}return""};e.exports={toAlphaCode:s,fromAlphaCode:u,unique:f,commonPrefix:a}},{"./config":1}],3:[function(t,e,n){"use strict";e.exports={pack:t("./pack/index"),unpack:t("./unpack/index")}},{"./pack/index":5,"./unpack/index":8}],4:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=function(){function t(){i(this,t),this.counts={}}return o(t,[{key:"init",value:function(t){void 0===this.counts[t]&&(this.counts[t]=0)}},{key:"add",value:function(t,e){void 0===e&&(e=1),this.init(t),this.counts[t]+=e}},{key:"change",value:function(t,e,n){void 0===n&&(n=1),this.add(e,-n),this.add(t,n)}},{key:"countOf",value:function(t){return this.init(t),this.counts[t]}},{key:"highest",value:function(t){for(var e=[],n=Object.keys(this.counts),i=0;i<n.length;i++){var o=n[i];e.push([o,this.counts[o]])}return e.sort(function(t,e){return e[1]-t[1]}),t&&(e=e.slice(0,t)),e}}]),t}();e.exports=r},{}],5:[function(t,e,n){"use strict";var i=t("./trie"),o=function(t){var e=new i(t);return e.pack()};e.exports=o},{"./trie":7}],6:[function(t,e,n){"use strict";var i=t("./histogram"),o=t("../config"),r=t("../fns"),s=function(t,e){var n="",i="";t.isTerminal(e)&&(n+=o.TERMINAL_PREFIX);for(var s=t.nodeProps(e),u=0;u<s.length;u++){var f=s[u];if("number"!=typeof e[f])if(t.syms[e[f]._n])n+=i+f+t.syms[e[f]._n],i="";else{var a=r.toAlphaCode(e._n-e[f]._n-1+t.symCount);e[f]._g&&a.length>=e[f]._g.length&&1===e[e[f]._g]?(a=e[f]._g,n+=i+f+a,i=o.STRING_SEP):(n+=i+f+a,i="")}else n+=i+f,i=o.STRING_SEP}return n},u=function t(e,n){if(!e.visited(n))for(var i=e.nodeProps(n,!0),s=0;s<i.length;s++){var u=i[s],f=n._n-n[u]._n-1;f<o.BASE&&e.histRel.add(f),e.histAbs.add(n[u]._n,r.toAlphaCode(f).length-1),t(e,n[u])}},f=function(t){t.histAbs=t.histAbs.highest(o.BASE);var e=[];e[-1]=0;for(var n=0,i=0,s=3+r.toAlphaCode(t.nodeCount).length,u=0;u<o.BASE&&void 0!==t.histAbs[u];u++)e[u]=t.histAbs[u][1]-s-t.histRel.countOf(o.BASE-u-1)+e[u-1],e[u]>=n&&(n=e[u],i=u+1);return i},a=function t(e,n){if(void 0===n._n){for(var i=e.nodeProps(n,!0),o=0;o<i.length;o++)t(e,n[i[o]]);n._n=e.pos++,e.nodes.unshift(n)}},c=function(t){t.nodes=[],t.nodeCount=0,t.syms={},t.symCount=0,t.pos=0,t.optimize(),t.histAbs=new i,t.histRel=new i,a(t,t.root),t.nodeCount=t.nodes.length,t.prepDFS(),u(t,t.root),t.symCount=f(t);for(var e=0;e<t.symCount;e++)t.syms[t.histAbs[e][0]]=r.toAlphaCode(e);for(var n=0;n<t.nodeCount;n++)t.nodes[n]=s(t,t.nodes[n]);for(var c=t.symCount-1;c>=0;c--)t.nodes.unshift(r.toAlphaCode(c)+":"+r.toAlphaCode(t.nodeCount-t.histAbs[c][0]-1));return t.nodes.join(o.NODE_SEP)};e.exports=c},{"../config":1,"../fns":2,"./histogram":4}],7:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=t("../fns"),u=t("./pack"),f=function(){function t(e){i(this,t),this.root={},this.lastWord="",this.suffixes={},this.suffixCounts={},this.cNext=1,this.wordCount=0,this.insertWords(e),this.vCur=0}return r(t,[{key:"insertWords",value:function(t){if(void 0!==t){"string"==typeof t&&(t=t.split(/[^a-zA-Z]+/));for(var e=0;e<t.length;e++)t[e]=t[e].toLowerCase();s.unique(t);for(var n=0;n<t.length;n++)this.insert(t[n])}}},{key:"insert",value:function(t){this._insert(t,this.root);var e=this.lastWord;this.lastWord=t;var n=s.commonPrefix(t,e);if(n!==e){var i=this.uniqueNode(e,t,this.root);i&&this.combineSuffixNode(i)}}},{key:"_insert",value:function(t,e){var n=void 0,i=void 0;if(0!==t.length){for(var r=Object.keys(e),u=0;u<r.length;u++){var f=r[u];if(n=s.commonPrefix(t,f),0!==n.length){if(f===n&&"object"===o(e[f]))return void this._insert(t.slice(n.length),e[f]);if(f===t&&"number"==typeof e[f])return;return i={},i[f.slice(n.length)]=e[f],this.addTerminal(i,t=t.slice(n.length)),delete e[f],e[n]=i,void this.wordCount++}}this.addTerminal(e,t),this.wordCount++}}},{key:"addTerminal",value:function(t,e){if(e.length<=1)return void(t[e]=1);var n={};t[e[0]]=n,this.addTerminal(n,e.slice(1))}},{key:"nodeProps",value:function(t,e){var n=[];for(var i in t)""!==i&&"_"!==i[0]&&(e&&"object"!==o(t[i])||n.push(i));return n.sort(),n}},{key:"optimize",value:function(){this.combineSuffixNode(this.root),this.prepDFS(),this.countDegree(this.root),this.prepDFS(),this.collapseChains(this.root)}},{key:"combineSuffixNode",value:function(t){if(t._c)return t;var e=[];this.isTerminal(t)&&e.push("!");for(var n=this.nodeProps(t),i=0;i<n.length;i++){var r=n[i];"object"===o(t[r])?(t[r]=this.combineSuffixNode(t[r]),e.push(r),e.push(t[r]._c)):e.push(r)}e=e.join("-");var s=this.suffixes[e];return s?s:(this.suffixes[e]=t,t._c=this.cNext++,t)}},{key:"prepDFS",value:function(){this.vCur++}},{key:"visited",value:function(t){return t._v===this.vCur||(t._v=this.vCur,!1)}},{key:"countDegree",value:function(t){if(void 0===t._d&&(t._d=0),t._d++,!this.visited(t))for(var e=this.nodeProps(t,!0),n=0;n<e.length;n++)this.countDegree(t[e[n]])}},{key:"collapseChains",value:function(t){var e=void 0,n=void 0,i=void 0,r=void 0;if(!this.visited(t)){for(n=this.nodeProps(t),r=0;r<n.length;r++)e=n[r],i=t[e],"object"===("undefined"==typeof i?"undefined":o(i))&&(this.collapseChains(i),void 0===i._g||1!==i._d&&1!==i._g.length||(delete t[e],e+=i._g,t[e]=i[i._g]));1!==n.length||this.isTerminal(t)||(t._g=e)}}},{key:"has",value:function(t){return this.isFragment(t,this.root)}},{key:"isTerminal",value:function(t){return!!t[""]}},{key:"isFragment",value:function(t,e){if(0===t.length)return this.isTerminal(e);if(1===e[t])return!0;for(var n=this.nodeProps(e,!0),i=0;i<n.length;i++){var o=n[i];if(o===t.slice(0,o.length))return this.isFragment(t.slice(o.length),e[o])}return!1}},{key:"uniqueNode",value:function(t,e,n){for(var i=this.nodeProps(n,!0),o=0;o<i.length;o++){var r=i[o];if(r===t.slice(0,r.length))return r!==e.slice(0,r.length)?n[r]:this.uniqueNode(t.slice(r.length),e.slice(r.length),n[r])}}},{key:"pack",value:function(){return u(this)}}]),t}();e.exports=f},{"../fns":2,"./pack":6}],8:[function(t,e,n){"use strict";var i=t("./ptrie"),o=function(t){return new i(t)};e.exports=o},{"./ptrie":10}],9:[function(t,e,n){"use strict";var i=function(t,e){if(t===e)return!0;var n=t.length;return!(n>=e.length)&&(1===n?t===e[0]:e.slice(0,n)===t)};e.exports=i},{}],10:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=t("../config"),s=t("../fns"),u=t("./prefix"),f=function(){function t(e){i(this,t),this.nodes=e.split(r.NODE_SEP),this.syms=[],this.symCount=0,e.match(":")&&this.initSymbols()}return o(t,[{key:"initSymbols",value:function(){for(var t=new RegExp("([0-9A-Z]+):([0-9A-Z]+)"),e=0;e<this.nodes.length;e++){var n=t.exec(this.nodes[e]);if(!n){this.symCount=e;break}this.syms[s.fromAlphaCode(n[1])]=s.fromAlphaCode(n[2])}this.nodes=this.nodes.slice(this.symCount,this.nodes.length)}},{key:"has",value:function(t){var e=this;if(!t)return!1;var n=function n(i,o){var r=e.nodes[i];if("!"===r[0]){if(o===t)return!0;r=r.slice(1)}for(var s=r.split(/([A-Z0-9,]+)/g),f=0;f<s.length;f+=2){var a=s[f],c=s[f+1];if(a){var h=o+a;if(","!==c&&void 0!==c){if(u(h,t))return i=e.inodeFromRef(c,i),n(i,h)}else if(h===t)return!0}}return!1};return n(0,"")}},{key:"inodeFromRef",value:function(t,e){var n=s.fromAlphaCode(t);return n<this.symCount?this.syms[n]:e+n+1-this.symCount}}]),t}();e.exports=f},{"../config":1,"../fns":2,"./prefix":9}]},{},[3])(3)});
/* efrt trie-compression v0.0.4 github.com/nlp-compromise/efrt - MIT */
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.efrt=e()}}(function(){return function e(t,n,i){function r(s,u){if(!n[s]){if(!t[s]){var f="function"==typeof require&&require;if(!u&&f)return f(s,!0);if(o)return o(s,!0);var a=new Error("Cannot find module '"+s+"'");throw a.code="MODULE_NOT_FOUND",a}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return r(n?n:e)},c,c.exports,e,t,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(e,t,n){"use strict";t.exports={NODE_SEP:";",STRING_SEP:",",TERMINAL_PREFIX:"!",NOT_ALLOWED:new RegExp("[0-9A-Z,;!]"),BASE:36}},{}],2:[function(e,t,n){"use strict";var i=e("./config"),r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",o=r.split("").reduce(function(e,t,n){return e[t]=n,e},{}),s=function(e){if(void 0!==r[e])return r[e];for(var t=1,n=i.BASE,o="";e>=n;e-=n,t++,n*=i.BASE);for(;t--;){var s=e%i.BASE;o=String.fromCharCode((s<10?48:55)+s)+o,e=(e-s)/i.BASE}return o},u=function(e){if(void 0!==o[e])return o[e];for(var t=0,n=1,r=i.BASE,s=1;n<e.length;t+=r,n++,r*=i.BASE);for(var u=e.length-1;u>=0;u--,s*=i.BASE){var f=e.charCodeAt(u)-48;f>10&&(f-=7),t+=f*s}return t},f=function(e){e.sort();for(var t=1;t<e.length;t++)e[t-1]===e[t]&&e.splice(t,1)},a=function(e,t){for(var n=Math.min(e.length,t.length);n>0;){var i=e.slice(0,n);if(i===t.slice(0,n))return i;n-=1}return""};t.exports={toAlphaCode:s,fromAlphaCode:u,unique:f,commonPrefix:a}},{"./config":1}],3:[function(e,t,n){"use strict";t.exports={pack:e("./pack/index"),unpack:e("./unpack/index")}},{"./pack/index":5,"./unpack/index":8}],4:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=function(){function e(){i(this,e),this.counts={}}return r(e,[{key:"init",value:function(e){void 0===this.counts[e]&&(this.counts[e]=0)}},{key:"add",value:function(e,t){void 0===t&&(t=1),this.init(e),this.counts[e]+=t}},{key:"change",value:function(e,t,n){void 0===n&&(n=1),this.add(t,-n),this.add(e,n)}},{key:"countOf",value:function(e){return this.init(e),this.counts[e]}},{key:"highest",value:function(e){for(var t=[],n=Object.keys(this.counts),i=0;i<n.length;i++){var r=n[i];t.push([r,this.counts[r]])}return t.sort(function(e,t){return t[1]-e[1]}),e&&(t=t.slice(0,e)),t}}]),e}();t.exports=o},{}],5:[function(e,t,n){"use strict";var i=e("./trie"),r=function(e){var t=new i(e);return t.pack()};t.exports=r},{"./trie":7}],6:[function(e,t,n){"use strict";var i=e("./histogram"),r=e("../config"),o=e("../fns"),s=function(e,t){var n="",i="";e.isTerminal(t)&&(n+=r.TERMINAL_PREFIX);for(var s=e.nodeProps(t),u=0;u<s.length;u++){var f=s[u];if("number"!=typeof t[f])if(e.syms[t[f]._n])n+=i+f+e.syms[t[f]._n],i="";else{var a=o.toAlphaCode(t._n-t[f]._n-1+e.symCount);t[f]._g&&a.length>=t[f]._g.length&&1===t[t[f]._g]?(a=t[f]._g,n+=i+f+a,i=r.STRING_SEP):(n+=i+f+a,i="")}else n+=i+f,i=r.STRING_SEP}return n},u=function e(t,n){if(!t.visited(n))for(var i=t.nodeProps(n,!0),s=0;s<i.length;s++){var u=i[s],f=n._n-n[u]._n-1;f<r.BASE&&t.histRel.add(f),t.histAbs.add(n[u]._n,o.toAlphaCode(f).length-1),e(t,n[u])}},f=function(e){e.histAbs=e.histAbs.highest(r.BASE);var t=[];t[-1]=0;for(var n=0,i=0,s=3+o.toAlphaCode(e.nodeCount).length,u=0;u<r.BASE&&void 0!==e.histAbs[u];u++)t[u]=e.histAbs[u][1]-s-e.histRel.countOf(r.BASE-u-1)+t[u-1],t[u]>=n&&(n=t[u],i=u+1);return i},a=function e(t,n){if(void 0===n._n){for(var i=t.nodeProps(n,!0),r=0;r<i.length;r++)e(t,n[i[r]]);n._n=t.pos++,t.nodes.unshift(n)}},c=function(e){e.nodes=[],e.nodeCount=0,e.syms={},e.symCount=0,e.pos=0,e.optimize(),e.histAbs=new i,e.histRel=new i,a(e,e.root),e.nodeCount=e.nodes.length,e.prepDFS(),u(e,e.root),e.symCount=f(e);for(var t=0;t<e.symCount;t++)e.syms[e.histAbs[t][0]]=o.toAlphaCode(t);for(var n=0;n<e.nodeCount;n++)e.nodes[n]=s(e,e.nodes[n]);for(var c=e.symCount-1;c>=0;c--)e.nodes.unshift(o.toAlphaCode(c)+":"+o.toAlphaCode(e.nodeCount-e.histAbs[c][0]-1));return e.nodes.join(r.NODE_SEP)};t.exports=c},{"../config":1,"../fns":2,"./histogram":4}],7:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=e("../fns"),u=e("./pack"),f=e("../config"),a=function(){function e(t){i(this,e),this.root={},this.lastWord="",this.suffixes={},this.suffixCounts={},this.cNext=1,this.wordCount=0,this.insertWords(t),this.vCur=0}return o(e,[{key:"insertWords",value:function(e){if(void 0!==e){"string"==typeof e&&(e=e.split(/[^a-zA-Z]+/));for(var t=0;t<e.length;t++)e[t]=e[t].toLowerCase();s.unique(e);for(var n=0;n<e.length;n++)null===e[n].match(f.NOT_ALLOWED)&&this.insert(e[n])}}},{key:"insert",value:function(e){this._insert(e,this.root);var t=this.lastWord;this.lastWord=e;var n=s.commonPrefix(e,t);if(n!==t){var i=this.uniqueNode(t,e,this.root);i&&this.combineSuffixNode(i)}}},{key:"_insert",value:function(e,t){var n=void 0,i=void 0;if(0!==e.length){for(var o=Object.keys(t),u=0;u<o.length;u++){var f=o[u];if(n=s.commonPrefix(e,f),0!==n.length){if(f===n&&"object"===r(t[f]))return void this._insert(e.slice(n.length),t[f]);if(f===e&&"number"==typeof t[f])return;return i={},i[f.slice(n.length)]=t[f],this.addTerminal(i,e=e.slice(n.length)),delete t[f],t[n]=i,void this.wordCount++}}this.addTerminal(t,e),this.wordCount++}}},{key:"addTerminal",value:function(e,t){if(t.length<=1)return void(e[t]=1);var n={};e[t[0]]=n,this.addTerminal(n,t.slice(1))}},{key:"nodeProps",value:function(e,t){var n=[];for(var i in e)""!==i&&"_"!==i[0]&&(t&&"object"!==r(e[i])||n.push(i));return n.sort(),n}},{key:"optimize",value:function(){this.combineSuffixNode(this.root),this.prepDFS(),this.countDegree(this.root),this.prepDFS(),this.collapseChains(this.root)}},{key:"combineSuffixNode",value:function(e){if(e._c)return e;var t=[];this.isTerminal(e)&&t.push("!");for(var n=this.nodeProps(e),i=0;i<n.length;i++){var o=n[i];"object"===r(e[o])?(e[o]=this.combineSuffixNode(e[o]),t.push(o),t.push(e[o]._c)):t.push(o)}t=t.join("-");var s=this.suffixes[t];return s?s:(this.suffixes[t]=e,e._c=this.cNext++,e)}},{key:"prepDFS",value:function(){this.vCur++}},{key:"visited",value:function(e){return e._v===this.vCur||(e._v=this.vCur,!1)}},{key:"countDegree",value:function(e){if(void 0===e._d&&(e._d=0),e._d++,!this.visited(e))for(var t=this.nodeProps(e,!0),n=0;n<t.length;n++)this.countDegree(e[t[n]])}},{key:"collapseChains",value:function(e){var t=void 0,n=void 0,i=void 0,o=void 0;if(!this.visited(e)){for(n=this.nodeProps(e),o=0;o<n.length;o++)t=n[o],i=e[t],"object"===("undefined"==typeof i?"undefined":r(i))&&(this.collapseChains(i),void 0===i._g||1!==i._d&&1!==i._g.length||(delete e[t],t+=i._g,e[t]=i[i._g]));1!==n.length||this.isTerminal(e)||(e._g=t)}}},{key:"has",value:function(e){return this.isFragment(e,this.root)}},{key:"isTerminal",value:function(e){return!!e[""]}},{key:"isFragment",value:function(e,t){if(0===e.length)return this.isTerminal(t);if(1===t[e])return!0;for(var n=this.nodeProps(t,!0),i=0;i<n.length;i++){var r=n[i];if(r===e.slice(0,r.length))return this.isFragment(e.slice(r.length),t[r])}return!1}},{key:"uniqueNode",value:function(e,t,n){for(var i=this.nodeProps(n,!0),r=0;r<i.length;r++){var o=i[r];if(o===e.slice(0,o.length))return o!==t.slice(0,o.length)?n[o]:this.uniqueNode(e.slice(o.length),t.slice(o.length),n[o])}}},{key:"pack",value:function(){return u(this)}}]),e}();t.exports=a},{"../config":1,"../fns":2,"./pack":6}],8:[function(e,t,n){"use strict";var i=e("./ptrie"),r=function(e){return new i(e)};t.exports=r},{"./ptrie":10}],9:[function(e,t,n){"use strict";var i=function(e,t){if(e===t)return!0;var n=e.length;return!(n>=t.length)&&(1===n?e===t[0]:t.slice(0,n)===e)};t.exports=i},{}],10:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=e("../config"),s=e("../fns"),u=e("./prefix"),f=e("./unravel"),a=function(){function e(t){i(this,e),this.nodes=t.split(o.NODE_SEP),this.syms=[],this.symCount=0,this._cache=null,t.match(":")&&this.initSymbols()}return r(e,[{key:"initSymbols",value:function(){for(var e=new RegExp("([0-9A-Z]+):([0-9A-Z]+)"),t=0;t<this.nodes.length;t++){var n=e.exec(this.nodes[t]);if(!n){this.symCount=t;break}this.syms[s.fromAlphaCode(n[1])]=s.fromAlphaCode(n[2])}this.nodes=this.nodes.slice(this.symCount,this.nodes.length)}},{key:"has",value:function(e){var t=this;if(!e)return!1;if(this._cache)return this._cache[e]||!1;var n=function n(i,r){var o=t.nodes[i];if("!"===o[0]){if(r===e)return!0;o=o.slice(1)}for(var s=o.split(/([A-Z0-9,]+)/g),f=0;f<s.length;f+=2){var a=s[f],c=s[f+1];if(a){var h=r+a;if(","!==c&&void 0!==c){if(u(h,e))return i=t.indexFromRef(c,i),n(i,h)}else if(h===e)return!0}}return!1};return n(0,"")}},{key:"indexFromRef",value:function(e,t){var n=s.fromAlphaCode(e);return n<this.symCount?this.syms[n]:t+n+1-this.symCount}},{key:"toArray",value:function(){return this._cache?Object.keys(this._cache):Object.keys(f(this))}},{key:"cache",value:function(){this._cache=f(this),this.nodes=null,this.syms=null}}]),e}();t.exports=a},{"../config":1,"../fns":2,"./prefix":9,"./unravel":11}],11:[function(e,t,n){"use strict";var i=function(e){var t={},n=function n(i,r){var o=e.nodes[i];"!"===o[0]&&(t[r]=!0,o=o.slice(1));for(var s=o.split(/([A-Z0-9,]+)/g),u=0;u<s.length;u+=2){var f=s[u],a=s[u+1];if(f){var c=r+f;if(","!==a&&void 0!==a){var h=e.indexFromRef(a,i);n(h,c)}else t[c]=!0}}};return n(0,""),t};t.exports=i},{}]},{},[3])(3)});

@@ -5,3 +5,3 @@ {

"description": "compressed-trie data-structure",
"version": "0.0.2",
"version": "0.0.4",
"main": "./builds/efrt.js",

@@ -18,3 +18,4 @@ "repository": {

"files": [
"builds/"
"builds/",
"src/"
],

@@ -30,3 +31,3 @@ "dependencies": {},

"derequire": "^2.0.3",
"eslint": "^3.1.1",
"eslint": "^3.17.1",
"gaze": "^1.1.2",

@@ -33,0 +34,0 @@ "shelljs": "^0.7.2",

@@ -55,4 +55,38 @@ <div align="center">

the words you input should be pretty normalized. Spaces and unicode are good, but numbers, case-sensitivity, and some punctuation are not (yet) supported.
the words you input should be pretty normalized. Spaces and unicode are good, but numbers, case-sensitivity, and [some punctuation](https://github.com/nlp-compromise/efrt/blob/master/src/config.js) are not (yet) supported.
##Performance
there are two modes that `efrt` can run in, depending on what you want to optimise for.
By itself, it will be ready-instantly, but must lookup words by their prefixes in the trie. This is not super-fast. If you want lookups to go faster, you can call `trie.cache()` first, to pre-compute the queries. Things will run much faster after this:
```js
var compressed = efrt.pack(skateboarders);//1k words (on a macbook)
var trie = efrt.unpack(compressed)
trie.has('tony hawk')
// trie-lookup: 1.1ms
trie.cache()
// caching-step: 5.1ms
trie.has('tony hawk')
// cached-lookup: 0.02ms
```
the `trie.cache()` command will spin the trie into a good-old javascript object, for faster lookups. It takes some time building it though.
In this example, with 1k words, it makes sense to hit `.cache()` if you are going to do more-than 5 lookups on the trie, but your mileage may vary.
You can access the object from `trie._cache` if you'd like use it directly.
## Size
`efrt` will pack filesize down as much as possible, depending upon the redundancy of the prefixes/suffixes in the words, and the size of the list.
* list of countries - `1.5k -> 0.8k` *(46% compressed)*
* all adverbs in wordnet - `58k -> 24k` *(58% compressed)*
* all adjectives in wordnet - `265k -> 99k` *(62% compressed)*
* all nouns in wordnet - `1,775k -> 692k` *(61% compressed)*
but there are some things to consider:
* bigger files compress further (see [🎈 birthday problem](https://en.wikipedia.org/wiki/Birthday_problem))
* using efrt will reduce gains from gzip compression, which most webservers quietly use
* english is more suffix-redundant than prefix-redundant, so non-english words may benefit from other styles
##Use
**IE9+**

@@ -76,1 +110,3 @@ ```html

```
MIT
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