{"id":15984894,"url":"https://github.com/divineomega/is_offensive","last_synced_at":"2025-03-18T01:30:22.848Z","repository":{"id":56969658,"uuid":"119539842","full_name":"DivineOmega/is_offensive","owner":"DivineOmega","description":"🤬🤭 Is Offensive Helper Function - Check if a string contains offensive words or variations of them","archived":false,"fork":false,"pushed_at":"2020-09-03T14:31:10.000Z","size":141,"stargazers_count":7,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T06:04:34.001Z","etag":null,"topics":["offensive","offensive-language","php","php-helper","php-library"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DivineOmega.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}},"created_at":"2018-01-30T13:30:24.000Z","updated_at":"2023-02-27T18:59:49.000Z","dependencies_parsed_at":"2022-08-21T06:40:23.752Z","dependency_job_id":null,"html_url":"https://github.com/DivineOmega/is_offensive","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fis_offensive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fis_offensive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fis_offensive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fis_offensive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DivineOmega","download_url":"https://codeload.github.com/DivineOmega/is_offensive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243893850,"owners_count":20364918,"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":["offensive","offensive-language","php","php-helper","php-library"],"created_at":"2024-10-08T02:11:09.648Z","updated_at":"2025-03-18T01:30:22.299Z","avatar_url":"https://github.com/DivineOmega.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# 🤬🤭 Is Offensive Helper Function\n\n[![Build Status](https://travis-ci.org/DivineOmega/is_offensive.svg?branch=master)](https://travis-ci.org/DivineOmega/is_offensive)\n[![Coverage Status](https://coveralls.io/repos/github/DivineOmega/is_offensive/badge.svg?branch=master)](https://coveralls.io/github/DivineOmega/is_offensive?branch=master)\n[![StyleCI](https://styleci.io/repos/119539842/shield?branch=master)](https://styleci.io/repos/119539842)\n\n\nThis PHP package provides an `is_offensive` helper function. Passing a string to `is_offensive` will return a boolean telling you if it contains offensive words.\n\n## Installation\n\nThe `is_offensive` package can be easily installed using Composer. Just run the following command from the root of your project.\n\n```\ncomposer require \"divineomega/is_offensive\"\n```\n\nIf you have never used the Composer dependency manager before, head to the [Composer website](https://getcomposer.org/) for more information on how to get started.\n\n## Usage\n\nTo check if a word is offensive, just pass it to the `is_offensive` method.\n\nHere are a few examples:\n\n```php\nis_offensive('fuck');  // true\nis_offensive('fuk');   // true\n\nis_offensive('duck');  // false\nis_offensive('cat');   // false\n\nis_offensive('sex');         // true\nis_offensive('Middlesex');   // false\n\nis_offensive('tit');         // true\nis_offensive('Tittesworth'); // false\n\nis_offensive('cunt');        // true\nis_offensive('Scunthorpe');  // false\n```\n\nIf you prefer to avoid using helper functions, the following syntax is also available.\n\n```php\n$offensive = (new OffensiveChecker())-\u003eisOffensive('fuck')  // true\n```\n\n### Custom word lists\n\nThere are reasons why you may wish to define your own list of offensive words. Perhaps the\nones supplied are too strict, or not strict enough.\n\n```php\n$blacklist = ['moist', 'stinky', 'poo'];\n\n$offensiveChecker = new OffensiveChecker($blacklist);\n\n$offensiveChecker-\u003eisOffensive('poo');     // true\n$offensiveChecker-\u003eisOffensive('poops');   // true\n```\n\nYou can also define a whitelist of words that will be accepted even if they match the defined\nlist of offensive words.\n\n```php\n$blacklist = ['moist', 'stinky', 'poo'];\n$whitelist = ['poop'];\n\n$offensiveChecker = new OffensiveChecker($blacklist, $whitelist);\n\n$offensiveChecker-\u003eisOffensive('poo');     // true\n$offensiveChecker-\u003eisOffensive('poops');   // false\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivineomega%2Fis_offensive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivineomega%2Fis_offensive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivineomega%2Fis_offensive/lists"}