Code Monkey home page Code Monkey logo

simplenlg's Introduction

SimpleNLG in Javascript

This is a fork of https://github.com/silentrob/simplenlg which is a functional port of SimpleNLG, most the tests, methods classes and interfaces have been ported by Rob Ellis

Notably missing from this port.

  • Adjective ordering is still not complete. [TODO]
  • Aggergating interface is missing. [TODO]
  • Some more complex document types are not yet supported. [TODO]
  • We have a few missing or failing tests. [TODO]
  • NIHLexicon. I hard coded the XML Adapter to simplify the lexicon.
  • The Server Interface -- This seemed out of context and with Node you could easily add something directly.

Setup

Use as Library:

yarn:

yarn add pb-simplenlg

npm

npm i pb-simplenlg

Include in your project

Download or clone the repo.

Install the dependancies

npm install

Example

import Lexicon from '../src/lexicon/lexicon';
import Realiser from '../src/realiser/Realiser';
import NLG from '../src/framework/nlg';

const lexicon = new Lexicon('path', 'lexicon.xml');
const nlg = new NLG(lexicon);
const realiser = new Realiser(lexicon);

// Create a new canned sentense.
let s1 = nlg.createSentence("my dog is happy");

// And realize that sentence like this:
console.log(realiser.realiseSentence(s1)); // My dog is happy.

Whats next.

Jump into the tests, or take a look at the simpleNLG Wiki for more information.

What to help out. Pull requests welcome.

License

SimpleNLG is licensed under the terms and conditions of Mozilla Public License 1.1.

simplenlg's People

Contributors

pbliveshare avatar

Watchers

James Cloos avatar Wenzel 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.