rita

RiTa: A toolkit for natural language and computational literature

npm install rita
34 downloads in the last week
55 downloads in the last month

RiTaJS: a generative language toolkit for JavaScript

The RiTaJS website

RiTaJS is designed to an easy-to-use toolkit for experiments in natural language and generative literature, based on the RiTa (http://rednoise.org/rita) library for Java. Like the original RiTa, RiTaJS works alone or in conjunction with Processing(JS) and/or with its own Canvas renderer, and/or as a NodeJS module. All RiTa and RiTaJS tools are free/libre/open-source according to the GPL (http://www.gnu.org/licenses/gpl.txt).

About the project

In NodeJS


 To install: $ npm install rita

 rita = require('rita');
 rs = rita.RiString("The elephant took a bite.");
 console.log(rs.features());

 To run tests: $ npm test rita

In a browser

Create a new file on your desktop called hello.html, add the following lines, save and drag it into a browser:

  <html>
  <canvas id="canvas" width=200 height=200></canvas>
  <script src="http://rednoise.org/rita/download/rita-latest.min.js"></script>
  <script>

    window.onload = function() {

      // create a RiText and draw it

      RiText("HelloWorld").draw();

    };

  </script>
  <html>

With ProcessingJS

If you want to use RiTa with ProcessingJS, you can simply open Processing and switch to 'JavaScript' mode. If you don't want to use the Processing IDE, you can cimply create an HTML files like this (assuming you've downloaded both libraries to the current directory):

  <html>
  <meta charset="utf-8"/>

  <script src="processing-min.js"></script>
  <script src="rita-latest.min.js"></script>
  <script type="text/processing" data-processing-target="mycanvas">

    size(200,200);
    background(255);

    RiText("SIMPLE").fill(200,100,0).draw();

  </script>
  <canvas id="mycanvas"></canvas>
  <html>

Can I contribute?

Please! We are looking for more coders to help out... Just press Fork at the top of this github page and get started.

If you don't feel like coding but still want to contribute, please join the discussion on the issuetracker and ritajs-dev group.

npm loves you