npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aedos

v1.1.4

Published

Free nodejs module to detect languages and profane/immodest words in a text

Downloads

23

Readme

Image of Yaktocat

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

"Buy Me A Coffee"