andreasonny83 / unique-names-generator

Generate unique and memorable name strings
https://codesandbox.io/s/unique-names-generator-7fn9r
MIT License
594 stars 61 forks source link

Please remove `sexual` from adjectives dict #66

Open burmecia opened 2 years ago

burmecia commented 2 years ago

Please remove the word sexual from adjectives dict, or if any other similar words can also be removed? Thanks.

flavioespinoza commented 2 years ago

Please leave the word sexual and any other words you see fit. I think adults can handle Sexual Damselfly.

burmecia commented 2 years ago

But that will cause concerns for customer facing apps, imaging a children app send notification contains that word in url to users...

flavioespinoza commented 2 years ago

That is a very Woke opinion, but it is by no means fact.

If you want to exclude words on your apps you can do this:

import { uniqueNamesGenerator, Config, adjectives, animals } from 'unique-names-generator';
import stringHash from 'string-hash';

export function uniqueName(param1: string, param2: string | number, wordToExclude: string) {
  const seed = stringHash(`${param1}${param2}`);
  const customConfig: Config = {
    dictionaries: [adjectives, animals],
    separator: ' ',
    length: 2,
    style: 'capital',
    seed,
  };

  let name = uniqueNamesGenerator(customConfig);

  console.log(name); // Purring Swordfish <-------------------------------

  const split = name.split(' ');

  if (split[0] === wordToExclude) {
    name = `Woke ${split[1]}`;
  }

  return name;
}

const param1 = '4rq8r50988Fsdfaxcjvhlnxq1t4g379-rqeorg32';
const param2 = 1234565;

const appropriateWokeChildRandomName = uniqueName(param1, param2, 'Purring');

console.log(appropriateWokeChildRandomName); // Woke Swordfish <-------------------------------

My issue with your request is that you ask to remove sexual and any other similar (e.g. offensive) words.

It's not the job of an open source project to know which words you find offensive and then exclude them for the benefit of your app. Take responsibility for your needs, code a solution, or create your own NPM module where you control the words allowed.

lramos15 commented 1 year ago

https://www.npmjs.com/package/@joaomoreno/unique-names-generator is a forked version Microsoft uses for the VS Code project with some of the more commonly offensive words removed. Feel free to use that instead, but there is no guarantees it will always be completely synced with the upstream project.

sandro-pasquali commented 2 weeks ago

See https://github.com/joaomoreno/unique-names-generator/pull/3