• Stars
    star
    268
  • Rank 153,144 (Top 4 %)
  • Language
    JavaScript
  • License
    GNU General Publi...
  • Created about 9 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

RiTa: the generative language toolkit (in JS)

Build Status npm version npm version CDNJS Gitter 

RiTa.js: a generative language toolkit for JavaScript

The RiTa website

RiTa.js is designed to an easy-to-use toolkit for experiments in natural language and generative literature, based on the original RiTa library for Processing/Java. RiTa.js works alone or with p5.js or node/npm, or in the browser. All RiTa and RiTa.js tools are free/libre/open-source via the GPL.

About the project


 

A simple sketch


Create a new file on your desktop called 'test.html' and download the latest rita.js from here, add the following lines, save and drag it into a browser:

<html>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  <script src="./rita.min.js"></script>
  <script>
    window.onload = function() {
      let words = RiTa.tokenize("The elephant took a bite!");
      $('#content').text(words);
    };
  </script>
  <div id="content" width=200 height=200></div>
<html>

With node.js and npm


To install: $ npm install rita

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

With p5.js


Create a new file on your desktop called 'test.html' and download the latest rita.js from here, add the following lines, save and drag it into a browser:

<html>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.3/p5.min.js"></script>
  <script src="./rita.min.js"></script>
  <script>
  function setup() {

    createCanvas(200,200);
    background(50);
    textSize(20);
    noStroke();

    let words = RiTa.tokenize("The elephant took a bite!")
    for (let i=0; i < words.length; i++) {
        text(words[i], 50, 50 + i*20);
    }
  }
  </script>
</html>

With browserify and npm


Install browserify (if you haven't already)

$ sudo npm install -g browserify

Create a file called 'main.js' with the following code:

require('rita');

let rs = RiString("The elephant took a bite!");
console.log(rs.features());

Now install RiTa

$ npm install rita

Now use browserify to pack all the required modules into bundle.js

$ browserify main.js -o bundle.js

Create create a file called 'test.html' with a single script tag as below, then open it in a web browser and check the output in the 'Web Console'

<script src="bundle.js"></script>

With processing.js


Create a new file on your desktop called 'test.html' and download the latest rita.js from here, add the following lines, save and drag it into a browser:

<html>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/processing.js/1.4.8/processing.min.js"></script>
  <script src="./rita.min.js"></script>
  <script type="text/processing" data-processing-target="processing-canvas">
    void setup() {

      size(200,200);
      background(50);
      textSize(20);
      noStroke();

      String words = RiTa.tokenize("The elephant took a bite!");
      for (int i=0; i < words.length; i++) {
          text(words[i], 50, 50 + i*20);
      }
    }
  </script>
  <canvas id="processing-canvas"> </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, or follow the instructions below...

Development Setup


  1. Download and install git, npm, and gulp. If you have them already, move on to step #2.

    a. You can find a version of git for your OS here
    b. The easiest way to install npm is to install node.js
    c. You can install gulp via npm as follows:

    $ npm install -g gulp
  2. Fork and clone this library.

    a. First, login to github and fork the project
    b. Then, from a terminal/shell:

    $ git clone https://github.com/dhowe/RiTaJS.git
  3. Now navigate into the project folder and install dependencies via npm.

    $  cd RiTaJS && npm install
  4. To create the library from src, use gulp.

    $ gulp build
  5. Run the tests with gulp.

    $ gulp test
  6. Work on an existing issue, then submit a pull request...

More Repositories

1

AdNauseamV1

*** This is not the current AdNauseam repository: please find the current repo here:
JavaScript
385
star
2

RiTaV1

RiTa: the generative language toolkit
JavaScript
354
star
3

ritajs-v2

RiTa: generative language tools
JavaScript
103
star
4

rita

Website, documentation and examples for RiTa
JavaScript
71
star
5

RiTaJSHistory

RiTaJS: A generative language toolkit for JavaScript
JavaScript
44
star
6

dialogic

Dialogic: generative interactive dialog
JavaScript
27
star
7

ritajs

RiTa for JavaScript
JavaScript
23
star
8

AdNauseam-chrome

A Chrome extension to help defend against surveillance and tracking by ad-networks
JavaScript
19
star
9

ChinaEye

Experience the web as if you were living in China...
JavaScript
9
star
10

rita4j

RiTa for Java
Java
8
star
11

annograms

JavaScript
3
star
12

AdLiPo

Replacing ads with generative language
JavaScript
2
star
13

spectre

SPECTRE
JavaScript
2
star
14

TrackMeNot

Development for TrackMeNot v2 (2022)
2
star
15

RiTranslate

A translation API for RiTa
Java
2
star
16

PerceptualReader

Java
2
star
17

Website

Website
JavaScript
2
star
18

riscript

RiScript: a minor language
JavaScript
2
star
19

GetGen

A Workshop for Processing Community Day @ HK 2019
JavaScript
2
star
20

rws

A micro-workshop on randomness
Processing
2
star
21

AoAServer

Architecture of Association server
Java
1
star
22

GML

Vogel's Generative Movement Language (GML)
Java
1
star
23

AdCollector

JavaScript
1
star
24

ReadersJS

JavaScript
1
star
25

spectre-server

JavaScript
1
star
26

TrackMeNotWeb

Website for TrackMeNot Project
HTML
1
star
27

spectre-mail

spectre-mail
JavaScript
1
star
28

ReadersWeb

Website for The Readers Project
HTML
1
star
29

GlyphFlock

Demo of path-based flocking in p5.js
JavaScript
1
star
30

LongestCommonPhrase

LongestCommonPhrase implementation
Java
1
star
31

Assign7

Assign7
JavaScript
1
star
32

SomeThingWeAre

JavaScript
1
star
33

AdLiPoV2

Updated AdLiPo Dev
JavaScript
1
star
34

ritwit

The RiTwit library for js
JavaScript
1
star
35

RiTaBox2d

JavaScript
1
star
36

AdWatch

AdNauseam automated with Nightwatch
JavaScript
1
star