{"id":22066075,"url":"https://github.com/pcpratheesh/go-censorword","last_synced_at":"2025-05-13T01:55:07.030Z","repository":{"id":57596417,"uuid":"372391544","full_name":"pcpratheesh/go-censorword","owner":"pcpratheesh","description":"A lightweight and easy-to-use tool that allows you to detect and filter out profanity words from your text-based content. Whether you're building a social media platform, a chat app, or just want to keep your comments section clean, this package can help.","archived":false,"fork":false,"pushed_at":"2024-06-18T13:39:53.000Z","size":21,"stargazers_count":9,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-13T01:55:01.482Z","etag":null,"topics":["bad-word-filter","bad-words","badwords","censor","censored-words","censoring","go","golang","profanities","profanity-filter","profanityfilter"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/pcpratheesh/go-censorword","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/pcpratheesh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-05-31T05:25:53.000Z","updated_at":"2024-03-31T22:03:48.000Z","dependencies_parsed_at":"2024-06-20T00:19:05.672Z","dependency_job_id":null,"html_url":"https://github.com/pcpratheesh/go-censorword","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/pcpratheesh%2Fgo-censorword","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcpratheesh%2Fgo-censorword/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcpratheesh%2Fgo-censorword/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcpratheesh%2Fgo-censorword/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pcpratheesh","download_url":"https://codeload.github.com/pcpratheesh/go-censorword/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253856640,"owners_count":21974577,"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":["bad-word-filter","bad-words","badwords","censor","censored-words","censoring","go","golang","profanities","profanity-filter","profanityfilter"],"created_at":"2024-11-30T19:25:36.279Z","updated_at":"2025-05-13T01:55:07.007Z","avatar_url":"https://github.com/pcpratheesh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Create Release](https://github.com/pcpratheesh/go-censorword/actions/workflows/release.yml/badge.svg)](https://github.com/pcpratheesh/go-censorword/actions/workflows/release.yml)\n\n# go-censorword\ngo-censorword is a lightweight and easy-to-use tool that allows you to detect and filter out profanity words from your text-based content. Whether you're building a social media platform, a chat app, or just want to keep your comments section clean, this package can help.\n\n## Installation\n```sh\n    go get -u github.com/pcpratheesh/go-censorword\n```\n\nfor previous version\n\n```sh\n    go get -u github.com/pcpratheesh/go-censorword@v1.1.0\n```\n\n## Usage\n```go\nimport (\n\t\"github.com/pcpratheesh/go-censorword\"\n)\n```\n\n\n## In working\nThe go-censorword package uses a censorWord [here](censor/censor.go) list to check profanities, but also provides an option for you to override this list with your own contents. You can create a list of bad words that are not included in the original blacklist by using the **customCensorList** method.\n\n```go\nCustomCensorList([]string{}) \n```\n\n## How to use\n```go\n// this would initialize the detector object.\nvar detector = gocensorword.NewDetector(\n\tgocensorword.WithCensorReplaceChar(\"*\"),\n    \n    // override the existing list of bad words with your own\n    gocensorword.WithCustomCensorList([]string{\n        \"bad\", \"word\",\"one\",\n    }),\n)\n\n// censor the word\nactualString := \"with having some bad words\"\nfilterString, err := detector.CensorWord(actualString)\nif err != nil {\n    panic(err)\n}\n\n```\n\n## Option Methods\n- *WithCensorReplaceChar(string)* : This method can be used to replace the filtered word characters with asterisks (*), dashes (-) or custom characters, like the pound sign (#) or at sign (@).\n- *WithCustomCensorList([]string)* : The list of your own profanity words\n- *WithSanitizeSpecialCharacters(bool)*: To sanitize the special characters in the word\n- *WithKeepPrefixChar(bool)*: If you want to Kept the prefix Character (eg : F****)\n- *WithKeepSuffixChar(bool)*: If you want to Kept the suffix Character (eg : ****K)\n\n## Example\n```go\ndetector := NewDetector(\n    gocensorword.WithCensorReplaceChar(\"*\"),\n)\n\nresultString, err := detector.CensorWord(inputString)\n\nif err != nil {\n    panic(err)\n}\n```\n\n\nIn the future, we should implement the following points\n- Support for other language profanities\n- All words having repeated characters more than twice \n\n\n## Contributing\nContributions to the Profanity Filter package are welcome and encouraged! If you find a bug or have a feature request, please open an issue on GitHub. If you'd like to contribute code, please fork the repository, make your changes, and submit a pull request.\n\n\n## License\nThe Profanity Filter package is licensed under the MIT License. See the LICENSE file for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcpratheesh%2Fgo-censorword","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpcpratheesh%2Fgo-censorword","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcpratheesh%2Fgo-censorword/lists"}