{"id":15906009,"url":"https://github.com/lucacappelletti94/ngrammatic-old","last_synced_at":"2025-04-02T22:42:54.324Z","repository":{"id":232149015,"uuid":"783582356","full_name":"LucaCappelletti94/ngrammatic-old","owner":"LucaCappelletti94","description":"Reference old version of ngrammatic","archived":false,"fork":false,"pushed_at":"2024-07-26T14:51:00.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T13:13:53.242Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/LucaCappelletti94.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":"2024-04-08T07:14:12.000Z","updated_at":"2024-07-26T14:51:04.000Z","dependencies_parsed_at":"2024-10-28T10:22:01.863Z","dependency_job_id":"85f8b485-c00b-474a-8ecc-dfeae97ecb63","html_url":"https://github.com/LucaCappelletti94/ngrammatic-old","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"a965bff0a9047220efcccd9de84faadc50806126"},"previous_names":["lucacappelletti94/ngrammatic-old"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucaCappelletti94%2Fngrammatic-old","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucaCappelletti94%2Fngrammatic-old/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucaCappelletti94%2Fngrammatic-old/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucaCappelletti94%2Fngrammatic-old/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LucaCappelletti94","download_url":"https://codeload.github.com/LucaCappelletti94/ngrammatic-old/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246905830,"owners_count":20852818,"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-06T13:20:32.883Z","updated_at":"2025-04-02T22:42:54.283Z","avatar_url":"https://github.com/LucaCappelletti94.png","language":"Rust","readme":"This crate provides fuzzy search/string matching using N-grams.\n\nThis implementation is character-based, rather than word based,\nmatching solely based on string similarity.\n\nLicensed under the MIT license.\n\n\n### Documentation\n\nhttps://docs.rs/ngrammatic/latest/ngrammatic/\n\n### Installation\n\nThis crate is published on [crates.io](https://crates.io/crates/).\n\nTo use it, add this to your Cargo.toml:\n\n```toml\n[dependencies]\nngrammatic = \"0.3.4\"\n```\n\n### Usage\nTo do fuzzy matching, build up your corpus of valid symbols like this:\n\n```rust\nuse ngrammatic::{CorpusBuilder, Pad};\n\nlet mut corpus = CorpusBuilder::new()\n    .arity(2)\n    .pad_full(Pad::Auto)\n    .finish();\n\n// Build up the list of known words\ncorpus.add_text(\"pie\");\ncorpus.add_text(\"animal\");\ncorpus.add_text(\"tomato\");\ncorpus.add_text(\"seven\");\ncorpus.add_text(\"carbon\");\n\n// Now we can try an unknown/misspelled word, and find a similar match\n// in the corpus\nlet word = String::from(\"tomacco\");\nif let Some(top_result) = corpus.search(word, 0.25).first() {\n    if top_result.similarity \u003e 0.99 {\n        println!(\"✔ {}\", top_result.text);\n    } else {\n        println!(\"❓{} (did you mean {}? [{:.0}% match])\",\n                 word,\n                 top_result.text,\n                 top_result.similarity * 100.0);\n    }\n} else {\n    println!(\"🗙 {}\", word);\n}\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucacappelletti94%2Fngrammatic-old","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucacappelletti94%2Fngrammatic-old","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucacappelletti94%2Fngrammatic-old/lists"}