{"id":18556611,"url":"https://github.com/valkryst/vnamegenerator","last_synced_at":"2025-04-06T20:11:48.229Z","repository":{"id":8302929,"uuid":"57910825","full_name":"Valkryst/VNameGenerator","owner":"Valkryst","description":"A Java implementation of various procedural name generation algorithms, including combinatorial, consonant vowel, context-free grammar, and Markov chain.","archived":false,"fork":false,"pushed_at":"2025-03-21T12:56:21.000Z","size":386,"stargazers_count":87,"open_issues_count":0,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T17:09:30.913Z","etag":null,"topics":["consonants","context-free-grammar","generator","grammar","hacktoberfest","markov-chain","name","name-generation","name-generator","procedural","procedural-generation","roguelike","roguelike-library","roguelikedev","vowel"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Valkryst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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,"publiccode":null,"codemeta":null},"funding":{"github":"Valkryst"}},"created_at":"2016-05-02T18:19:20.000Z","updated_at":"2025-03-21T12:56:18.000Z","dependencies_parsed_at":"2024-06-04T01:45:39.593Z","dependency_job_id":"0ea820e0-7982-4537-973e-26b6871bd113","html_url":"https://github.com/Valkryst/VNameGenerator","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Valkryst%2FVNameGenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Valkryst%2FVNameGenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Valkryst%2FVNameGenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Valkryst%2FVNameGenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Valkryst","download_url":"https://codeload.github.com/Valkryst/VNameGenerator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543593,"owners_count":20955865,"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":["consonants","context-free-grammar","generator","grammar","hacktoberfest","markov-chain","name","name-generation","name-generator","procedural","procedural-generation","roguelike","roguelike-library","roguelikedev","vowel"],"created_at":"2024-11-06T21:32:18.592Z","updated_at":"2025-04-06T20:11:48.206Z","avatar_url":"https://github.com/Valkryst.png","language":"Java","funding_links":["https://github.com/sponsors/Valkryst"],"categories":[],"sub_categories":[],"readme":"![Java CI with Maven](https://github.com/Valkryst/VNameGenerator/workflows/Java%20CI%20with%20Maven/badge.svg?branch=master)\n\nAs of this project's inception, the included algorithms are the only ones my research has turned up. If you know of\nany other _unique_ algorithms for name generation, then please let me know. I would love to implement them.\n\n## Table of Contents\n\n* [Installation](https://github.com/Valkryst/VNameGenerator#installation)\n\t* [Gradle](https://github.com/Valkryst/VNameGenerator#-gradle)\n\t* [Maven](https://github.com/Valkryst/VNameGenerator#-maven)\n\t* [sbt](https://github.com/Valkryst/VNameGenerator#-scala-sbt)\n* [Algorithms](https://github.com/Valkryst/VNameGenerator#algorithms)\n    * [Combinatorial](https://github.com/Valkryst/VNameGenerator#combinatorial)\n\t* [Consonant Vowel](https://github.com/Valkryst/VNameGenerator#consonant-vowel)\n\t* [Context Free Grammar](https://github.com/Valkryst/VNameGenerator#context-free-grammar)\n\t* [Markov Chain](https://github.com/Valkryst/VNameGenerator#markov-chain)\n\n## Installation\n\nVNameGenerator is hosted on the [JitPack package repository](https://jitpack.io/#Valkryst/VNameGenerator)\nwhich supports Gradle, Maven, and sbt.\n\n### ![Gradle](https://i.imgur.com/qtc6bXq.png?1) Gradle\n\nAdd JitPack to your `build.gradle` at the end of repositories.\n\n```\nallprojects {\n\trepositories {\n\t\t...\n\t\tmaven { url 'https://jitpack.io' }\n\t}\n}\n```\n\nAdd VNameGenerator as a dependency.\n\n```\ndependencies {\n\timplementation 'com.github.Valkryst:VNameGenerator:2024.03.25'\n}\n```\n\n### ![Maven](https://i.imgur.com/2TZzobp.png?1) Maven\n\nAdd JitPack as a repository.\n\n``` xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003ejitpack.io\u003c/id\u003e\n        \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n```\nAdd VNameGenerator as a dependency.\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.Valkryst\u003c/groupId\u003e\n    \u003cartifactId\u003eVNameGenerator\u003c/artifactId\u003e\n    \u003cversion\u003e2024.03.25\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### ![Scala SBT](https://i.imgur.com/Nqv3mVd.png?1) Scala SBT\n\nAdd JitPack as a resolver.\n\n```\nresolvers += \"jitpack\" at \"https://jitpack.io\"\n```\n\nAdd VNameGenerator as a dependency.\n\n```\nlibraryDependencies += \"com.github.Valkryst\" % \"VNameGenerator\" % \"2024.03.25\"\n```\n\n## Algorithms\n\nThe _Combinatorial_, _Consonant Vowel_, and _Markov Chain_ algorithms will\ngenerate names with a length of `(maxLength * 0.5)` to `maxLength`. This was\ndone to improve the quality of the generated names.\n\nNames are guaranteed to begin with a capital character.\n\n### Combinatorial\n1. A beginning is chosen and added to the name.\n2. While the name is less than the maximum length, middles are chosen and added\n   to the name.\n3. An ending is chosen and added to the end of the name, overwriting existing\n   characters in order to fit within the maximum length.\n\n```java\npublic class Example {\n    public static void main(final String[] args) {\n        final var beginnings = new String[] { \"th\", \"bo\", \"ja\", \"fu\" };\n        final var middles = new String[] { \"la\", \"su\", \"dhu\", \"li\", \"da\", \"zk\", \"fr\"};\n        final var endings = new String[] { \"r\", \"t\", \"gh\", \"or\", \"al\", \"ar\", \"is\" };\n\n        final var generator = new CombinatorialGenerator(beginnings, middles, endings);\n\n        for (int i = 0 ; i \u003c 20 ; i++) {\n            System.out.println(generator.generate(10));\n        }\n    }\n}\n```\n```\nThlifrdhgh\nBolalar\nFusuladagh\nThlis\nThlagh\nThlilifis\nJadasugh\nFuzklr\nJadhular\nJadaal\nBosulaligh\nJafrgh\nJadar\nBodhugh\nBolazkr\nThlidadis\nFudhr\nThzklaar\nJazklidgh\nBozkr\n```\n\n### Consonant Vowel\n1. A consonant is chosen and added to the name.\n2. A vowel is chosen and added to the name.\n3. Repeat the previous steps until the name is equal to the maximum length.\n\n```java\npublic class Example {\n    public static void main(final String[] args) {\n        final var generator = new ConsonantVowelGenerator();\n\n        for (int i = 0 ; i \u003c 20 ; i++) {\n            System.out.println(generator.generate(10));\n        }\n    }\n}\n```\n```\nItleanas\nNetemete\nAuieie\nStvetoerit\nAtaseander\nOuitha\nAuyuyieyoe\nArhaea\nAauuiaui\nThatatea\nSeenesor\nItstisme\nTitire\nEouuyuoo\nLeteisha\nAyueea\nWaatanto\nEoyouo\nEeoyieuuui\nHaontiseal\n```\n\n### Context Free Grammar\nClick [here](http://www.tutorialspoint.com/automata_theory/context_free_grammar_introduction.htm)\nto learn more about CFGs and how they work.\n\nI do not recommend using this method as it is difficult to create a set of rules\nthat results in good quality names, and a large variety of names.\n\n```java\npublic class Example {\n    public static void main(final String[] args) {\n    \t/*\n    \t * This set of rules was created using the following set of names.\n    \t *\n    \t * Balin, Bifur, Bofur, Bombur, Borin, Dain, Dis, Dori, Dwalin, Farin,\n    \t * Fili,  Floi, Frar, Frerin, Fror, Fundin, Gaiml, Gimli, Gloin, Groin,\n    \t * Gror, Ibun, Khim, Kili, Loni, Mim, Nain, Nali, Nar, Narvi, Nori, Oin,\n    \t * Ori, Telchar, Thorin, Thrain, Thror\n    \t */\n        final List\u003cString\u003e rules = new ArrayList\u003c\u003e();\n        rules.add(\"S B D F G I K L M N O T\");\n        rules.add(\"A a aL aI aR\");\n        rules.add(\"B b bA bI bO\");\n        rules.add(\"C c\");\n        rules.add(\"D d dA dI dO dW dU\");\n        rules.add(\"E e eR eL\");\n        rules.add(\"F f fA fI fL fR fU fO\");\n        rules.add(\"G g gA gI gL gR\");\n        rules.add(\"H h hI hA\");\n        rules.add(\"I i\");\n        rules.add(\"K k kH kI\");\n        rules.add(\"L l lO\");\n        rules.add(\"M m mI\");\n        rules.add(\"N n nA nO\");\n        rules.add(\"O o oI oR\");\n        rules.add(\"P p\");\n        rules.add(\"Q q\");\n        rules.add(\"R r rI rO rV\");\n        rules.add(\"S s\");\n        rules.add(\"T t tE tH\");\n        rules.add(\"U u uR uN\");\n        rules.add(\"V v\");\n        rules.add(\"W w wA\");\n        rules.add(\"X x\");\n        rules.add(\"Y y\");\n        rules.add(\"Z z\");\n\n        final var generator = new GrammarGenerator(rules);\n\n        final int maxLength = 10;\n        String temp;\n        for (int i = 0 ; i \u003c 20 ; i++) {\n\t\t\tdo {\n\t\t\t\ttemp = generator.generate(10);\n\t\t\t} while (temp.length() \u003c (maxLength / 2));\n\t\t\t\n\t\t\tSystem.out.println(temp);\n        }\n    }\n}\n```\n```\nOrorv\nDwarv\nNaloro\nOroro\nGrori\nDaloi\nNarori\nNalorv\nNoroi\nTerororoi\nDunai\nFlori\nGlori\nThalo\nFunal\nBaloroi\nKhari\nOrorv\nThalor\nDwari\n```\n\n### Markov Chain\nClick [here](https://en.wikipedia.org/wiki/Markov_chain) to learn more about\nMarkov Chains and how they work.\n\nI recommend using this method with a large set of training names. Smaller sets\nwill result in the generation of many similar names, whereas larger sets will\nresult in more unique and varied names.\n\n```java\npublic class Example {\n\tpublic static void main(final String[] args) {\n\t\tfinal String[] trainingNames = new String[] {\n\t\t\t\"ailios\", \"ailisl\", \"aimil\", \"aingealag\", \"anabla\", \"anna\",\n\t\t\t\"aoife\", \"barabal\", \"baraball\", \"barabla\", \"bearnas\", \"beasag\",\n\t\t\t\"beathag\", \"beileag\", \"beitidh\", \"beitiris\", \"beitris\",\n\t\t\t\"bhioctoria\", \"brighde\", \"brìde\", \"cairistiòna\", \"cairistìne\",\n\t\t\t\"cairistìona\", \"caitir\", \"caitlin\", \"caitrìona\", \"calaminag\",\n\t\t\t\"catrìona\", \"ceana\", \"ceit\", \"ceiteag\", \"ceitidh\", \"ciorsdan\",\n\t\t\t\"ciorstag\", \"ciorstaidh\", \"ciorstan\", \"cotrìona\", \"criosaidh\",\n\t\t\t\"curstag\", \"curstaidh\", \"deirdre\", \"deòiridh\", \"deònaidh\",\n\t\t\t\"dior-bhorgàil\", \"diorbhail\", \"doileag\", \"doilidh\", \"doirin\",\n\t\t\t\"dolag\", \"ealasaid\", \"eamhair\", \"eilidh\", \"eimhir\", \"eiric\",\n\t\t\t\"eithrig\", \"eubh\", \"eubha\", \"èibhlin\", \"fionnaghal\", \"fionnuala\",\n\t\t\t\"floireans\", \"flòraidh\", \"frangag\", \"giorsail\", \"giorsal\",\n\t\t\t\"gormall\", \"gormlaith\", \"isbeil\", \"iseabail\", \"iseabal\",\n\t\t\t\"leagsaidh\", \"leitis\", \"lili\", \"liùsaidh\", \"lucrais\", \"lìosa\",\n\t\t\t\"magaidh\", \"maighread\", \"mairead\", \"mairearad\", \"malamhìn\",\n\t\t\t\"malmhìn\", \"marsail\", \"marsaili\", \"marta\", \"milread\", \"moibeal\",\n\t\t\t\"moire\", \"moireach\", \"muire\", \"muireall\", \"màili\", \"màiri\",\n\t\t\t\"mòr\", \"mòrag\", \"nansaidh\", \"oighrig\", \"olibhia\", \"peanaidh\",\n\t\t\t\"peigi\", \"raghnaid\", \"raodhailt\", \"raonaid\", \"raonaild\", \"rut\",\n\t\t\t\"seasaìdh\", \"seonag\", \"seònaid\", \"simeag\", \"siubhan\", \"siùsaidh\",\n\t\t\t\"siùsan\", \"sorcha\", \"stineag\", \"sìle\", \"sìleas\", \"sìlis\", \"sìne\",\n\t\t\t\"sìneag\", \"sìonag\", \"teasag\", \"teàrlag\", \"ùna\", \"una\"\n\t\t};\n\n\t\tfinal MarkovGenerator generator = new MarkovGenerator(trainingNames);\n\n\t\tfor (int i = 0 ; i \u003c 20 ; i++) {\n\t\t\tSystem.out.println(generator.generate(10));\n\t\t}\n\t}\n}\n```\n```\nSorsag\nIria\nUnabarst\nNualasana\nTirdreal\nCraoilisl\nNearaidha\nLrealairea\nNuala\nAlmhalamh\nReabarnaig\nIreag\nGeabl\nAbara\nUnaba\nIghang\nBeitrìd\nCiorcha\nCaimeabal\nMhailil\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalkryst%2Fvnamegenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalkryst%2Fvnamegenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalkryst%2Fvnamegenerator/lists"}