{"id":13366832,"url":"https://github.com/osaminGo/shamoji","last_synced_at":"2025-03-12T18:31:30.554Z","repository":{"id":23078621,"uuid":"98079587","full_name":"osamingo/shamoji","owner":"osamingo","description":"The shamoji (杓文字) is a word filtering package","archived":false,"fork":false,"pushed_at":"2022-12-01T19:56:27.000Z","size":39,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-25T05:24:20.639Z","etag":null,"topics":["go","tokenizer","word-filter"],"latest_commit_sha":null,"homepage":"","language":"Go","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/osamingo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"osamingo","custom":"https://paypal.me/osamingo"}},"created_at":"2017-07-23T06:38:42.000Z","updated_at":"2022-09-27T08:51:16.000Z","dependencies_parsed_at":"2023-01-13T22:43:19.099Z","dependency_job_id":null,"html_url":"https://github.com/osamingo/shamoji","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osamingo%2Fshamoji","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osamingo%2Fshamoji/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osamingo%2Fshamoji/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osamingo%2Fshamoji/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osamingo","download_url":"https://codeload.github.com/osamingo/shamoji/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243271314,"owners_count":20264436,"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":["go","tokenizer","word-filter"],"created_at":"2024-07-30T00:01:32.697Z","updated_at":"2025-03-12T18:31:30.264Z","avatar_url":"https://github.com/osamingo.png","language":"Go","funding_links":["https://github.com/sponsors/osamingo","https://paypal.me/osamingo"],"categories":["自然语言处理","自然語言處理"],"sub_categories":["高级控制台界面","高級控制台界面"],"readme":"# shamoji\n\n[![GitHub Actions](https://github.com/osamingo/shamoji/workflows/CI/badge.svg?branch=master)](https://github.com/osamingo/shamoji/actions?query=workflow%3ACI+branch%3Amaster)\n[![codecov](https://codecov.io/gh/osamingo/shamoji/branch/master/graph/badge.svg)](https://codecov.io/gh/osamingo/shamoji)\n[![Go Report Card](https://goreportcard.com/badge/github.com/osamingo/shamoji)](https://goreportcard.com/report/github.com/osamingo/shamoji)\n[![codebeat badge](https://codebeat.co/badges/9d9fdf3d-0c6d-455f-8444-8399a07d49ae)](https://codebeat.co/projects/github-com-osamingo-shamoji-master)\n[![GoDoc](https://godoc.org/github.com/osamingo/shamoji?status.svg)](https://godoc.org/github.com/osamingo/shamoji)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/osamingo/shamoji/master/LICENSE)\n\n## About\n\nThe shamoji (杓文字) is word filtering package.\n\n## Install\n\n```\n$ go get github.com/osamingo/shamoji@latest\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sync\"\n\n\t\"github.com/osamingo/shamoji\"\n\t\"github.com/osamingo/shamoji/filter\"\n\t\"github.com/osamingo/shamoji/tokenizer\"\n\t\"golang.org/x/text/unicode/norm\"\n)\n\nvar (\n\to sync.Once\n\ts *shamoji.Serve\n)\n\nfunc main() {\n\tyes, word := Contains(\"我が生涯に一片の悔い無し\")\n\tfmt.Printf(\"Result: %v, Word: %s\", yes, word)\n}\n\nfunc Contains(sentence string) (bool, string) {\n\to.Do(func() {\n\t\ttok, err := tokenizer.NewKagomeTokenizer(norm.NFKC)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\ts = \u0026shamoji.Serve{\n\t\t\tTokenizer: tok,\n\t\t\tFiler:     filter.NewCuckooFilter(\"涯に\", \"悔い\"),\n\t\t}\n\t})\n\treturn s.Do(sentence)\n}\n```\n\n## License\n\nReleased under the [MIT License](https://github.com/osamingo/shamoji/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FosaminGo%2Fshamoji","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FosaminGo%2Fshamoji","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FosaminGo%2Fshamoji/lists"}