{"id":34668345,"url":"https://github.com/pre63/super-maximal-repeats","last_synced_at":"2026-05-28T05:31:35.126Z","repository":{"id":324593034,"uuid":"1097715442","full_name":"pre63/super-maximal-repeats","owner":"pre63","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-16T19:14:18.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-16T21:10:20.720Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pre63.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-16T17:42:26.000Z","updated_at":"2025-11-16T19:14:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pre63/super-maximal-repeats","commit_stats":null,"previous_names":["pre63/super-maximal-repeats"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/pre63/super-maximal-repeats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pre63%2Fsuper-maximal-repeats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pre63%2Fsuper-maximal-repeats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pre63%2Fsuper-maximal-repeats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pre63%2Fsuper-maximal-repeats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pre63","download_url":"https://codeload.github.com/pre63/super-maximal-repeats/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pre63%2Fsuper-maximal-repeats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33596316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-12-24T19:42:53.700Z","updated_at":"2026-05-28T05:31:35.114Z","avatar_url":"https://github.com/pre63.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Super Maximal Repeats\n\nA Python library for computing super-maximal repeats in a string or collection of documents, implemented with C++ under the hood using pybind11. Based on the enhanced suffix array algorithm for linear-time computation (in practice, O(n log² n) due to sorting in the suffix array construction).\n\nSuper-maximal repeats are maximal repeats that are not substrings of any longer maximal repeat. This is useful for tasks like detecting machine-generated text, as described in the [paper \"Unsupervised and Distributional Detection of Machine-Generated Text\" by Mathias Gallé et al](https://arxiv.org/abs/2111.02878).\n\n## Installation\n```\nmake install\n```\n\n## Usage\n\n```python\nimport smr\n\n# Compute super-maximal repeats for a single string (character-level by default)\nrepeats = smr.find_supermaximal_repeats(\"your_example_string_here\", min_len=20, min_occ=3)\n\n# Each repeat is a Repeat object with 'doc_idx' (always 0 for single string), 'start' (starting position), 'len' (length), and 'text' (the repeat substring)\nfor r in repeats:\n    print(f\"Repeat: {r.text} (doc_idx: {r.doc_idx}, start: {r.start}, len: {r.len})\")\n\n# Compute super-maximal repeats across multiple documents\ndocs = [\"your_first_document_here\", \"your_second_document_here\"]\nrepeats_docs = smr.find_supermaximal_repeats_docs(docs, min_len=20, min_occ=3, mode=\"char\")\n\nfor r in repeats_docs:\n    print(f\"Repeat: {r.text} (doc_idx: {r.doc_idx}, start: {r.start}, len: {r.len})\")\n```\n\n- `min_len`: Minimum length of repeats (default: 1).\n- `min_occ`: Minimum number of occurrences (default: 2).\n- `mode` (for documents only): \"char\" for character-level repeats (default), or \"word\" for word-level repeats (splits on whitespace, positions and lengths are in terms of words, text is space-joined).\n\n## Notes\n\n- For large strings (n \u003e 10^6), performance may degrade due to the O(n log² n) suffix array construction, but it is efficient for typical text sizes.\n- Outputs a list of `Repeat` objects, each representing a unique super-maximal repeat with one example occurrence (document index, starting position, length, and text).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpre63%2Fsuper-maximal-repeats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpre63%2Fsuper-maximal-repeats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpre63%2Fsuper-maximal-repeats/lists"}