{"id":21643585,"url":"https://github.com/tallpauley/wordsiv","last_synced_at":"2025-04-11T18:21:14.676Z","repository":{"id":51157925,"uuid":"357676771","full_name":"tallpauley/wordsiv","owner":"tallpauley","description":"A Python library for generating text with a limited character set, with type proofing in mind","archived":false,"fork":false,"pushed_at":"2025-02-09T21:07:17.000Z","size":2372,"stargazers_count":25,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T14:12:32.681Z","etag":null,"topics":["fonts","nlp","proofing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tallpauley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2021-04-13T20:12:55.000Z","updated_at":"2025-03-05T09:59:45.000Z","dependencies_parsed_at":"2024-12-29T17:24:05.700Z","dependency_job_id":"0b36b55c-ce8f-4d6f-a0c5-311419a58c92","html_url":"https://github.com/tallpauley/wordsiv","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallpauley%2Fwordsiv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallpauley%2Fwordsiv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallpauley%2Fwordsiv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallpauley%2Fwordsiv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tallpauley","download_url":"https://codeload.github.com/tallpauley/wordsiv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248456385,"owners_count":21106606,"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":["fonts","nlp","proofing"],"created_at":"2024-11-25T05:35:05.378Z","updated_at":"2025-04-11T18:21:14.659Z","avatar_url":"https://github.com/tallpauley.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://wordsiv.com\"\u003e\u003cimg src=\"docs/images/wordsiv-logo.png\" alt=\"WordSiv\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003eWordSiv is a Python library for generating proofing text for an incomplete\ntypeface.\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/tallpauley/wordsiv/actions/workflows/ci.yml?query=branch%3Amain\"\u003e\n    \u003cimg src=\"https://github.com/tallpauley/wordsiv/actions/workflows/ci.yml/badge.svg?branch=main\" alt=\"CI\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n**Documentation**: [https://wordsiv.com](https://wordsiv.com)\n\n**Source Code**: [https://github.com/tallpauley/wordsiv](https://github.com/tallpauley/wordsiv)\n\n---\n\nSay you've drawn `HAMBUGERFONTSIVhambugerfontsiv.,` and want a sentence with\n*only* those glyphs:\n\n```python\nfrom wordsiv import WordSiv\n\nwsv = WordSiv(vocab=\"en\", glyphs=\"HAMBUGERFONTSIVhambugerfontsiv.,\")\nprint(wsv.sent(rnd=0.03))  # rnd lets us turn up the randomness\n```\n\nThis returns something like:\n\n\u003eBears run saint that fighting bargain remove, genre MA Barbara registration the\n\u003ebug it others entering Steven.\n\n## Key Features\n\n- **Shaped Text**: WordSiv generates text that is roughly the *shape* of text in\n  the desired language using word/punctuation probabilities and capitalization.\n- **Easy Word Filtering**: WordSiv selects from words that can be spelled with\n  your current glyph set, so you don't have to worry about `.notdef`. Add\n  additional word requirements (substrings, patterns, word length, etc.) on top\n  without having to wrangle regex.\n- **Letter Case Aware**: WordSiv has a simple `case` argument to set the desired\n  case of words, and choose whether to transform letter case of the words in the\n  Vocab. Words like `\"I\", \"Paris\", \"DDoS\", \"WWF\"` will by appear in their\n  original letter case by default (if the Vocab has capitalization).\n\n# Installation\n\n### Installing in DrawBot\n\n1. In the DrawBot menu, click **Python-\u003eInstall Python Packages**:\n\n2. Enter ```git+https://github.com/tallpauley/wordsiv``` and click **Go!**\n\n![Screenshot of DrawBot \"Install Python Packages\"\nWindow](docs/images/drawbot-install.jpg)\n\n#### Updating WordSiv in DrawBot\n\nDrawBot caches Python packages/modules, so I'd recommend this process for\nupdating to the latest version of WordSiv:\n\n1. In the DrawBot menu, click **Python-\u003eInstall Python Packages**.\n    - Click the dropdown **Install / Upgrade** and select **Uninstall**.\n    - Enter `wordsiv` and click **Go!**.\n4. Restart DrawBot.\n5. Follow the [above instructions](#installing-in-drawbot) to install the latest\n   version of WordSiv.\n\n\n### Installing Outside of DrawBot\n\nYou can also install WordSiv on your system and use it in any Python script.\nYou'll probably want to use a [virtual environment][venv] or a\n[Python tool][tool] that manages these for you, but I'll leave that up to you!\n\nFirst, make sure you have Python 3.9+. Then:\n\n```bash\npip install git+https://github.com/tallpauley/wordsiv\n```\n\n## Why Simple Word Probability?\n\nProofing text doesn't necessarily have to be syntactically correct or have\nmeaning. It just needs the right amount of common and uncommon words to give it\na \"realistic\" *shape*. Often, type designers do this manually, such as in\nJonathan Hoefler's fantastic [proof][proof]:\n\u003eFinally, I wanted the text to have the visual cadences of my native English, in\n\u003ewhich words of variable but digestible length are punctuated by shorter ones.\n\nIf we simply select words randomly, out of a hat which contains many more\nduplicates of, say, \"the\" than \"etymology\", we'll get a string of words which\nvisually resembles a sentence. This is how WordSiv works: sampling words from a\n*probability distribution* which is determined by the occurrence counts of words\nin a corpus of text.\n\nOf course, the more we restrict our glyph set, the more we've tampered with the\nnatural distribution of words, since most of the longer, less-common words\naren't available (which make up the long tail of the [Zipf Distribution][zipf]).\nHowever, we can blend in a bit of randomness to make it look like real text at a\nglance!\n\nThis might be *more fun* [with LLMs](#other-resources), because the\nglyph-limited text could potentially be both grammatically and semantically\ncorrect. However, it remains to be seen if stability can be achieved while\nfiltering out the majority of tokens. And more importantly, why spend so much\nmore compute for so little payoff?\n\n## Related Resources\n\n### Software Tools Comparison\n\n| Revocab | Type | Author | Glyphs Filtering | Algorithm | Probability |\n| -- | -- | -- | -- | -- | -- |\n| [WordSiv](#) | CLI | Chris Pauley | Yes | word probability (for now) | Yes |\n| [Galvanized Jets][galvanized] | web tool | Samarskaya \u0026 Partners | No | static text | N/A |\n| [Adhesion Text][adhesion] | web tool | Miguel Sousa | Yes | random word |  No |\n| [Word-o-mat][wordomat] | Plugin | Nina Stössinger | No | random word | No\n| [Test Text Generator][justanother] | web tool, [CLI][justanothercli] | Tim Ahrens | Yes | trigram character prediction | Yes |\n\n### Other Resources\n\n| Revocab | Author | Notes |\n| -- | -- | -- |\n| [Proof a Typeface][proof] | Jonathan Hoefler | A concise and comprehensive proof of illustrative English words, covering all round/flat spacing trigrams, including bigrams for sentence start/end and 4-grams for repeated letters. Made to look more text-like with joining phrases like \"of the\".\n| [LLM Lipogram Guide][lipogram] | Corey Hanson | A really cool example of using LLMs for lipograms.\n| [AI Writing Assistant][poets] | Allen Roush, Sanjay Basu, Akshay Moorthy, Dmitry Dubovoy | Another example of filtering the output of an LLM for lipogram generation and more.\n\n[venv]: https://docs.python.org/3/library/venv.html\n[tool]: https://www.reddit.com/r/Python/comments/16qz8mx/pipenv_piptools_pdm_or_poetry/\n[proof]: https://jonathanhoefler.com/articles/how-to-proof-a-typeface\n[zipf]: https://en.wikipedia.org/wiki/Zipf's_law#Word_frequencies_in_natural_languages\n[galvanized]: https://www.galvanizedjets.com/\n[adhesion]: https://adhesiontext.com/\n[wordomat]: https://github.com/ninastoessinger/word-o-mat\n[justanother]: https://justanotherfoundry.com/generator\n[justanothercli]: https://github.com/justanotherfoundry/text-generator/tree/master\n[lipogram]: https://coreyhanson.com/blog/a-simple-way-to-program-an-llm-lipogram/\n[poets]: https://arxiv.org/abs/2306.15926\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftallpauley%2Fwordsiv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftallpauley%2Fwordsiv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftallpauley%2Fwordsiv/lists"}