gasegamer / super-profanity Goto Github PK
View Code? Open in Web Editor NEWAn advanced profanity filter based on phonetics and normal detection that detects swears in 27 different languages!
License: Mozilla Public License 2.0
An advanced profanity filter based on phonetics and normal detection that detects swears in 27 different languages!
License: Mozilla Public License 2.0
I've been using this library in my project and at every start of the application I add some 50 words to be blacklisted, and I noticed that the library will write to the profanity_words json 50 times, that's a lot of time to wait for 50 promises to be fulfilled, sequentially.
I have a suggestion, instead of writing to profanity_words.json every time there is a change, we should keep the user blacklisted/ whitelisted words in memory, which I see is already happening with profanityJson variable. The reason for this is that the users will anyhow have to make the blacklist/whitelist calls at application startup and writing to profanity_words.json is a redundant and expensive operation.
So, my suggestion is to either remove the updateProfanityJson function calls entirely, or have the option for user to configure this behavior. I'm willing to make the changes as well as test them.
What do you think?
Works locally, but the odd way the code tries to load the noswearing module does not work when bundled with esbuild and deployed into an AWS Lambda. (I expect the trouble is when bundling, not the ultimate run environment.)
ERROR Uncaught Exception
{
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module '/var/task/src/infrastructure/player-api/custom_module/noswearing'\nRequire stack:\n- /var/task/src/infrastructure/player-api/register-player-lambda.js\n- /var/runtime/index.mjs",
"stack": [
"Runtime.ImportModuleError: Error: Cannot find module '/var/task/src/infrastructure/player-api/custom_module/noswearing'",
"Require stack:",
"- /var/task/src/infrastructure/player-api/register-player-lambda.js",
"- /var/runtime/index.mjs",
" at _loadUserApp (file:///var/runtime/index.mjs:951:17)",
" at async Object.UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:976:21)",
" at async start (file:///var/runtime/index.mjs:1137:23)",
" at async file:///var/runtime/index.mjs:1143:1"
]
}
Languages such as: Russian and French seem to be getting past the filter, but languages such as Chinese and English seem to be working just fine.
My name is bad?
import { changeMainLanguage, profanity } from "super-profanity";
changeMainLanguage("en");
const result = profane("Adam");
result is:
{
"isBadWord": true,
"detectedWord": "am",
"profanityWordRelated": "am",
"badWordLanguage": "tr"
}
After the fixes which were made until Release 1.1.1, lots of false positives might appear during detection. For example, if the sentence contains the expression but it
, the checker will detect the presence of the bad word butt
. A quick fix is whitelisting this expression with the whiteListWord
function. Therefore, it would be helpful if you could post the false positives and negatives you find in any language, so I can update the profanity list.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.