Frequently Asked Questions

cqx931 edited this page Jul 16, 2018 · 6 revisions

Welcome to the RiTa FAQ!

For Developers

What is RiTa?

RiTa is a software toolkit for computational or generative literature. It provides tools for artists and writers working with natural language in programmable media. It is free/libre and open-source, and is designed to be simple while still enabling powerful features: context-free grammars, n-grams, conjugation, tokenization, pluralization, feature-analysis (part-of-speech, phonemes, stresses), etc.

Why is it called RiTa?

The name comes from the old Norse, meaning to mark, scratch, or scribble.

On what platform or language or environment can I use RiTa?

RiTa is implemented in both Java and JavaScript and runs in a number of popular programming environments including Android, Processing, Node, and p5.js.

Does RiTa use machine learning techniques?

No. RiTa is a set of heuristic solutions to a constrained set of natural language tasks. Each algorithm has been hand-crafted to handle the specific complexities of English (by myself or by one of the many authors I've borrowed from). During the years of writing and improving the library, I've learned a great deal about these complexities and continue to understand the English language (and context-sensitive languages in general) in ways I would not have predicted.

What does RiTa's heuristic approach mean for the toolkit?

The short answer is that the library will remain small, fast, and perhaps most importantly, transparent -- it should be relatively clear to other coders what it is doing and why. On the other hand, it will be difficult (though not impossible) to extend to other languages, as this would require extensive knowledge of both the target language and the RiTa code itself. Finally there are tasks for which no good heuristic solutions have been found (this is both a shortcoming and an opportunity), and as such they are absent in the toolkit.

But wouldn’t machine-learning (ML) approaches do better?

Yes, ML techniques may well be more successful at some of the specific tasks performed by RiTa. However, as an author I am not only interested in performance. I want RiTa to be approachable (and understandable) for as large and diverse a set of users as possible. I also want it to run in as wide a range of environments as possible, including the browser, which is still the best way we have of quickly sharing work. Perhaps more importantly, I would argue that creative tools should not only be useful, but should help us to better understand the domain in which we work. For RiTa, this means that users and developers should also always be learning about aesthetically-oriented language, not only about neural networks or optimization. The most successful ML models, thus far at least, have been able to tell us very little about the domain under investigation.

How should I setup my development environment?

  1. Download and install Eclipse for Java.
  2. In the Eclipse menu, select 'File' > 'Import...'
  3. In the 'Import Window' select 'Git' > 'Projects from Git', then press Next.
  4. Select 'Clone URI' > then Next and copy and paste the 'HTTPS clone URL' from RiTa's Github page into the URI field.
  5. Press Next to proceed with the default master branch or (optionally) configure the project directory.
  6. Press Next and select 'Import existing projects' to finish.
  7. Right click on 'pom.xml' from RiTa root directory in Package Explorer panel in Eclipse and select 'Run as' > 'Maven install'.
  8. (If you are also working on RiTaJS) In terminal, run ln -s /path/to/ritajs js from rita folder. An alias of RiTaJS will be created in your rita folder. If you have it right, when you build, it should say:
[echo] Checking for rita.js...
     [echo] "RiTaJS found..."
     [echo] Copying js files ...

How to build RiTa from source?

  1. In the Eclipse menu, select 'Window' > 'Show View' -> 'Ant

  2. Click the 'Add buildfile' button to add a buildfile in the newly added Ant panel, and navigate to RiTa/resources/build.xml

  3. 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)

  4. (Optional) Ignore this step if you are on Mac or step 9a to c if you are on Windows, install ant and use cygwin to run the command $ cd RiTa/resources && ant build.

  5. When the build is complete, project resources can be found in RiTa/dist

How do I build docs?

You can build the docs either by running $ cd RiTa/resources && ant build or
$ cd RiTa/resources && ant

What is the usual workflow for developers?

Working on Known issues

The most common task is working on a test case in KnownIssues-tests. (RiTa/java/rita/test/ or RiTaJS/test/KnownIssues-tests.js)

In most of the cases, the same issue is valid for both JAVA and JS. You can start fixing the issue either from JAVA or JS, and make sure to make the same changes later to the other one.

After fixing the issue, please remove the test case from KnownIssues-tests and place it to a proper location in another corresponding test file.

Working on rita dictionary

Please always change the dictionary in RiTaJS/src/rita_dict.js You can update the changes to JAVA by running scripts/ in RiTa

How do I test a new release?

Before release

  • Run each of the RiTa examples on each of the platforms:


  • In the browser with dom (Chrome/Firefox)
  • In the browser with p5.js
  • Test 'Analysis' and 'RandomRhymes' examples with no lexicon, using rita.js, rather than rita-full.js and verify that the correct warning message is shown


  • In Processing
  • In Processing for Android (Ignore the example: ReplaceableWriting for Android tests)
  • As a standalone Java program (jar)
  • As a standalone Android app (jar)

Post release
Pay attention to any error or warning message during the process:

Testing RiTa website

  • Check and fix errors in the console tab of developer tools for each page
  • Check links (with a link-checker) and fix any errors
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.