Giter Site home page Giter Site logo

eat-wrapper's Introduction

eat-wrapper

some helpful wrapper functions around the very helpful JSON port of the Edinburgh Associative Thesaurus by Darius Kazemi. See license thing way down below in the depths.

NPM js-standard-style Build Status

EXAMPLE

example basic output of the eat json, looking up the world 'aeroplane':

AEROPLANE: [ { FLY: '15' },
  { FLIGHT: '6' },
  ...
  ]

this module formats it to be more like this:

AEROPLANE: { FLY: 15,
  FLIGHT: 6,
  ...
}

API

If you pass a word that the EAT don't know about, it should hopefully return undefined, so deal with that.

var eatWrapper = require('eat-wrapper')() => invoke that thang, build that muscle

eatWrapper.random(word, weighted:true) => picks an associated word at random. if weighted is true (it is by default), then the randomness will be weighted by the values for each associated word. For example, in this instance: AEROPLANE [ { FLIGHT: '6' }, { PLANE: '3' }], flight would be twice as likely to be returned as plane if it is weighted, but they would have equal chances if it is not weighted.

eatWrapper.keys(word) => returns a list of words associated with the given word

eatWrapper.key(word) => returns the formatted json object of {associatedWord: value, ...} for that word

eatWrapper.eat => returns ginormous JSON object of {WORD {ASSOC-WORD: 'VALUE', ...}, ...}

USAGE/IDEAS

  • Darius Kazemi notes that "It's a weird set of associations very particular to its time and place" which is Britain in the 70s. Could consider it a weirdly specific and janky word net? The thing itself has a "voice" already, can it be made to speak? Can this sort of thing be replicated for other times and spaces? (tags on things?)

  • make a markov chain guide/filter its output towards associated words/concepts?

  • take the eat object and use it to learn d3 or something (COOL)

License

The Edinburgh Associative Thesaurus dataset is public sector data available under an Open Government License. As such you are free to

  • copy, publish, distribute and transmit the Information;
  • adapt the Information;
  • exploit the Information commercially and non-commercially for example, by combining it with other Information, or by including it in your own product or application.

See the Open Government License for further detail.

eat-wrapper's People

Contributors

coleww avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.