Giter VIP home page Giter VIP logo

rita's Introduction

npm version Maven Central npm version

RiTa: tools for generative natural language

RiTa is implemented in Java and JavaScript, with a common API for both, and is free/libre/open-source via the GPL license.

Features in v2.0

  • Smart lexicon search for words matching part-of-speech, syllable, stress and rhyme patterns
  • Fast, heuristic algorithms for inflection, conjugation, stemming, tokenization, and more
  • Letter-to-sound engine for feature analysis of arbitrary words (with/without lexicon)
  • Integration of the RiScript scripting language, designed for writers
  • Powerful new options for generation via grammars and Markov chains

This repo contains the website, documentation, and examples for RiTa. For the code, see

Note: Version 2.0 contains breaking changes! Please check the release notes...

API

RiTa RiMarkov RiGrammar
RiTa.addTransform()
RiTa.alliterations()
RiTa.analyze()
RiTa.concordance()
RiTa.conjugate()
RiTa.evaluate()
RiTa.grammar()
RiTa.hasWord()
RiTa.isAbbrev()
RiTa.isAdjective()
RiTa.isAdverb()
RiTa.isAlliteration()
RiTa.isNoun()
RiTa.isPunct()
RiTa.isQuestion()
RiTa.isStopWord()
RiTa.isRhyme()
RiTa.isVerb()
RiTa.kwic()
RiTa.markov()
RiTa.pastPart()
RiTa.phones()
RiTa.pos()
RiTa.posInline()
RiTa.presentPart()
RiTa.pluralize()
RiTa.randomOrdering()
RiTa.randomSeed()
RiTa.randomWord()
RiTa.rhymes()
RiTa.search()
RiTa.sentences()
RiTa.singularize()
RiTa.soundsLike()
RiTa.spellsLike()
RiTa.stem()
RiTa.stresses()
RiTa.syllables()
RiTa.tokenize()
RiTa.untokenize()
addText()
completions()
generate()
probability()
probabilities()
size()
toString()
toJSON()
fromJSON()











addRule()
addRules()
expand()
removeRule()
toJSON()
toString()
fromJSON()













RiScript

RiScript is a writer-focused scripting language integrated with RiTa. It enables simple generative primitives within plain text for dynamic expansion at runtime. RiScript primitives can be used as part of any RiTa grammar or executed directly using RiTa.evaluate(). For documentation, see this interactive notebook.


Developers

The website in this repo is generated via the ./scripts/make-site.sh script.

Static pages

The best way to make updates to static pages is to do the following:

$ git clone [email protected]:dhowe/rita.git
$ cd rita
$ sh ./scripts/watch-site.sh
  • then make your changes in /rita/www
  • then refresh and check /rita/pub/index.html in the browser

When ready, create a PR with only the files you have changed (in www and pub).

Reference pages

To make updates to the reference pages, follow the instructions above,
but instead make updates to the JSON files in /rita/docgen/data.


Contributors

Code Contributors

This project exists only because of the people who contribute. Thank you!

Financial Contributors

rita's People

Contributors

dhowe avatar melodyneedsmoney avatar real-john-cheung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rita's Issues

Transform issues

  • articlize should be silent when it cannot find phones
  • articlize should only analyze first word (up to space)
  • pluralize should be silent when it cannot find word
  • pluralize should only analyze last word
  • test 'set of choice'

Problems with tokenizing hyphenated words

oft-cited
off-site
deeply-nested

should be handled as 3 tokens in tokenizer
should be handled as a single token in tokenizer

  • 1. ritajs tests
  • 1. ritajs fix
  • 2. sync tests with java
  • 3. sync fix with java

RiScript: add support for URLs

expect(RiTa.evaluate('[foo](http://blah.com)', {})).eq('[foo](http://blah.com)');

  • markdown URLS
  • also html style
  • add tests for both

Styling for static pages

We need to style these page better: phones.html, riscript.html, tokenization.html,(deleted) and postags.html

Lets add the head so that they look like this (but with the correct text content):

image

Fix reference css on www/index.html

  1. Note that the project structure has changed: rita2doc and RiTaWeb have been combined into RiTaWeb
  2. You should mv away your current rita2doc and RiTaWeb and create a NEW fork of RiTaWeb
  3. Running RiTaWeb/generate-docs.sh will generate only the website index page
  4. However it the css needs to be fixed (see if this can be done by ONLY changing existing css files)
    to maintain the 3 column format

image

RiScript links should handle expressions

input = "![(alT | alT)](http://path/to/img.jpg \"Title.lc\")";
expectHtml(input, "![alT](http://path/to/img.jpg \"title\")");

input = "![(alT | alT)](http://path/to/(img.jpg).cap \"Title\")";
expectHtml(input, "![alT](http://path/to/Img.jpg \"Title\")"); 

Transform names

long: sequence, rsequence, norepeat
short: seq, rseq, nore

Sync tests: grammar-tests, riscript-tests

I've made some changes to riscript that required a bunch of new tests, which I did in the js version, so the java version needs to be updated to match. You can do a search for 'SYNC:' in the js tests

Release Testing Checklist

We need to create a checklist like the one here for the current RiTa build process: #37
Each time there is a new build, someone will go through theses tests.

Remove links to class-names

Pls remove the links shown in the image below (should look the same, just not be linked)

I've moved them into the main RiTa section (RiTa.grammar, RiTa.markov)

Port ReplaceableWriting example

to Processing

from here: /ritaweb/www/examples/p5/ReplaceableWriting/
to here: /rita/examples/processing/ReplaceableWriting/ReplaceableWriting.pde

image

Publish Checklist

  • add links to RiTaWeb for version v1.394
  • move existing website to 'ritav1'
  • script to publish new website
  • publish new website
  • add library.properties file to red
  • publish RiTa v2.01
  • check on npm
  • check on unpkg
  • check on github packages
  • check processing
  • add library.properties file to build script
  • combine ritaweb and rita2doc into ritaweb
  • check maven central issue
  • check p5js site links
  • fix kafgenstein example
  • add note on v2 changes in both README
  • test with observable.hq
  • add gh workflow to auto-publish to maven central

RiScript editor via CodeMirror

  • Create a simple editor (via CodeMirror) for RiScript
  • Add line numbers and scrollbars (when needed only) to the editor
  • Add an output and error areas below
  • Add 'clear', 'save', and 'run' buttons
  • Make lines highlight-able for errors
  • Syntax highlighting (see colors below) for variables, choices, transforms
  • Make code font at least as large as output text font
  • Add keyboard shortcut for run (command-enter, same as p5)
  • Add 'dark mode' checkbox which should be default=true
  • Put all colors for each mode in separate CSS file
  • Add color for comments (single and multiline)
  • Add color for dynamic variables (prefixed with $$)

Regular expressions (in antlr format) are here: https://github.com/dhowe/ritajs/blob/master/grammar/RiScript.g4

Question: what to do about the fact that after many outputs, new ones disappear off the bottom ?

Note: plain text should be white (in dark mode, plain black in light mode)
image

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.