synox

0.1.1 • Public • Published

Synox JavaScript bindings npm

This package implements JavaScript bindings for Synox, a library for program synthesis of string transformations from input-output examples.

Installation

npm install synox

This package expects that you are using a bundler like Webpack, and your deployment target supports WebAssembly. For best results, the core of Synox should be run in a Web Worker.

Example

worker.js

import { workerMain } from 'synox'

workerMain()

main.js

import { init } from 'synox'

const worker = new Worker('worker.js')
const Synox = await init(worker)

const unpaired = []
const examples = [
  [["Alyssa P. Hacker", "1985"], "A. Hacker '85"],
  [["Ben Bitdiddle",    "2002"], "B. Bitdiddle '02"],
]

const prog = await Synox.blinkfill.learn(unpaired, examples)
const result = await prog.run(["Cy D. Fect", "2017"])
console.assert(result === "C. Fect '17")

await prog.free()

License

Copyright (c) 2021 Anish Athalye. Released under the MIT License. See LICENSE.md for details.

Readme

Keywords

none

Package Sidebar

Install

npm i synox

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

765 kB

Total Files

11

Last publish

Collaborators

  • anishathalye