{"id":26535022,"url":"https://github.com/mikayelgr/mca","last_synced_at":"2025-03-21T20:30:27.853Z","repository":{"id":144532670,"uuid":"447603953","full_name":"mikayelgr/mca","owner":"mikayelgr","description":"A memoization-based protein compression algorithm, written in Rust.","archived":false,"fork":false,"pushed_at":"2022-01-16T18:11:33.000Z","size":4,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T23:35:00.303Z","etag":null,"topics":["compression","memoziation","rust","zip"],"latest_commit_sha":null,"homepage":"https://github.com/michaelgrigoryan25/mca","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikayelgr.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":"2022-01-13T13:11:01.000Z","updated_at":"2023-03-06T10:52:52.000Z","dependencies_parsed_at":"2023-04-27T19:31:57.213Z","dependency_job_id":null,"html_url":"https://github.com/mikayelgr/mca","commit_stats":null,"previous_names":["mikayelgr/mca"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikayelgr%2Fmca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikayelgr%2Fmca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikayelgr%2Fmca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikayelgr%2Fmca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikayelgr","download_url":"https://codeload.github.com/mikayelgr/mca/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244864959,"owners_count":20523263,"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":["compression","memoziation","rust","zip"],"created_at":"2025-03-21T20:30:25.319Z","updated_at":"2025-03-21T20:30:27.835Z","avatar_url":"https://github.com/mikayelgr.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mca\n\nThis repository contains a compression algorithm written by\nme ([Michael Grigoryan](https://github.com/michaelgrigoryan25/)).\nThe algorithm is only able to compress and decompress text files\nand is not guaranteed to work with other file types.\n\nThe algorithm works best with repetitive texts.\n\n## Explanation with an example\n\nSuppose you have this repetitive text:\n\n```txt\nNory was a Catholic because her mother was a Catholic,\nand Nory’s mother was a Catholic because her father\nwas a Catholic, and her father was a Catholic because\nhis mother was a Catholic, or had been.\n```\n\n\u003e Taken from https://thejohnfox.com/2021/08/17-fantastic-repetition-examples-in-literature/\n\nAs you can see the text is very repetitive. The compression\nalgorithm will loop through all the lines and the words in\nthem.\n\nIf a word is not present in the shared index and is used multiple\ntimes throughout the text body, the algorithm will append that word\nto the shared index. If the word is only used once, then it is added\ndirectly to the compressed file, without being added to the shared index.\n\nAfter the compression the file will produce a `compressed.mca`\nfile which will have the following content:\n\n```txt\n[\"Nory\",\"was\",\"a\",\"Catholic\",\"because\",\"her\",\"mother\",\"Catholic,\",\"and\",\"father\",\"or\"]\n0 1 2 3 4 5 6 1 2 7\n8 Nory’s 6 1 2 3 4 5 9\n1 2 7 8 5 9 1 2 3 4\nhis 6 1 2 7 10 had been.\n```\n\nThe first line of the output contains the shared index. If you attempt\nto decompress a file without this \"header\" the program will throw a\ncorruption error.\n\n### Usage\n\nYou can start the program by running:\n\n```bash\ncargo run --release\n```\n\nafter which you should get a prompt, asking\nyou to choose an action:\n\n```txt\nselect an option: (c)ompress/(d)ecompress:\n```\n\nBoth, compression and decompression are supported. Compressing a\nfile will create a file named `compressed.mca` and decompression\nwill output a file named `decompressed.txt`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikayelgr%2Fmca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikayelgr%2Fmca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikayelgr%2Fmca/lists"}