A powerful TypeScript library for detecting inappropriate Thai words in text content. Perfect for content moderation, chat filters and other.
- 🎯 Smart detection combining prefixes and root words
- 🚫 Customizable ignore list for false positives
- 🔄 Dynamic updates to word lists
- 🛠️ Easy to integrate and configure
Choose your preferred package manager:
# Using npm
npm install thai-bad-words
# Using yarn
yarn add thai-bad-words
// Throws an error if bad words are found
checkBadWords("some text");
addBadWords(["word1", "word2"]);
addIgnoreList(["false_positive1", "false_positive2"]);
addPrefixes(["prefix1", "prefix2"]);
removeBadWords(["word1"]);
const badWords = getBadWords();
import { checkBadWords, addBadWords, addIgnoreList } from "thai-bad-words";
// Add words to ignore
addIgnoreList(["หีบ", "สัสดี"]);
// Add new bad words
addBadWords(["โง่", "บ้า"]);
// Check text
try {
checkBadWords("some text to check");
} catch (error) {
console.log("❌ Bad word detected:", error.message);
}
Common prefixes used for word combinations:
["กู", "มึง", "ไอ้", "อี", "ไอ", "ผม", "คุณ", "กระผม", "เธอ", "พ่อ", "แม่", "นาย"];
Words that should be skipped during detection:
["หีบ", "สัสดี", "หน้าหีบ", "ตด"];
Base inappropriate words (shortened for README):
["ควย", "เหี้ย", "หี", "สัส", "เชี่ย" /* ... and more ... */];
Contributions are welcome! Feel free to:
- 🐛 Report bugs
- 💡 Suggest new features
- 📝 Improve documentation
- 🔧 Submit pull requests
This project is licensed under the MIT License - see the LICENSE file for details.
If you have any questions or need support, please:
- 📫 Open an issue
- 🌟 Star the repository if you find it helpful