*** This repository is deprecated. See the current version of RiTa HERE. ***
RiTa: the generative language toolkit
The RiTa website
RiTa is designed to be an easy-to-use toolkit for experiments in natural language and generative literature. It is implemented in Java and JavaScript (with a unified API for both) and optionally integrates with Processing, Android, Node, p5.js, Browserify, Bower, etc. It is free/libre and open-source via the GPL license (http://www.gnu.org/licenses/gpl.txt).
Please see https://github.com/dhowe/RiTaJS for the JavaScript implementation of RiTa.
About the project
- Author: Daniel C. Howe
- License: GPLv3 (see included LICENSE file)
- Web Site: https://rednoise.org/rita
- Reference: https://rednoise.org/rita/reference
- Github Repo: https://github.com/dhowe/RiTa/
- Issues: https://github.com/dhowe/RiTa/issues
- FAQ: https://github.com/dhowe/RiTa/wiki
- Related: RiTaJS
become a backer!
Support us with a monthly donation andA Simple Example (Java)
  For JavaScript examples, go here
- Create a new Java project in Eclipse (or your IDE of choice)
- Download rita.jar and add it to the build path for the project. In eclipse: 'Project' > 'Properties' > 'Java Build Path' > 'Libraries' > 'Add External JARs...'
- Create and run a new class, SimpleExample.java, with the following code:
import rita.*;
public class SimpleExample {
public static void main(String[] args) {
RiString rs = new RiString("The elephant took a bite!");
System.out.println(rs.features());
}
}
In Processing
To install:
- Open Processing and select 'Sketch' menu > 'Import Library...' > 'Add Library...'
- Search for 'RiTa' and then install it
Create an example sketch as follows (and/or see the included examples):
import rita.*;
import java.util.*;
void setup() {
size(600, 200);
background(50);
textSize(20);
noStroke();
RiString rs = new RiString("The elephant took a bite!");
Map data = rs.features();
float y = 15;
for (Iterator it = data.keySet().iterator(); it.hasNext();) {
String key = (String) it.next();
text(key + ": " + data.get(key), 25, y += 26);
}
}
In Processing (Android-mode)
- If RiTa library is not installed, open Processing and select 'Sketch' menu > 'Import Library...' > 'Add Library...'
- Search for 'RiTa' and then install it
- Follow these instructions to setup your environment, OR follow steps 4-6 below
- Switch to Android mode in Processing 3.x on PC or Mac by clicking the 'Java' button on the upper-right of the UI, then select 'Add Mode...'
- Select 'Android Mode' from 'Contribution Manager' window and then install it and the required Android SDK when prompted
- Restart Processing and input the example sketch below
- Switch to 'Android' mode by clicking the 'Java' button
- Connect your Android device to your PC via a USB cable
- On your Android device, go to ‘Settings’ - ‘About phone’ and tap on ‘Build number’ for five times to become a developer 10.Go back to ‘Settings’, go to ‘Developer options’ and switch on ‘USB debugging'
- Run the example sketch
An example sketch:
import rita.*;
import java.util.*;
void setup() {
size(600, 200);
background(50);
textSize(20);
noStroke();
RiString rs = new RiString("The elephant took a bite!");
Map data = rs.features();
float y = 15;
for (Iterator it = data.keySet().iterator(); it.hasNext();) {
String key = (String) it.next();
text(key + ": " + data.get(key), 25, y += 26);
}
}
Can I contribute?
Please! We are looking for more coders to help out... Just press Fork at the top of this page and get started, or follow the instructions below...
If you don't feel like coding but still want to contribute, please send a twitter message to @RiTaSoftware.
Development Setup (in Eclipse)
-
Download and install Eclipse for Java.
-
In the Eclipse menu, select 'File' > 'Import...'
-
In the 'Import Window' select 'Git' > 'Projects from Git', then press Next.
-
Select 'Clone URI' > then Next and copy and paste the 'HTTPS clone URL' https://github.com/dhowe/RiTa.git from RiTa's Github page into the URI field.
-
Press Next to proceed with the default master branch or (optionally) configure the project directory.
-
Press Next and select 'Import existing projects' to finish.
-
Right click on 'pom.xml' from RiTa root directory in Package Explorer panel in Eclipse and select 'Run as' > 'Maven install'.
-
To run the tests:
a. Navigate to the RiTa/resources directory and right-click on 'build.xml'
b. Select 'Run as' > 'Ant Build' to compile and run the tests in JUnit.
-
To build the project:
a. In the Eclipse menu, select 'Window' > 'Show View' -> 'Ant
b. Click the 'Add buildfile' button to add a buildfile in the newly added Ant panel, and navigate to RiTa/resources/build.xml
c. Click to expand the 'RiTa' menu and reveal the various tasks, then double-click 'build' (or run
$ cd RiTa/resources && ant build
from the terminal)d. (Optional) if you are on Windows, you can use cygwin, by installing ant and using it to run the command
$ cd RiTa/resources && ant build
.e. When the build is complete, project resources can be found in RiTa/dist
-
Work on an existing issue, then submit a pull request...
-
(Optional) If you encounter error
java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version
, follow these instructions to install Maven manually.
Contributors
Code Contributors
This project exists only because of the people who contribute. Thank you! [Contribute].
Financial Contributors
Become a financial contributor and help us sustain our community. [Contribute]
Individuals
Organizations
Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]