{"id":37231641,"url":"https://github.com/pszemraj/rehuman","last_synced_at":"2026-01-15T03:45:09.606Z","repository":{"id":332339249,"uuid":"1083445423","full_name":"pszemraj/rehuman","owner":"pszemraj","description":"Unicode-safe text cleaning \u0026 typographic normalization for Rust","archived":false,"fork":false,"pushed_at":"2025-10-27T12:30:17.000Z","size":80,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-13T14:58:08.417Z","etag":null,"topics":["no-emoji-in-code","rust-crate","text-normalization","text-processing","unicode"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/rehuman","language":"Rust","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/pszemraj.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-10-26T03:03:39.000Z","updated_at":"2025-10-27T13:17:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pszemraj/rehuman","commit_stats":null,"previous_names":["pszemraj/rehuman"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pszemraj/rehuman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pszemraj%2Frehuman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pszemraj%2Frehuman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pszemraj%2Frehuman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pszemraj%2Frehuman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pszemraj","download_url":"https://codeload.github.com/pszemraj/rehuman/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pszemraj%2Frehuman/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28416120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["no-emoji-in-code","rust-crate","text-normalization","text-processing","unicode"],"created_at":"2026-01-15T03:45:09.064Z","updated_at":"2026-01-15T03:45:09.573Z","avatar_url":"https://github.com/pszemraj.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rehuman\n\nUnicode-safe text cleaning \u0026 normalization for Rust.\n\nStrip invisible characters, normalize typography, and enforce consistent formatting-ideal for text sourced from web scraping, user input, or [LLMs](https://archive.fo/PrRYl).\n\n\u003e This crate is a Rust rewrite and expansion of [humanize-ai-lib](https://github.com/Nordth/humanize-ai-lib) by [Nordth](https://github.com/Nordth).\n\n## Why rehuman?\n\nUntrusted text often contains:\n\n- Zero-width spaces and control characters that break parsers\n- Mixed quote styles that defeat string matching\n- Non-breaking spaces that masquerade as regular spaces\n- Inconsistent Unicode normalization that produces duplicate keys\n\n**rehuman fixes this** in a single pass with predictable, measurable output.\n\n## Installation\n\n**Library crate**: add `rehuman` to your project with `cargo add rehuman` or edit `Cargo.toml`:\n\n```toml\n[dependencies]\nrehuman = \"0.1.0\" # replace with the latest published version\n```\n\n**CLI binaries**: install the published release (installs both `rehuman` and `ishuman`):\n\n```bash\ncargo install rehuman\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eClick to Expand:\u003c/b\u003e Build from Source\u003c/summary\u003e\n\nFor the latest version(s), clone this repo and run `cargo install --path .`:\n\n```bash\ngit clone https://github.com/pszemraj/rehuman.git\ncd rehuman\ncargo install --path .\n```\n\nBinaries will be installed to `~/.cargo/bin` by default.[^1]\n\n[^1]: You may need to add `~/.cargo/bin` to your `PATH` if it is not already there; add `export PATH=\"$HOME/.cargo/bin:$PATH\"` to your shell profile (`.bashrc`, `.zshrc`, etc.).\n\n\u003c/details\u003e\n\n## Quick Start\n\n\u003e [!WARNING]\n\u003e This is an **early release** focused on correctness. Performance optimizations are in progress. Use `--stream` or `StreamCleaner` to stream large files.\n\n### Library\n\n```rust\nuse rehuman::{clean, humanize};\n\nlet cleaned = clean(\"Hello\\u{200B}there\"); // -\u003e \"Hello there\"\nlet humanized = humanize(\"“Quote”—and…more\"); // -\u003e \"\\\"Quote\\\"-and...more\"\n```\n\n\u003e [!IMPORTANT]\n\u003e By default `rehuman::clean` removes emoji to guarantee ASCII-only output[^2].\n\n[^2]: This is a deliberate design choice given the propensity of today's LLMs to spam emoji in their outputs.\n\n```rust\nuse rehuman::clean;\n\n// Default behavior removes emoji\nlet cleaned = clean(\"Thanks 👍\"); // -\u003e \"Thanks \"\n```\n\nTo keep emoji, construct a cleaner with `CleaningOptions::builder().keyboard_only(false)` (or pass `--keep-emoji` on the CLI).\n\n### CLI\n\n`rehuman` reads the input and emits cleaned text to STDOUT-your source file stays untouched unless you pass `--inplace`:\n\n```bash\n# Stream-clean to STDOUT and capture stats\nrehuman notes.txt --stream --stats \u003e notes.cleaned.txt\n\n# Overwrite the original file in place\nrehuman notes.txt --inplace\n```\n\n\u003e [!TIP]\n\u003e Both CLI tools act as filters, so you can drop them into pipelines\n\n```bash\ncat notes.txt | rehuman --stream | tee notes.cleaned.txt\ncurl https://example.com/raw.txt | rehuman --stream --stats-json \u003e/tmp/clean.txt\n```\n\nUse `ishuman` when you only need detection:\n\n```bash\n# Exit status 0 when clean, 1 when changes would be made (no stdout by default)\nishuman notes.txt\n\n# Add --stats or --json to explain what would change\nishuman notes.txt --stats\n```\n\nRun `rehuman --help` or `ishuman --help` for the full list of flags (_emoji policy, line endings, configs, streaming, etc._).\n\n## Documentation\n\nMore details are available in the [`docs/`](docs/) folder:\n\n- [API Reference](docs/api.md) - all functions, options, and statistics\n- [CLI Guide](docs/cli.md) - usage of `rehuman` and `ishuman`\n- [Examples](docs/examples.md) - recipes for common workloads\n- [Development Notes](docs/development.md) - roadmap \u0026 implementation details\n\n## Detailed Features\n\n- **Invisible character removal**: ZWSP, BOM, bidi isolates, control characters\n- **Space normalization**: NBSP, figure space, ideographic space → ASCII space\n- **Typography fixes**: curly quotes → ASCII, em/en dash → hyphen, ellipsis → three dots\n- **Unicode normalization**: NFC/NFD/NFKC/NFKD (`unorm` feature, enabled by default)\n- **Whitespace controls**: optional collapsing, trimming, and line-ending normalization\n- **Keyboard-only enforcement**: ASCII output with configurable emoji policy\n- **Detailed stats**: every cleaning run reports what changed\n- **CLI tooling**: `rehuman` (cleaner) and `ishuman` (detector) with streaming \u0026 in-place modes\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpszemraj%2Frehuman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpszemraj%2Frehuman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpszemraj%2Frehuman/lists"}