aedos
v1.1.4
Published
Free nodejs module to detect languages and profane/immodest words in a text
Downloads
28
Maintainers
Readme
Installation
npm install aedos
What is Aedos?
Aedos is a free nodejs module created primarly to detect profane and immodest words in a text, as an addition it can detect as well languages of a specific text, the module uses Artificial Intelligence in order to detect both the text and the profanity in a text with a list of profane words as a data modal in order to train it.
How many languages it can detects?
it can detect 62 languages and it will be added new ones soon.
What's new in this release?
- method to remove profane words from the text
- method to validate the text
- 100 profane word have been added
- bug fixes
- API for this module has been created
- Fluid API
How to use it?
You can use now the method validate text to be able to validate the text once without the need to repeat the process after that you can use any of the following methods to manipulate the text as following.
detect a language in a text
the detection is relative to the length of the text the longer was the text the more detection will be accurate, in case the text was to small (less then 2 words) it will throw an "InputError" with a message.
const { validateText } = require("aedos");
// then use it with any async/await function
async function detectLanguages(text) {
const detectionResult = await validateText(text).detectLanguagesInText();
return detectionResult;
// this will return an object like this { data: {"detected-languages": [{language: "en", accurarcy: 1}]}}
}
detect profanity in a text
the detection is based on a statistical matching using some hasing algorithms, the algorithm transform every each charchter in a word into a digit and then calculates the percent of the similarity of the word in a text and the pattern, and then generate the final percent of the matching.
the module can detect the profanity in a text with one language or multiple as following:
text with one language
const { validateText } = require("aedos");
let text = "f** you mo*** fu*** i will kill you j*, mal***";
// using async/await
async function detectBadWords(text) {
let result = await validateText(text).detectProfaneWordsInText();
return result;
// this will return an object like this
// { data: {"founded-}word": [f**]}
// ...
}
text with mutliple languages
const { validateText } = require("aedos");
let text = "you m*** f*** i will k***, راح ا**** يا ق***ة";
// using async/await
async function detectBadWords(text) {
let result = await validateText(text).detectProfaneWordsInText();
return result;
// this will return an object like this
// { data: {"founded-}word": [f**]}
// ...
}
remove profanity in a text
It's new in version 1.1.2 (release) with this method if you want to remove any profane words in a text and keep your text clean this can be done so easily, this feature can help you provide for your user credibility by comparing between the original text and the moderated text in the result as the following.
const { validateText } = require("aedos");
async function removeBadWords(text) {
const { originalText, moderatedText } = await validateText(
text
).removeProfaneWordsFromText();
// return you result as your app requires
}
How can i contribute to the project?
if you found a bug or a problem while using the project please put a bug report in the issues section and explain what's the problem exactly, make sure to name the bug based on the level of the problem you had for example, if you faced it in using the language detection method write like this: Bug:LanguageDetectionERR and write your decription
Can i make a feature request?
Yes feel free to make a feature request in the issues section with the label of "FeatureRequest:" and explain what ideas do you have and why, and i will make it exist as soon as possible.
Donation and sponsorship
am currently making this project as a side project so if you found it interesting and want to support me i will be so glad to buy me a coffee