Skip to content

lyenliang/Profanity-Filter

Repository files navigation

Profanity Filter.

Usage Example: // initialize the profanity filter ProfanityFilter filter = new ProfanityFilter();

// load dictionary, where bad words are located.
filter.buildDictionaryTree("demo_eng.txt");

String badWords = "fuck you";

String result = filter.filterBadWords(badWords);
// result becomes "**** you"
System.out.println(result);

髒話過濾器

使用範例: // 初始化髒話過濾器 ProfanityFilter filter = new ProfanityFilter();

// 把裝有髒話的字典檔讀進來
filter.buildDictionaryTree("demo_eng.txt");

String badWords = "fuck you";

String result = filter.filterBadWords(badWords);
// 參數result會等於「**** you」
System.out.println(result);

About

Profanity Filter. 髒話過濾器

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published