{"id":15693127,"url":"https://github.com/code-hex/ngram","last_synced_at":"2025-07-21T12:02:14.494Z","repository":{"id":71654603,"uuid":"59733748","full_name":"Code-Hex/Ngram","owner":"Code-Hex","description":"Ngram with perl","archived":false,"fork":false,"pushed_at":"2016-07-26T12:43:04.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-29T11:17:33.552Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","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/Code-Hex.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":"2016-05-26T08:32:52.000Z","updated_at":"2016-05-26T08:34:44.000Z","dependencies_parsed_at":"2023-05-13T08:45:11.658Z","dependency_job_id":null,"html_url":"https://github.com/Code-Hex/Ngram","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Code-Hex/Ngram","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Hex%2FNgram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Hex%2FNgram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Hex%2FNgram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Hex%2FNgram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Code-Hex","download_url":"https://codeload.github.com/Code-Hex/Ngram/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Hex%2FNgram/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266296760,"owners_count":23907012,"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-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":[],"created_at":"2024-10-03T18:41:41.040Z","updated_at":"2025-07-21T12:02:14.441Z","avatar_url":"https://github.com/Code-Hex.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# String::Ngram\nText::MeCab based ngram module with perl\n\n##Usage\n###init\n```\nmy $ngram = String::Ngram-\u003enew(TEXT::MECAB_INITIAL_ARGS);\n```\n###make marcov dictionary\n```\n$ngram-\u003emakedic(Str, Int);\n```\n\n###save dictionary data\n```\n$ngram-\u003esavefile(Str);\n```\n\n###load dictionary data\n```\n$ngram-\u003eloadfile(Str);\n```\n\n###generate sentense\n```\n$ngram-\u003egenerate(Int);\n```\n  \n##Example\n```perl\n\n#!/usr/bin/env perl\n\nuse strict;\nuse warnings;\nuse utf8;\nuse v5.10;\nuse Encode qw/encode_utf8 decode_utf8/;\nuse Data::Dumper;\n\nuse String::Ngram;\n\nmy $ngram = String::Ngram-\u003enew(dicdir =\u003e \"/usr/local/lib/mecab/dic/mecab-ipadic-neologd\");\n\nmy $input = encode_utf8 \"今回のサミットで焦点となる世界経済を巡る討議は、午後３時半すぎに終わりました。この中で安倍総理大臣は「世界経済は今、まさに分岐点にあり、政策的対応を誤ると危機に陥るリスクがあることは認識しておかなければならない」という考えを示し、Ｇ７の結束を呼びかけたとみられます。。\";\n\n$ngram-\u003emakedic($input, 3);\n\n# say Dumper $ngram-\u003edictionary;\n\nsay $ngram-\u003egenerate(16);\n```\n\n##License\nMIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-hex%2Fngram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-hex%2Fngram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-hex%2Fngram/lists"}