0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

18
web/node_modules/efrt-unpack/README.md generated vendored Normal file
View file

@ -0,0 +1,18 @@
the **unpack** half of the [efrt library](npmjs.com/package/efrt).
See that repo for full documentation.
```bash
npm install efrt-unpack
```
```html
<script src="https://unpkg.com/efrt@latest/builds/efrt-unpack.min.js"></script>
<script>
const compressedTrie = 'true¦denmark,o0scandanavia;h0ntar0;io'
const p = unpack(compressedTrie)
console.log(p.hasOwnProperty('ohio'))
// true
</script>
```
MIT

1
web/node_modules/efrt-unpack/efrt-unpack.min.js generated vendored Normal file
View file

@ -0,0 +1 @@
"use strict";const BASE=36,seq="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",cache=seq.split("").reduce(function(n,o,e){return n[o]=e,n},{}),toAlphaCode=function(n){if(void 0!==seq[n])return seq[n];let o=1,e=36,t="";for(;n>=e;n-=e,o++,e*=36);for(;o--;){const o=n%36;t=String.fromCharCode((o<10?48:55)+o)+t,n=(n-o)/36}return t},fromAlphaCode=function(n){if(void 0!==cache[n])return cache[n];let o=0,e=1,t=36,r=1;for(;e<n.length;o+=t,e++,t*=36);for(let e=n.length-1;e>=0;e--,r*=36){let t=n.charCodeAt(e)-48;t>10&&(t-=7),o+=t*r}return o};var encoding={toAlphaCode:toAlphaCode,fromAlphaCode:fromAlphaCode},symbols=function(n){const o=new RegExp("([0-9A-Z]+):([0-9A-Z]+)");for(let e=0;e<n.nodes.length;e++){const t=o.exec(n.nodes[e]);if(!t){n.symCount=e;break}n.syms[encoding.fromAlphaCode(t[1])]=encoding.fromAlphaCode(t[2])}n.nodes=n.nodes.slice(n.symCount,n.nodes.length)};const indexFromRef=function(n,o,e){const t=encoding.fromAlphaCode(o);return t<n.symCount?n.syms[t]:e+t+1-n.symCount},toArray=function(n){const o=[],e=(t,r)=>{let s=n.nodes[t];"!"===s[0]&&(o.push(r),s=s.slice(1));const c=s.split(/([A-Z0-9,]+)/g);for(let s=0;s<c.length;s+=2){const u=c[s],i=c[s+1];if(!u)continue;const l=r+u;if(","===i||void 0===i){o.push(l);continue}const f=indexFromRef(n,i,t);e(f,l)}};return e(0,""),o},unpack=function(n){const o={nodes:n.split(";"),syms:[],symCount:0};return n.match(":")&&symbols(o),toArray(o)};var unpack_1=unpack,unpack_1$1=function(n){const o=n.split("|").reduce((n,o)=>{const e=o.split("¦");return n[e[0]]=e[1],n},{}),e={};return Object.keys(o).forEach(function(n){const t=unpack_1(o[n]);"true"===n&&(n=!0);for(let o=0;o<t.length;o++){const r=t[o];!0===e.hasOwnProperty(r)?!1===Array.isArray(e[r])?e[r]=[e[r],n]:e[r].push(n):e[r]=n}}),e};module.exports=unpack_1$1;

20
web/node_modules/efrt-unpack/package.json generated vendored Normal file
View file

@ -0,0 +1,20 @@
{
"author": "Spencer Kelly <spencermountain@gmail.com> (http://spencermounta.in)",
"name": "efrt-unpack",
"description": "compressed-trie data-structure",
"version": "2.2.0",
"main": "./efrt-unpack.min.js",
"repository": {
"type": "git",
"url": "git://github.com/nlp-compromise/efrt.git"
},
"scripts": {
"test": "../node_modules/.bin/tape ./quick.test.js | '../node_modules/.bin/tap-dancer' --color"
},
"files": [
"efrt-unpack.min.js"
],
"dependencies": {},
"devDependencies": {},
"license": "MIT"
}