{"id":18387922,"url":"https://github.com/dhowe/rita4j","last_synced_at":"2025-06-26T18:34:42.784Z","repository":{"id":36953127,"uuid":"216313864","full_name":"dhowe/rita4j","owner":"dhowe","description":"RiTa for Java","archived":false,"fork":false,"pushed_at":"2023-12-05T11:55:47.000Z","size":7872,"stargazers_count":8,"open_issues_count":9,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-07T01:34:47.752Z","etag":null,"topics":["generative-art","generative-text","natural-language","natural-language-generation","natural-language-processing","text-analysis"],"latest_commit_sha":null,"homepage":"https://rednoise.org/rita","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dhowe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"open_collective":"rita"}},"created_at":"2019-10-20T05:46:28.000Z","updated_at":"2024-02-18T16:34:07.000Z","dependencies_parsed_at":"2024-02-03T21:46:59.593Z","dependency_job_id":null,"html_url":"https://github.com/dhowe/rita4j","commit_stats":null,"previous_names":[],"tags_count":68,"template":false,"template_full_name":null,"purl":"pkg:github/dhowe/rita4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhowe%2Frita4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhowe%2Frita4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhowe%2Frita4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhowe%2Frita4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhowe","download_url":"https://codeload.github.com/dhowe/rita4j/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhowe%2Frita4j/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262123303,"owners_count":23262560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["generative-art","generative-text","natural-language","natural-language-generation","natural-language-processing","text-analysis"],"created_at":"2024-11-06T01:29:16.057Z","updated_at":"2025-06-26T18:34:42.762Z","avatar_url":"https://github.com/dhowe.png","language":"Java","funding_links":["https://opencollective.com/rita","https://opencollective.com/rita/donate"],"categories":[],"sub_categories":[],"readme":"![Maven Central](https://img.shields.io/maven-central/v/org.rednoise/rita) \u003ca href=\"http://www.gnu.org/licenses/gpl-3.0.en.html\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-GPL-orange.svg\" alt=\"npm version\"\u003e\u003c/a\u003e\n\n## RiTa: tools for generative natural language\n\nRiTa is implemented in Java and JavaScript, with a common [API](https://github.com/dhowe/rita4j/blob/master/README.md#api) for both, and is free/libre/open-source via the GPL license.\n\n### Features in v2.0\n\n* Smart lexicon search for words matching part-of-speech, syllable, stress and rhyme patterns\n* Fast, heuristic algorithms for inflection, conjugation, stemming, tokenization, and more\n* Letter-to-sound engine for feature analysis of arbitrary words (with/without lexicon)\n* Integration of the [RiScript](https://observablehq.com/@dhowe/riscript) scripting language, designed for writers\n* Powerful new options for generation via grammars and Markov chains\n\n###\n\n* For JavaScript, see [this repo](https://github.com/dhowe/ritajs) or use it with [npm](https://www.npmjs.com/package/rita) or [unpkg](https://unpkg.com/browse/rita/dist/)\n* A simple [Processing example](#in-processing) \n* A simple [Java example](#a-simple-example-java)\n* For [Developers](#developing)\n\nNote: Version 2.0 contains breaking changes! Please check the [release notes](https://rednoise.org/rita/#whats-new-wrapper)\n\n### Installation\n\n* Via [github packages](https://github.com/dhowe/rita4j/packages/)\n* Via [maven central](https://search.maven.org/artifact/org.rednoise/rita)\n* Or directly in maven:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.rednoise\u003c/groupId\u003e\n  \u003cartifactId\u003erita\u003c/artifactId\u003e\n  \u003cversion\u003e2.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n## API\n  \u003ctable cellspacing=\"0\" cellpadding=\"0\" style=\"vertical-align: top;\"\u003e\n   \u003ctr\u003e\n    \u003cth colspan=2 style=\"vertical-align: top;text-align: left; padding-left: 12px\"\u003eRiTa\n    \u003c/th\u003e\n    \u003cth colspan=1 style=\"vertical-align: top;text-align: left;\"\u003eRiMarkov\u003c/th\u003e\n    \u003cth colspan=1 style=\"vertical-align: top;text-align: left;\"\u003eRiGrammar\u003c/th\u003e\n   \u003c/tr\u003e\n   \u003ctr\u003e\n    \u003ctd style=\"vertical-align: top; padding-top: 15px\"\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/addTransform/index.html\"\u003eRiTa.addTransform()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/alliterations/index.html\"\u003eRiTa.alliterations()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/analyze/index.html\"\u003eRiTa.analyze()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/concordance/index.html\"\u003eRiTa.concordance()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/conjugate/index.html\"\u003eRiTa.conjugate()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/evaluate/index.html\"\u003eRiTa.evaluate()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/grammar/index.html\"\u003eRiTa.grammar()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/hasWord/index.html\"\u003eRiTa.hasWord()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/isAbbrev/index.html\"\u003eRiTa.isAbbrev()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/isAdjective/index.html\"\u003eRiTa.isAdjective()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/isAdverb/index.html\"\u003eRiTa.isAdverb()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/isAlliteration/index.html\"\u003eRiTa.isAlliteration()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/isNoun/index.html\"\u003eRiTa.isNoun()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/isPunct/index.html\"\u003eRiTa.isPunct()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/isQuestion/index.html\"\u003eRiTa.isQuestion()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/isStopWord/index.html\"\u003eRiTa.isStopWord()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/isRhyme/index.html\"\u003eRiTa.isRhyme()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/isVerb/index.html\"\u003eRiTa.isVerb()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/kwic/index.html\"\u003eRiTa.kwic()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/markov/index.html\"\u003eRiTa.markov()\u003c/a\u003e\u003cbr/\u003e\n    \u003c/td\u003e\n    \u003ctd style=\"vertical-align: top; padding-top: 15px\"\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/pastPart/index.html\"\u003eRiTa.pastPart()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/phones/index.html\"\u003eRiTa.phones()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/pos/index.html\"\u003eRiTa.pos()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/posInline/index.html\"\u003eRiTa.posInline()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/presentPart/index.html\"\u003eRiTa.presentPart()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/pluralize/index.html\"\u003eRiTa.pluralize()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/randomOrdering/index.html\"\u003eRiTa.randomOrdering()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/randomSeed/index.html\"\u003eRiTa.randomSeed()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/randomWord/index.html\"\u003eRiTa.randomWord()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/rhymes/index.html\"\u003eRiTa.rhymes()\u003c/a\u003e\u003cbr/\u003e\n      \u003c!--a href=\"./RiTa/scripting/index.html\"\u003eRiTa.scripting()\u003c/a\u003e\u003cbr/--\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/search/index.html\"\u003eRiTa.search()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/sentences/index.html\"\u003eRiTa.sentences()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/singularize/index.html\"\u003eRiTa.singularize()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/soundsLike/index.html\"\u003eRiTa.soundsLike()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/spellsLike/index.html\"\u003eRiTa.spellsLike()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/stem/index.html\"\u003eRiTa.stem()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/stresses/index.html\"\u003eRiTa.stresses()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/syllables/index.html\"\u003eRiTa.syllables()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/tokenize/index.html\"\u003eRiTa.tokenize()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiTa/untokenize/index.html\"\u003eRiTa.untokenize()\u003c/a\u003e\u003cbr/\u003e\n      \u003c!--a href=\"./RiTa/VERSION/index.html\"\u003eRiTa.VERSION\u003c/a\u003e\u003cbr/--\u003e\n    \u003c/td\u003e\n    \u003ctd style=\"vertical-align: top !important; padding-top: 15px; min-width: 125px\"\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiMarkov/addText/index.html\"\u003eaddText()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiMarkov/completions/index.html\"\u003ecompletions()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiMarkov/generate/index.html\"\u003egenerate()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiMarkov/probability/index.html\"\u003eprobability()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiMarkov/probabilities/index.html\"\u003eprobabilities()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiMarkov/size/index.html\"\u003esize()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiMarkov/toString/index.html\"\u003etoString()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiMarkov/toJSON/index.html\"\u003etoJSON()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiMarkov/fromJSON/index.html\"\u003efromJSON()\u003c/a\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n    \u003c/td\u003e\n    \u003ctd style=\"vertical-align: top !important; padding-top: 15px; min-width: 125px\"\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiGrammar/addRule/index.html\"\u003eaddRule()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiGrammar/addRules/index.html\"\u003eaddRules()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiGrammar/expand/index.html\"\u003eexpand()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiGrammar/removeRule/index.html\"\u003eremoveRule()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiGrammar/toJSON/index.html\"\u003etoJSON()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiGrammar/toString/index.html\"\u003etoString()\u003c/a\u003e\u003cbr/\u003e\n      \u003ca href=\"https://rednoise.org/rita/reference/RiGrammar/fromJSON/index.html\"\u003efromJSON()\u003c/a\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n    \u003c/td\u003e\n \u003c/tr\u003e\n\u003c/table\u003e\n\n## RiScript\n\nRiScript is a simple, writer-focused scripting language included in RiTa. It enables several generative primitives within plain text for expansion at runtime. RiScript primitives can be used as part of any [RiTa grammar](https://rednoise.org/rita/reference/RiTa/grammar/) or executed directly using [RiTa.evaluate()](https://rednoise.org/rita/reference/RiTa/evaluate/). For  documentation, see [this interactive notebook](https://observablehq.com/@dhowe/riscript).\n\n\u003cbr\u003e\n\n--------------------\n\n\u003cbr\u003e\n\n### Developing\n```sh\n$ git clone https://github.com/dhowe/rita4j.git\n$ cd rita4j\n$ mvn install      # when done, you should see \"BUILD SUCCESS\"\n```\nThe project requires a minimum version of Java 8 and Maven 3.6 to build.\u003cbr\u003e\n\n### Eclipse\n1. Do steps above under **Developing**\n2. In eclipse, File-\u003eImport-\u003eMaven-\u003eExisting Maven Projects and select your 'rita4j' folder\n3. Right-click on project, and select 'Run-as' -\u003e 'Maven install' or 'JUnit tests'\n\n\u003cbr/\u003e\n\nPlease make contributions via [fork-and-pull](https://reflectoring.io/github-fork-and-pull/) - thanks!\n\n--------------------\n\n\u003cbr/\u003e\n\n## A Simple Example (Java)\n\n\u0026nbsp; \u0026nbsp; For online examples in JavaScript, see [this page](https://rednoise.org/rita/#examples)\n\n1. Create a new Java project in Eclipse (or your IDE of choice)\n2. Download [rita.jar](https://github-registry-files.githubusercontent.com/216313864/bd26cf80-1cad-11ec-9175-4bd56458eebc?X-Amz-Algorithm=AWS4-HMAC-SHA256\u0026X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220319%2Fus-east-1%2Fs3%2Faws4_request\u0026X-Amz-Date=20220319T092932Z\u0026X-Amz-Expires=300\u0026X-Amz-Signature=76f6397b84f722b45d62516d547d090047e67250ef398b4fe72b7ee2f455d9c1\u0026X-Amz-SignedHeaders=host\u0026actor_id=0\u0026key_id=0\u0026repo_id=216313864\u0026response-content-disposition=filename%3Drita-2.4.501.jar\u0026response-content-type=application%2Foctet-stream) and add it to the build path for the project. In eclipse: 'Project' \u003e 'Properties' \u003e 'Java Build Path' \u003e 'Libraries' \u003e 'Add External JARs...'\n3. Create and run a new class, SimpleExample.java, with the following code:\n```Java\nimport rita.*;\n\npublic class SimpleExample {\n\n  public static void main(String[] args) {\n\n    System.out.println(RiTa.analyze(\"The elephant took a bite!\"));\n  }\n}\n```\n\n## In Processing\n\nTo install:\n\n1. Open Processing and select 'Sketch' menu \u003e 'Import Library...' \u003e 'Add Library...'\n2. Search for 'RiTa' and then install it\n\nCreate an example sketch as follows (and/or see the included examples):\n```java\nimport rita.*;\nimport java.util.*;\n\nvoid setup() {\n\n  size(600, 200);\n  background(50);\n  textSize(20);\n  noStroke();\n\n  Map data = RiTa.analyze(\"The elephant took a bite!\");\n\n  float y = 15;\n  for (Iterator it = data.keySet().iterator(); it.hasNext();) {\n    String key = (String) it.next();\n    text(key + \": \" + data.get(key), 25, y += 26);\n  }\n}\n```\n\n\n## Contributors\n\n### Code Contributors\n\nThis project exists only because of the people who contribute. Thank you!\n\u003ca href=\"https://github.com/dhowe/RiTa/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/RiTa/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n### Financial Contributors\n\u003ca href=\"https://opencollective.com/rita/donate\" target=\"_blank\"\u003e\n  \u003cimg src=\"https://opencollective.com/rita/contribute/button@2x.png?color=blue\" width=300 /\u003e\n\u003c/a\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhowe%2Frita4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhowe%2Frita4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhowe%2Frita4j/lists"}