{"id":13440094,"url":"https://github.com/pwoolcoc/ngrams","last_synced_at":"2026-01-19T02:07:57.291Z","repository":{"id":141177643,"uuid":"46247123","full_name":"pwoolcoc/ngrams","owner":"pwoolcoc","description":"(Read-only) Generate n-grams","archived":false,"fork":false,"pushed_at":"2016-08-30T14:41:33.000Z","size":59850,"stargazers_count":27,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-22T13:31:49.819Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pwoolcoc.gitlab.io/ngrams/ngrams","language":"Rust","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/pwoolcoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-11-16T02:28:12.000Z","updated_at":"2023-07-04T23:00:24.000Z","dependencies_parsed_at":"2024-01-07T21:53:55.345Z","dependency_job_id":null,"html_url":"https://github.com/pwoolcoc/ngrams","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwoolcoc%2Fngrams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwoolcoc%2Fngrams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwoolcoc%2Fngrams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwoolcoc%2Fngrams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pwoolcoc","download_url":"https://codeload.github.com/pwoolcoc/ngrams/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244585840,"owners_count":20476822,"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-07-31T03:01:19.726Z","updated_at":"2026-01-19T02:07:57.284Z","avatar_url":"https://github.com/pwoolcoc.png","language":"Rust","readme":"# N-grams\n\n[![Build Status](https://gitlab.com/pwoolcoc/ngrams/badges/master/build.svg)](https://gitlab.com/pwoolcoc/ngrams)\n[![Coverage Status](https://coveralls.io/repos/pwoolcoc/ngrams/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/pwoolcoc/ngrams?branch=master)\n[![](https://meritbadge.herokuapp.com/ngrams)](https://crates.io/crates/ngrams)\n\n[Documentation](https://pwoolcoc.gitlab.io/ngrams/ngrams)\n\nThis crate takes a sequence of tokens and generates an n-gram for it.\nFor more information about n-grams, check wikipedia: https://en.wikipedia.org/wiki/N-gram\n\n*Note*: The canonical version of this crate is hosted on [Gitlab](https://gitlab.com/pwoolcoc/ngrams)\n\n## Usage\n\nProbably the easiest way to use it is to use the iterator adaptor. If\nyour tokens are strings (\u0026str, String, char, or Vec\u003cu8\u003e), you don't have\nto do anything other than generate the token stream:\n\n```rust\nuse ngrams::Ngram;\nlet grams: Vec\u003c_\u003e = \"one two three\".split(' ').ngrams(2).collect();\n// =\u003e vec![\n//        vec![\"\\u{2060}\", \"one\"],\n//        vec![\"one\", \"two\"],\n//        vec![\"two\", \"three\"],\n//        vec![\"three\", \"\\u{2060}\"],\n//    ]\n```\n\n(re: the \"\\u{2060}\": We use the unicode `WORD JOINER` symbol as padding on the beginning and\nend of the token stream.)\n\nIf your token type isn't one of the listed types, you can still use the\niterator adaptor by implementing the `ngram::Pad` trait for your type.\n","funding_links":[],"categories":["Libraries","库 Libraries","库"],"sub_categories":["Text processing","文本处理 Text processing","文本处理"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpwoolcoc%2Fngrams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpwoolcoc%2Fngrams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpwoolcoc%2Fngrams/lists"}