{"id":17317773,"url":"https://github.com/ken-matsui/suggest","last_synced_at":"2025-07-05T00:03:05.153Z","repository":{"id":36963419,"uuid":"426834611","full_name":"ken-matsui/suggest","owner":"ken-matsui","description":"A minimal library to provide similar name suggestions, \"Did you mean?\"","archived":false,"fork":false,"pushed_at":"2025-04-01T21:20:06.000Z","size":124,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T17:06:13.275Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://crates.io/crates/suggest","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/ken-matsui.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":"2021-11-11T01:37:40.000Z","updated_at":"2025-04-01T21:20:08.000Z","dependencies_parsed_at":"2024-11-08T05:01:25.679Z","dependency_job_id":"8af63603-5fdd-4af1-8f67-78236c0f8784","html_url":"https://github.com/ken-matsui/suggest","commit_stats":{"total_commits":84,"total_committers":2,"mean_commits":42.0,"dds":"0.47619047619047616","last_synced_commit":"a8024bda86b297e6044981574b26e7bd799e5254"},"previous_names":["ken-matsui/suggestion"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ken-matsui%2Fsuggest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ken-matsui%2Fsuggest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ken-matsui%2Fsuggest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ken-matsui%2Fsuggest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ken-matsui","download_url":"https://codeload.github.com/ken-matsui/suggest/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248888756,"owners_count":21178100,"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":[],"created_at":"2024-10-15T13:17:43.425Z","updated_at":"2025-04-14T13:32:12.929Z","avatar_url":"https://github.com/ken-matsui.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# suggest [![crates.io version](https://img.shields.io/crates/v/suggest.svg)](https://crates.io/crates/suggest) [![crates.io downloads](https://img.shields.io/crates/d/suggest.svg)](https://crates.io/crates/suggest)\n\nA minimal library to provide similar name suggestions like \"Did you mean?\"\nThis library provides suggestion traits for all collection types in the standard library.\n\nThis library is intended to suggest a candidate from a list of unknown suggestions until runtime, in addition to the suggestion feature already available in [`clap`](https://github.com/clap-rs/clap#default-features).\n\n## Installation\n\nAdd the following to your `Cargo.toml`:\n\n```toml\n[dependencies]\nsuggest = \"0.5\"\n```\n\n## Examples\n\n### Simple case\n\nThis example can be executed by the `cargo run --example simple` command.\n\n```rust\nuse suggest::Suggest;\n\nfn main() {\n    let input = \"instakk\";\n\n    let list_commands = vec![\"update\", \"install\"];\n    if list_commands.contains(\u0026input) {\n        return;\n    }\n\n    if let Some(sugg) = list_commands.suggest(input) {\n        println!(\"No command named `{}` found.\", input);\n        println!(\"Did you mean `{}`?\", sugg);\n    }\n}\n```\n\n```shell\n$ cargo run\nNo command named `instakk` found.\nDid you mean `install`?\n```\n\n### Specifying distance\n\n```rust\nuse suggest::Suggest;\n\nfn main() {\n    let input = \"paoc\";\n\n    let list_commands = vec![\"poac\", \"poacpp\"];\n    if list_commands.contains(\u0026input) {\n        return;\n    }\n\n    if let Some(sugg) = list_commands.suggest_by(input, 2) {\n        println!(\"No command named `{}` found.\", input);\n        println!(\"Did you mean `{}`?\", sugg);\n    }\n}\n```\n\n```shell\n$ cargo run\nNo command named `paoc` found.\nDid you mean `poac`?\n```\n\n## Supported types\n\nPlease let me know if anything is left out through issues or pull requests.\n\n### Sequences\n\n* `LinkedList`\n* `VecDeque`\n* `Vec`\n\n### Maps\n\n* `HashMap`\n* `BTreeMap`\n\nTo suggest keys, use `suggest::SuggestKey` trait.\n\n### Sets\n\n* `BTreeSet`\n* `HashSet`\n\n### Misc\n\n* `BinaryHeap`\n* `[T; N]`: primitive array\n* `[T]`: slices\n\n## Contribution\n\nContributions, including issues and pull requests, are very welcome.\n\n### Build\n\n```bash\n$ cargo build\n```\n\n### Test\n\n```bash\n$ cargo build\n$ cargo test\n```\n\n### Publish\n\n#### [GitHub Releases](https://github.com/ken-matsui/suggest/tags)\n\n```bash\n$ git tag v0.1.0\n$ git push origin v0.1.0\n```\n\n#### [crates.io](https://crates.io/)\n\n```bash\n$ cargo publish\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fken-matsui%2Fsuggest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fken-matsui%2Fsuggest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fken-matsui%2Fsuggest/lists"}