-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.js.map
1 lines (1 loc) · 21.7 KB
/
index.js.map
1
{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;AAKA,YAAY,CAAC;;;;;AACb,IAAM,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;;AAExC,IAAM,QAAQ,GAAG,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AACnE,IAAM,UAAU,GAAG,SAAb,UAAU,CAAI,CAAC,EAAE,CAAC,EAAE,CAAC;WAAK,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;CAAA,CAAC;;AAE1E,IAAM,GAAG,GAAG,SAAN,GAAG,CAAI,CAAC,EAAE,CAAC;WAAK,CAAC,GAAG,CAAC;CAAA,CAAC;;AAE5B,IAAM,EAAE,GAAG,SAAL,EAAE,CAAG,CAAC;WAAI,CAAC;CAAA,CAAC;;AAElB,IAAM,GAAG,GAAG,SAAN,GAAG,CAAG,CAAC;WAAI,IAAI;CAAA,CAAC;;AAEtB,IAAM,aAAa,GAAG,IAAI,CAAC,MAAM;;;;;AAAC,AAKlC,IAAM,IAAI,GAAG,SAAP,IAAI,CAAI,CAAC,EAAE,CAAC;WAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;CAAC;;;;;AAAC,AAKxC,IAAM,KAAK,GAAG,SAAR,KAAK,CAAI,MAAM,EAAE,IAAI,EAAE,EAAE;WAAM;AACjC,gBAAQ,EAAE,MAAM;AAChB,cAAM,EAAE,IAAI;AACZ,YAAI,EAAE,EAAE;KACX;CAAC,CAAC;;AAEH,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,aAAa,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;;AAE7C,KAAK,CAAC,KAAK,GAAG,UAAC,CAAC,EAAE,EAA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AP,IAAI,CAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAA6B;QAA3B,MAAM,yDAAG,aAAa;;AACpD,QAAI,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAClE,SAAK,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;AACjE,SAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpB,aAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;KACrB;AACD,WAAO,CAAC,CAAC;CACZ,CAAC;;AAEF,SAAS,CAAC,SAAS,CAAC,IAAI,GAAG,UAAS,CAAC,EAAE,CAAC,EAAE,EAAE,EAA0B;QAAxB,MAAM,yDAAG,aAAa;;AAChE,WAAO,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;CACvC;;;;;;;;;AAAC,AASK,IAAM,GAAG,WAAH,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;;AAE5C,SAAS,CAAC,SAAS,CAAC,GAAG,GAAG,UAAS,EAAE,EAA0B;QAAxB,MAAM,yDAAG,aAAa;;AACzD,WAAO,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;CAChC,CAAC","file":"index.js","sourcesContent":["/**\n APEP\n \n Dada engine inspired library for random text generation.\n*/\n\"use strict\";\nconst walker = require('walker-sample');\n\nconst arrayMap = Function.prototype.call.bind(Array.prototype.map);\nconst arrayFoldr = (f, z, a) => Array.prototype.reduceRight.call(a, f, z);\n\nconst add = (p, c) => p + c;\n\nconst id = x => x;\n\nconst EOF = _ => null;\n\nconst defaultRandom = Math.random;\n\n/**\n Value state pair\n*/\nconst Pair = (x, s) => ({ x: x, s: s });\n\n/**\n Internal state object.\n*/\nconst State = (random, vars, ud) => ({\n 'random': random,\n 'vars': vars,\n 'ud': ud\n});\n\nState.empty = State(defaultRandom, {}, null);\n\nState.setUd = (s, ud) =>\n State(s.random, s.vars, ud);\n\nState.setVars = (s, vars) =>\n State(s.random, vars, s.ud);\n\nState.setRandom = (s, random) =>\n State(random, s.vars, s.ud);\n\nState.getVar = (s, name, def) =>\n typeof s.vars[name] === 'undefined' ? def : s.vars[name];\n\nState.setVar = (s, name, value) => {\n const newVars = Object.create(s.vars);\n newVars[name] = value;\n return State.setVars(s, newVars);\n};\n\nconst Yield = (first, rest) => ({\n first: first,\n rest: rest\n});\n\n/**\n Generator container class.\n*/\nconst Generador = function(impl) {\n this._apep_generadorImpl = impl;\n};\n\n/**\n Run a given generator.\n*/\nconst execute = (p, s, k) =>\n p._apep_generadorImpl(s, k);\n\n/**\n Declare a generator for self reference or late bindings.\n \n @param def Function that takes a reference to generator being defined and\n returns the generator's definition.\n \n Anonymous self reference:\n \n pep.declare((self) =>\n pep.seq(m, self));\n \n Use of forward declarations:\n \n // Use `m` before it is declared or defined.\n const ms = pep.declare(() =>\n pep.seq(m, self));\n \n const m = pep.lit('n');\n \n Later declaration: \n \n // Declare that the some generator `ms` will exist.\n let ms = pep.declare(() => ms);\n \n // Use `ms` in any expression.\n const p = pep.seq('a', ms);\n \n ...\n \n // Actually define `ms` sometime later.\n ms = pep.str('abc');\n\n Also can be used to introduce simple, scoped state:\n \n const counter = pep.declare(() => {\n // declare some variables local to this block.\n let sum = 0;\n\n return pep.seq(\n pep.seq(pep.str(1), pep.str(2), pep.str(3))\n .map(x => {\n // Update the state in an expression.\n sum += i;\n return x;\n }),\n // and use the state sometime later.\n // Declare is used to make sure the current value of `i` is\n // always returned.\n pep.declare(() => pep.lit(i)));\n });\n \n For performance reasons, use declare around the smallest possible generator\n since declare evaluates it's body every time the generator is invoked. \n*/\nexport const declare = (def) => {\n let self;\n return self = new Generador((s, k) =>\n execute(def(self), s, k));\n};\n \n/* Value Generators\n ******************************************************************************/\n/**\n Generate a literal value without any transformations applied.\n*/\nexport const lit = (x) =>\n new Generador((s, k) =>\n Yield(Pair(x, s), k));\n \n/**\n Empty value generator.\n*/\nexport const empty = new Generador((s, k) => k(s));\n\n/**\n Generate a literal string value.\n \n Attempts to convert the input value to a string.\n*/\nexport const str = (x) => lit('' + x);\n\n/**\n Ensure value is inside a generator.\n \n Converts arrays into sequences and wraps any other values that are not\n generators in `str`.\n*/\nconst wrap = (x) => {\n if (typeof x === 'undefined')\n throw new TypeError(\"Cannot convert `undefined` to generator.\");\n \n return x && x._apep_generadorImpl\n ?x\n :Array.isArray(x) ? seqa(x) : str(x);\n};\n \n/* Basic Combinators\n ******************************************************************************/\n/**\n Run `a` and then `run b`.\n*/\nconst next = (a, b) => {\n a = wrap(a);\n b = wrap(b);\n return new Generador((s, k) =>\n execute(a, s, s => execute(b, s, k)));\n};\n\n/**\n Run a sequence of generators left to right.\n \n Literal values are wrapped and converted to strings:\n \n seq('a', g1, 3) === seq(str('a'), g1, str(3))\n*/\nexport const seqa = arrayFoldr.bind(null, (p, c) => next(c, p), empty);\n\n/**\n Same as `seqa` but takes values as arguments.\n*/\nexport const seq = (...generators) => seqa(generators);\n\nGenerador.prototype.seq = function(...generators) {\n return seq(this, ...generators);\n};\n\n/**\n Map function `f` over each element produced by `p`.\n*/\nexport const chain = (p, f) => { \n p = wrap(p);\n \n const loop = (r, k) =>\n r && r.rest \n ?execute(f(r.first.x), r.first.s, s => loop(r.rest(s), k))\n :k(r);\n \n return new Generador((s, k) =>\n loop(execute(p, s, id), k));\n};\n\nGenerador.prototype.chain = function(f) {\n return chain(this, f);\n};\n\n/**\n Map function `f` over each element produced by `p`.\n*/\nexport const map = (p, f) =>\n chain(p, x => lit(f(x)));\n \nGenerador.prototype.map = function(f) {\n return map(this, f);\n};\n\n/**\n Combine the yield results of 1 or more generators.\n \n @param f Accumulate function. Takes accumulated value and current value.\n @param z Initial value.\n @param generators One or more generators to combine.\n*/\nexport const combine = (f, z, ...generators) => {\n const g = seq(...generators);\n return declare(() => {\n let sum = z;\n return seq(\n noop(g.map(x => {\n sum = f(sum, x);\n return x;\n })),\n declare(() => lit(sum)));\n });\n};\n\nGenerador.prototype.combine = function(f, z, ...generators) {\n return combine(f, z, this, ...generators);\n};\n\n/**\n Combine the yielded results of generators into a single string result.\n*/\nexport const join = combine.bind(null, add, '');\n\nGenerador.prototype.join = function(...generators) {\n return join(this, ...generators);\n};\n\n/**\n Combinator that consumes all yielded values.\n \n Still useful for updating state.\n*/\nexport const noop = (...generators) =>\n chain(seq(...generators), _ => empty);\n\n/* Choice\n ******************************************************************************/\n/**\n Choose from along one or more generators, each with its own custom weight.\n*/\nexport const weightedChoice = (weightMap) => {\n const table = walker(arrayMap(weightMap, x => [x[0], wrap(x[1])]));\n return new Generador((s, k) =>\n execute(table(s.random), s, k));\n}; \n\n/**\n Choose from along one or more generators.\n \n Each element has the same weight.\n \n @param elements Array of elements\n*/\nexport const choicea = (elements) =>\n weightedChoice(arrayMap(elements, x => [1, x]));\n\n/**\n Choose from along one or more generators taken as arguments.\n \n @see choicea\n*/\nexport const choice = (...elements) => choicea(elements);\n\n/**\n Generator that optionally produces a value.\n*/\nexport const opt = (g, prob = 0.5) => {\n if (prob > 1 || prob < 0)\n throw new RangeError(\"Probability must be between [0, 1]\");\n \n if (prob === 0)\n return empty;\n else if (prob === 1) \n return g;\n return weightedChoice([[prob, g], [1 - prob, empty]]);\n};\n \n/* Iteration\n ******************************************************************************/\n/**\n Run a generator zero or more times.\n\n @param g Generator\n @param prob At each step, what is the probability that `g` is run.\n 1 means that `g` is run infinity, while 0 means that `g` is never run.\n*/\nexport const many = (g, prob = 0.5) => {\n let self;\n return self = opt(seq(g, declare(() => self)), prob);\n};\n\n/**\n Run a generator one or more times.\n \n @see many\n*/\nexport const many1 = (g, prob = 0.5) =>\n seq(g, many(g, prob));\n\n/* State\n ******************************************************************************/\nconst getState = new Generador((s, k) =>\n Yield(Pair(s, s), k));\n\nconst modifyState = f =>\n new Generador((s, k) => k(f(s)));\n\n/**\n Lookup a stored variable.\n \n @param name Key of the var.\n @param def Value returned if the variable does not exist.\n*/\nexport const get = (name, def = '') =>\n map(getState, s => State.getVar(s, name, def));\n\n/**\n Store the value of a variable.\n \n @param name Key of the var.\n @param value New value.\n*/\nexport const set = (name, value) => \n modify(name, _ => value);\n\n/**\n Update the value of a variable.\n \n @param name Key of the var.\n @param f Map old value to new value value.\n*/\nexport const modify = (name, f) => \n modifyState(s =>\n State.setVar(s, name, f(State.getVar(s, name))));\n \n/**\n Return the current user data.\n*/\nexport const getUd = map(getState, s => s.ud);\n\n/**\n Update the user data with function `f`.\n \n Does not yield any value.\n*/\nexport const modifyUd = f =>\n modifyState(s => State.setUd(s, f(s.ud)));\n\n/**\n Set the current user data.\n \n Does not yield any value.\n*/\nexport const setUd = ud =>\n modifyUd(_ => ud);\n\n/**\n Get the current random number generator.\n*/\nexport const getRandom = map(getState, s => s.random);\n\n/* Execution\n ******************************************************************************/\n/**\n Begin the execution of a generator.\n \n @param g Generator.\n @param ud Optional user data threaded through the generator's states.\n @param r Random number generator.\n \n Returns a Javascript iterator.\n*/\nexport const begin = (g, ud, random = defaultRandom) => {\n let state = State.setRandom(State.setUd(State.empty, ud), random);\n let r = execute(g, state, EOF);\n var z = { \n next: () => {\n if (r && r.rest) {\n const x = r.first.x;\n state = r.first.s;\n r = r.rest(state);\n return { value: x };\n }\n return { done: true };\n }\n };\n z[Symbol.iterator] = () => z;\n return z;\n};\n\nGenerador.prototype.begin = function(ud, random = defaultRandom) {\n return begin(this, ud, random);\n};\n\nGenerador.prototype[Symbol.iterator] = function() {\n return begin(this);\n};\n\n/**\n Left fold over a generator.\n \n @param f Function taking accumulated value and current value.\n @param z Initial value.\n @param g Generator.\n @param ud Optional user data threaded through the generator's states.\n @param r Random number generator.\n*/\nexport const fold = (f, z, g, ud, random = defaultRandom) => {\n let state = State.setRandom(State.setUd(State.empty, ud), random);\n for (let r = execute(g, state, EOF); r && r.rest; r = r.rest(state)) {\n z = f(z, r.first.x);\n state = r.first.s;\n }\n return z;\n};\n\nGenerador.prototype.fold = function(f, z, ud, random = defaultRandom) {\n return fold(f, z, this, ud, random);\n};\n\n/**\n Run a generator to completion, combining results into a string.\n \n @param g Generator.\n @param ud Optional user data threaded through the generator's states.\n @param r Random number generator.\n*/\nexport const run = fold.bind(null, add, '');\n \nGenerador.prototype.run = function(ud, random = defaultRandom) {\n return run(this, ud, random);\n};"],"sourceRoot":"/source/"}