thegdsks

Glin Profanity

開發程式設計v1.0.0
作者:thegdsks更新於 2026-05-11glin-profanity@clawhub_thegdsks/glin-profanity
後端開發指令碼工具

據 AlphaMoat 統計,截至 2026-09,Glin Profanity 累計下載 2,653 次、獲 1 個星標,在全部 5,078 個 AI 技能中排名第 3,980 位,在「開發程式設計」分類(577 個)中排名第 499 位。

累計安裝
142
累計下載
2653
星標
1
全站排名
#3,980
全站前 79% · 「開發程式設計」前 87%
平台累計安裝累計下載星標評論
ClawHub ↗8326281-
SkillHub ↗14226531—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

該庫嘗試識別變體拼寫、Unicode 混淆及模型檢測結果,並可提供匹配詞或處理後的文字。語境可能造成誤報或漏報;稽核人員應結合上下文複核,不要僅憑自動標記作出處罰決定。 需在 JavaScript 或 Python 環境安裝該庫;模型檢測為可選功能。

資料釋出於 2026-10-29

可以用來做什麼

  • 檢查使用者提交文字
  • 識別變體或混淆寫法
  • 為人工稽核提供候選結果

什麼時候用

  • 需要在應用中加入文字篩查時
  • 對使用者內容採取處置前,結合語境複核檢測結果

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

說明文字篩查庫能提供哪些結果,以及稽核決策需要如何複核。

月度資料趨勢

累計下載2653
1684220527252026-03 · 累計下載 17562026-05 · 累計下載 20942026-06 · 累計下載 21982026-07 · 累計下載 24022026-08 · 累計下載 25152026-09 · 累計下載 265326-0326-09
星標1
0122026-03 · 星標 12026-05 · 星標 12026-06 · 星標 12026-07 · 星標 12026-08 · 星標 12026-09 · 星標 126-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-092653—1
2026-082515+4.7%1
2026-072402+9.3%1
2026-062198+5.0%1
2026-052094—1
2026-031756—1

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

4.5 KB · ClawHub v1.0.0
---
name: glin-profanity
description: 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.
---

# Glin Profanity - Content Moderation Library

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

## Installation
展開全部(共 180 行)

```bash
# JavaScript/TypeScript
npm install glin-profanity

# Python
pip install glin-profanity
```

## Quick Usage

### JavaScript/TypeScript

```javascript
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

```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

```tsx
import { useProfanityChecker } from 'glin-profanity';

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

  return (
    <input onChange={(e) => checkText(e.target.value)} />
  );
}
```

## Key Features

| Feature | Description |
|---------|-------------|
| Leetspeak detection | `f4ck`, `sh1t`, `@$$` patterns |
| Unicode normalization | Cyrillic `fսck` → `fuck` |
| 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

```javascript
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

```javascript
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

```javascript
import { batchCheck } from 'glin-profanity';

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

## ML-Powered Detection (Optional)

```javascript
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
```javascript
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
```javascript
const result = filter.checkProfanity(userContent);

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

## Resources

- Docs: https://www.typeweaver.com/docs/glin-profanity
- Demo: https://www.glincker.com/tools/glin-profanity
- GitHub: https://github.com/GLINCKER/glin-profanity
- npm: https://www.npmjs.com/package/glin-profanity
- PyPI: https://pypi.org/project/glin-profanity/

「開發程式設計」分類下的熱門技能

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。