← 返回 Skills 市场
thegdsks

Glin Profanity

作者 thegdsks · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
1805
总下载
1
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install glin-profanity
功能描述
Profanity detection and content moderation library with leetspeak, Unicode homoglyph, and ML-powered detection. Use when filtering user-generated content, moderating comments, checking text for profanity, censoring messages, or building content moderation into applications. Supports 24 languages.
使用说明 (SKILL.md)

Glin Profanity - Content Moderation Library

Profanity detection library that catches evasion attempts like leetspeak (f4ck, sh1t), Unicode tricks (Cyrillic lookalikes), and obfuscated text.

Installation

# JavaScript/TypeScript
npm install glin-profanity

# Python
pip install glin-profanity

Quick Usage

JavaScript/TypeScript

import { checkProfanity, Filter } from 'glin-profanity';

// Simple check
const result = checkProfanity("Your text here", {
  detectLeetspeak: true,
  normalizeUnicode: true,
  languages: ['english']
});

result.containsProfanity  // boolean
result.profaneWords       // array of detected words
result.processedText      // censored version

// With Filter instance
const filter = new Filter({
  replaceWith: '***',
  detectLeetspeak: true,
  normalizeUnicode: true
});

filter.isProfane("text")           // boolean
filter.checkProfanity("text")      // full result object

Python

from glin_profanity import Filter

filter = Filter({
    "languages": ["english"],
    "replace_with": "***",
    "detect_leetspeak": True
})

filter.is_profane("text")           # True/False
filter.check_profanity("text")      # Full result dict

React Hook

import { useProfanityChecker } from 'glin-profanity';

function ChatInput() {
  const { result, checkText } = useProfanityChecker({
    detectLeetspeak: true
  });

  return (
    \x3Cinput onChange={(e) => checkText(e.target.value)} />
  );
}

Key Features

Feature Description
Leetspeak detection f4ck, sh1t, @$$ patterns
Unicode normalization Cyrillic fսckfuck
24 languages Including Arabic, Chinese, Russian, Hindi
Context whitelists Medical, gaming, technical domains
ML integration Optional TensorFlow.js toxicity detection
Result caching LRU cache for performance

Configuration Options

const filter = new Filter({
  languages: ['english', 'spanish'],     // Languages to check
  detectLeetspeak: true,                 // Catch f4ck, sh1t
  leetspeakLevel: 'moderate',            // basic | moderate | aggressive
  normalizeUnicode: true,                // Catch Unicode tricks
  replaceWith: '*',                      // Replacement character
  preserveFirstLetter: false,            // f*** vs ****
  customWords: ['badword'],              // Add custom words
  ignoreWords: ['hell'],                 // Whitelist words
  cacheSize: 1000                        // LRU cache entries
});

Context-Aware Analysis

import { analyzeContext } from 'glin-profanity';

const result = analyzeContext("The patient has a breast tumor", {
  domain: 'medical',        // medical | gaming | technical | educational
  contextWindow: 3,         // Words around match to consider
  confidenceThreshold: 0.7  // Minimum confidence to flag
});

Batch Processing

import { batchCheck } from 'glin-profanity';

const results = batchCheck([
  "Comment 1",
  "Comment 2",
  "Comment 3"
], { returnOnlyFlagged: true });

ML-Powered Detection (Optional)

import { loadToxicityModel, checkToxicity } from 'glin-profanity/ml';

await loadToxicityModel({ threshold: 0.9 });

const result = await checkToxicity("You're the worst");
// { toxic: true, categories: { toxicity: 0.92, insult: 0.87 } }

Common Patterns

Chat/Comment Moderation

const filter = new Filter({
  detectLeetspeak: true,
  normalizeUnicode: true,
  languages: ['english']
});

bot.on('message', (msg) => {
  if (filter.isProfane(msg.text)) {
    deleteMessage(msg);
    warnUser(msg.author);
  }
});

Content Validation Before Publish

const result = filter.checkProfanity(userContent);

if (result.containsProfanity) {
  return {
    valid: false,
    issues: result.profaneWords,
    suggestion: result.processedText  // Censored version
  };
}

Resources

安全使用建议
This skill is an instruction-only description of a profanity-detection library and appears internally consistent, but before installing or using it you should: 1) verify the npm and PyPI package names and the GitHub repository owners (confirm the code matches the documentation and is from a trusted maintainer); 2) inspect package dependencies and any postinstall scripts or native extensions; 3) check whether the ML functionality downloads models at runtime or contacts external endpoints (this can raise privacy and bandwidth concerns); 4) review license and GDPR/privacy implications for sending user content to models; and 5) test the package in an isolated environment (sandbox/container) before deploying to production. If you cannot locate a legitimate package/repo matching these docs, treat it as untrusted and do not install.
功能分析
Type: OpenClaw Skill Name: glin-profanity Version: 1.0.0 The skill bundle consists of metadata and a `SKILL.md` file describing a profanity detection library. The `SKILL.md` content provides standard installation instructions (`npm install`, `pip install`) and usage examples for the library. There is no evidence of prompt injection against the AI agent, data exfiltration, malicious execution, persistence mechanisms, or obfuscation within the provided files. All content appears to be aligned with the stated purpose of a content moderation library.
能力评估
Purpose & Capability
The name, description, and usage examples all describe a profanity-detection library. The SKILL.md does not request unrelated credentials, binaries, or system access — everything requested is consistent with a content-moderation library.
Instruction Scope
The instructions are example code snippets (JS/Python/React) and do not instruct the agent to read local files, environment secrets, or exfiltrate data. However the ML-related examples (TensorFlow.js toxicity model) imply that runtime behavior may include downloading ML models or loading third-party model files; that could cause network activity and bring in additional dependencies not visible in the SKILL.md.
Install Mechanism
There is no install spec in the skill bundle (instruction-only). The README suggests installing via npm or pip (public registries), which is a common approach. Because the skill does not bundle code, you should verify the actual npm/PyPI package(s) and their maintainers before installing; third-party packages can include additional dependencies or postinstall steps.
Credentials
The skill declares no required environment variables, credentials, or config paths. That is proportional for a library that operates on text and does not require external service authentication.
Persistence & Privilege
The skill is not always-enabled, does not request persistent agent privileges, and contains no install-time code in the bundle that would modify agent configuration. Autonomy flags are default and appropriate for a user-invocable skill.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install glin-profanity
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /glin-profanity 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Profanity detection library with leetspeak, Unicode homoglyph, and ML support. 24 languages.
元数据
Slug glin-profanity
版本 1.0.0
许可证
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Glin Profanity 是什么?

Profanity detection and content moderation library with leetspeak, Unicode homoglyph, and ML-powered detection. Use when filtering user-generated content, moderating comments, checking text for profanity, censoring messages, or building content moderation into applications. Supports 24 languages. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1805 次。

如何安装 Glin Profanity?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install glin-profanity」即可一键安装,无需额外配置。

Glin Profanity 是免费的吗?

是的,Glin Profanity 完全免费(开源免费),可自由下载、安装和使用。

Glin Profanity 支持哪些平台?

Glin Profanity 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Glin Profanity?

由 thegdsks(@thegdsks)开发并维护,当前版本 v1.0.0。

💬 留言讨论