{"id":13657455,"url":"https://github.com/rm-hull/ars-magna","last_synced_at":"2025-04-23T16:43:49.620Z","repository":{"id":145430895,"uuid":"54310910","full_name":"rm-hull/ars-magna","owner":"rm-hull","description":"A multi-word anagram solver, based on the article \"Anagrams and Pangrams\" from The Armchair Universe","archived":false,"fork":false,"pushed_at":"2023-11-18T14:34:24.000Z","size":322,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-03T12:17:30.321Z","etag":null,"topics":["anagram-solver","anagrams","clojure"],"latest_commit_sha":null,"homepage":"https://ars-magna-seicozkdxq.now.sh/multi-word/compute","language":"Clojure","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/rm-hull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2016-03-20T10:02:32.000Z","updated_at":"2024-04-28T12:21:29.000Z","dependencies_parsed_at":"2023-11-18T15:42:06.636Z","dependency_job_id":null,"html_url":"https://github.com/rm-hull/ars-magna","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fars-magna","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fars-magna/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fars-magna/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fars-magna/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rm-hull","download_url":"https://codeload.github.com/rm-hull/ars-magna/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250472223,"owners_count":21436101,"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":["anagram-solver","anagrams","clojure"],"created_at":"2024-08-02T05:00:43.191Z","updated_at":"2025-04-23T16:43:49.597Z","avatar_url":"https://github.com/rm-hull.png","language":"Clojure","funding_links":[],"categories":["Clojure"],"sub_categories":[],"readme":"# ![logo](https://raw.githubusercontent.com/rm-hull/ars-magna/master/logo.jpg) Ars Magna (Anagram Solver)\n\n[![Coverage Status](https://coveralls.io/repos/rm-hull/ars-magna/badge.svg?branch=master)](https://coveralls.io/r/rm-hull/ars-magna?branch=master)\n[![Dependencies Status](https://versions.deps.co/rm-hull/ars-magna/status.svg)](https://versions.deps.co/rm-hull/ars-magna)\n[![Maintenance](https://img.shields.io/maintenance/yes/2023.svg?maxAge=2592000)]()\n\nA multi-word anagram solver in Clojure, based on the article\n**\"Anagrams and Pangrams\"** from _The Armchair Universe_, by A.K. Dewdney.\n\n## Pre-requisites\n\nYou will need [Leiningen](https://github.com/technomancy/leiningen) 2.8.1 or above installed.\n\n## Building\n\nTo build and start the service locally, run:\n\n    $ cd ars-magna\n    $ lein deps\n    $ lein test\n    $ lein ring server-headless\n\nTo build and run a standalone jar:\n\n    $ lein ring uberjar\n    $ java -jar target/ars-magna-0.2.1-standalone.jar\n\nIn both instances, the webapp starts on http://localhost:3000. See the curl\nexamples below for usage.\n\n### Docker image\n\nA docker image is available as [richardhull/ars-magna](https://github.com/rm-hull/ars-magna/pkgs/container/ars-magna),\nand can be downloaded and started with:\n\n    $ docker pull ghcr.io/rm-hull/ars-magna:main\n    $ docker run --name ars-magna -d -p 3000:3000 ghcr.io/rm-hull/ars-magna:main\n\n## Example API usage\n\n### Multi-word anagrams\n\nUsing all the letters to find multi-word anagrams, from a Clojure REPL:\n\n```clojure\n(use 'ars-magna.dict)\n(use 'ars-magna.solver)\n\n(let [dict (load-word-list :en-GB)\n      index (partition-by-word-length dict)]\n  (sort\n    (multi-word index \"compute\" 3)))\n; (\"come put\" \"compute\" \"cote ump\" \"cut mope\" \"cut poem\"\n;  \"cute mop\" \"met coup\" \"mote cup\" \"mute cop\" \"tome cup\")\n```\n\nor querying the web service for the word 'compute':\n\n    $ curl -s http://localhost:3000/multi-word/compute | jq .\n\nreturns the same anagrams:\n\n```json\n[\n  \"come put\",\n  \"compute\",\n  \"cote ump\",\n  \"cut mope\",\n  \"cut poem\",\n  \"cute mop\",\n  \"met coup\",\n  \"mote cup\",\n  \"mute cop\",\n  \"tome cup\"\n]\n```\n\n### Longest word anagrams\n\nFind the longest single words from the given word, without necessarily using\nall the letters - at the REPL:\n\n```clojure\n(use 'ars-magna.dict)\n(use 'ars-magna.solver)\n\n(let [dict (load-word-list :en-GB)\n      index (partition-by-letters dict)]\n  (sort-by\n    (juxt (comp - count) identity)\n      (longest index \"compute\" 4)))\n; (\"compute\" \"comet\" \"coupe\" \"tempo\" \"come\"\n;  \"cope\" \"cote\" \"coup\" \"cute\" \"mope\" \"mote\"\n;  \"mute\" \"poem\" \"poet\" \"pout\" \"temp\" \"tome\")\n```\n\n_(the `(sort-by (juxt (comp - count) identity) ...)` returns the words\nsorted by longest first, then alphabetically)_\n\nor querying the web service for the word 'compute':\n\n    $ curl -s http://localhost:3000/longest/compute | jq .\n\nreturns the same anagrams:\n\n```json\n[\n  \"compute\",\n  \"comet\",\n  \"coupe\",\n  \"tempo\",\n  \"come\",\n  \"cope\",\n  \"cote\",\n  \"coup\",\n  \"cute\",\n  \"mope\",\n  \"mote\",\n  \"mute\",\n  \"poem\",\n  \"poet\",\n  \"pout\",\n  \"temp\",\n  \"tome\"\n]\n```\n\n### Wildcards\n\nFind the single words from the given wildcard (use `?` or `.` for a single\ncharacter or `*` for a sequence) - at the REPL:\n\n```clojure\n(use 'ars-magna.dict)\n(use 'ars-magna.solver)\n\n(-\u003e\n  (load-word-list :en-GB)\n  (wildcard \"c..p..e\")\n  sort)\n; (\"compare\" \"compete\" \"compile\"\n;  \"compose\" \"compote\" \"compute\"\n;  \"coppice\" \"cowpoke\" \"cripple\"\n```\n\nor querying the web service for the word 'compute':\n\n    $ curl -s http://localhost:3000/wildcard/c..p..e | jq .\n\nreturns the same words:\n\n```json\n[\n  \"compare\",\n  \"compete\",\n  \"compile\",\n  \"compose\",\n  \"compote\",\n  \"compute\",\n  \"coppice\",\n  \"cowpoke\",\n  \"cripple\"\n]\n```\n\n## References\n\n- https://en.wikipedia.org/wiki/Letter_frequency#Relative_frequencies_of_letters_in_the_English_language\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Richard Hull\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frm-hull%2Fars-magna","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frm-hull%2Fars-magna","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frm-hull%2Fars-magna/lists"}