{"id":24388197,"url":"https://github.com/lfmramos/tool-coh-piah","last_synced_at":"2025-07-26T06:02:49.783Z","repository":{"id":261971789,"uuid":"885868395","full_name":"lfmramos/tool-coh-piah","owner":"lfmramos","description":"The COH-PIAH Detector is a Python program that analyses linguistic patterns to identify similarities between texts.","archived":false,"fork":false,"pushed_at":"2024-11-09T15:55:56.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T21:24:46.342Z","etag":null,"topics":["python","regular-expression"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lfmramos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-11-09T15:54:23.000Z","updated_at":"2024-11-13T09:14:35.000Z","dependencies_parsed_at":"2024-11-09T16:50:44.179Z","dependency_job_id":null,"html_url":"https://github.com/lfmramos/tool-coh-piah","commit_stats":null,"previous_names":["lfmramos/tool-coh-piah"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lfmramos/tool-coh-piah","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfmramos%2Ftool-coh-piah","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfmramos%2Ftool-coh-piah/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfmramos%2Ftool-coh-piah/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfmramos%2Ftool-coh-piah/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lfmramos","download_url":"https://codeload.github.com/lfmramos/tool-coh-piah/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfmramos%2Ftool-coh-piah/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267127185,"owners_count":24039989,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"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":["python","regular-expression"],"created_at":"2025-01-19T13:56:38.613Z","updated_at":"2025-07-26T06:02:49.685Z","avatar_url":"https://github.com/lfmramos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# COH-PIAH Detector\n\n## Overview\nThe COH-PIAH Detector is a Python program that analyzes text samples to identify potential cases of COH-PIAH infection based on linguistic patterns. It uses various text metrics to compare writing styles and determine similarities between texts.\n\n## Features\nThe program analyzes texts using six main linguistic traits:\n- Average word length\n- Type-Token ratio (lexical diversity)\n- Hapax Legomana ratio (proportion of words used only once)\n- Average sentence length\n- Sentence complexity\n- Average phrase length\n\n## How it Works\n1. The program first collects a baseline signature of linguistic traits from a known infected text\n2. Users can then submit multiple texts for analysis\n3. Each text is broken down into its linguistic components (sentences, phrases, words)\n4. The program calculates a similarity score between each submitted text and the baseline\n5. The text with the closest match to the infected signature is identified as potentially infected\n\n## Functions\n\n### Main Components:\n- `le_assinatura()`: Collects the baseline linguistic signature\n- `le_textos()`: Reads multiple texts for comparison\n- `calcula_assinatura()`: Calculates the linguistic signature of a given text\n- `compara_assinatura()`: Compares two linguistic signatures\n- `avalia_textos()`: Evaluates multiple texts and identifies the most likely infected one\n\n### Text Processing Functions:\n- `separa_sentencas()`: Splits text into sentences\n- `separa_frases()`: Splits sentences into phrases\n- `separa_palavras()`: Splits phrases into words\n- `n_palavras_unicas()`: Counts words that appear only once\n- `n_palavras_diferentes()`: Counts unique words\n\n## Usage\n1. Run the program\n2. Enter the baseline linguistic traits when prompted\n3. Input the texts you want to analyze\n4. The program will output which text is most likely infected with COH-PIAH\n\nExample:\n```python\npython coh_piah_detector.py\n```\n\n## Requirements\n- Python 3.x\n- re (Regular Expression) module\n\n## Technical Details\nThe program uses regular expressions for text processing and implements various linguistic analysis algorithms. It calculates similarity scores using the average absolute difference between linguistic traits.\n\n## Notes\n- All text analysis is case-insensitive\n- The program handles various punctuation marks (., !, ?, :, ;, ,) for sentence and phrase separation\n- Empty strings and trailing spaces are properly handled\n\n## Contributing\nFeel free to submit issues and enhancement requests. The main area marked with comments (\"Não mexer daqui para cima\") should not be modified as it contains core functionality.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flfmramos%2Ftool-coh-piah","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flfmramos%2Ftool-coh-piah","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flfmramos%2Ftool-coh-piah/lists"}