Code Monkey home page Code Monkey logo

sfacts's Introduction

Build Status Coverage Status Code Climate

sfacts - Scripted Facts

This library reads in table and topic data into tuples for use in SuperScript. It uses the LevelUp interface alongside MongoDown as a backing store.

sfacts supports ChatScript tables and topics.

Note: Before v1.0.0, sfacts used to write to the filesystem using LevelDB. It now writes to MongoDB, to facilitate scaling of SuperScript.

API

  • clean(dbName|level, callback)
  • create({name:dbName, db: LevelDB, destroy?: LevelDB.destroy.bind(LevelDB)}, clean, callback)
  • load({name:dbName, db: LevelDB, destroy?: LevelDB.destroy.bind(LevelDB)}, files, clean, callback)

The boolean parameter clean in the create and load methods wipes the existing database if it exists, before creating a new one.

Note: The methods pre-v1.0.0 db and expand are no longer available. The function signatures create and load have changed, and now are required to be called asynchronously (i.e. has a callback parameter).

The return value of create and load is an object:

  • conceptToList(term, [depth,] callback)
  • createUserDB(dbName)
  • createUserDBWithData(dbName, files, callback)
  • db
  • findParentConcepts(term, callback)
  • level
  • loadFiles(files, callback)

Note: The method pre-v1.0.0 loadFile is now named loadFiles. Its behavior is exactly the same.

sfacts's People

Contributors

silentrob avatar bensalilijames avatar wehriam avatar laurian avatar snowyu avatar

Watchers

 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.