{"id":17679356,"url":"https://github.com/tmck-code/punsy","last_synced_at":"2025-03-30T18:28:13.458Z","repository":{"id":57455560,"uuid":"192454452","full_name":"tmck-code/punsy","owner":"tmck-code","description":"A rhyming pun generator for Python","archived":false,"fork":false,"pushed_at":"2020-04-04T13:05:09.000Z","size":927,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-10T07:47:11.842Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tmck-code.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}},"created_at":"2019-06-18T02:56:36.000Z","updated_at":"2020-04-04T13:05:00.000Z","dependencies_parsed_at":"2022-09-05T19:21:38.268Z","dependency_job_id":null,"html_url":"https://github.com/tmck-code/punsy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmck-code%2Fpunsy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmck-code%2Fpunsy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmck-code%2Fpunsy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmck-code%2Fpunsy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmck-code","download_url":"https://codeload.github.com/tmck-code/punsy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246361332,"owners_count":20764908,"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":[],"created_at":"2024-10-24T08:22:11.205Z","updated_at":"2025-03-30T18:28:13.429Z","avatar_url":"https://github.com/tmck-code.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# punsy\n\nA rhyming pun generator for Python\n\n## Initial POC\n\n\u003e The POC takes in a sentence, picks out the last word, finds a random rhyming match and inserts it in place.\n\u003e E.g. `\"Napoleon Dynamite\" -\u003e \"Napoleon VEGEMITE\"`\n\nTo install, run:\n```\npip install punsy\n```\n\nYou can then run punsy with:\n```\npunsy --sentence 'napoleon dynamite'\n```\n\nAn example run:\n\n```\n 20:10:22 │ ☯ ~ punsy --sentence 'napoleon dynamite'\n2019-08-09 00:55:24,851 punsy.punsy INFO Parsing \u0026 loading 125699 entries from CMU dictionary file\n125700it [00:02, 58591.59it/s]\n2019-08-09 00:55:27,005 punsy.punsy INFO Pronunciation of \"DYNAMITE\" is \"D-AY1-N-AH0-M-AY2-T\"\n2019-08-09 00:55:27,005 punsy.punsy INFO Fetching rhymes, applying offset=2: \"N-AH0-M-AY2-T\"\n2019-08-09 00:55:27,005 punsy.punsy INFO Rhymes for DYNAMITE: ['DYNAMITE']\n2019-08-09 00:55:27,005 punsy.punsy INFO Generated pun for napoleon dynamite: napoleon DYNAMITE (DYNAMITE -\u003e DYNAMITE)\n2019-08-09 00:55:27,181 punsy.punsy INFO napoleon DYNAMITE\n```\n\n### Docker\n\nYou build the docker image and run the POC with\n\n```bash\nmake poc\n```\n\n#### Running interactively\n\n* Enter the docker container with\n\n```bash\nmake build shell\n```\n\nOption 1: \n\nYou can use the `punsy/cmu.py` command with the following format:\n\n```text\n./punsy/cmu.py \u003ccmu_file_path\u003e \u003csentence\u003e \u003coffset\u003e\n```\n\nOption 2: ipython\n\nThen, launch the `ipython` command and use as follows (output omitted):\n\n```python\nIn [1]: from punsy import cmu\nIn [2]: poc = cmu.POC()\nIn [3]: poc.run('NAPOLEON DYNAMITE', offset=2)\n```\n\n### The Suffix trie\n\nYou can experiment with the suffix trie by running it directly with\n\n```bash\n./punsy/structs/suffix_trie.py\n```\n\nOR, the regular trie with\n\n```bash\n./punsy/structs/trie.py\n```\n\n### Hall of Fame\n\nAs time passes, this will hopefully fill with some legitimately funny examples! Until then, we have these :)\n\n| command | output |\n|---------|--------|\n| 'Adventure Time' | \"Adventure PART-TIME\" |\n| 'A Good Day To Die Hard' | \"A Good Day To Die AVANT-GARDE\" |\n| 'The Rolling Stones' | \"The Rolling CLONES\" |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmck-code%2Fpunsy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmck-code%2Fpunsy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmck-code%2Fpunsy/lists"}