Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I specify my own wordlists? #6

Open
andresrex opened this issue Feb 21, 2018 · 7 comments
Open

How can I specify my own wordlists? #6

andresrex opened this issue Feb 21, 2018 · 7 comments

Comments

@andresrex
Copy link

I need to do it in Spanish from Mexico and there are a lot of bad words missing. Updating directly the Dictionary is not an option since I am using composer.

@ConsoleTVs
Copy link
Owner

  • dictionary($dictionary)

Sets the dictionary. If string is provided, it will be treated as a path and will try to decode the json contained in the path. If array is provided, it will set the dictionary.

Example dictionary:

[
    {
        "language": "en",
        "word": "bitch"
    },
    {
        "language": "en",
        "word": "fuck"
    }
]

Or you may just contribute to the repo by adding the missing ones...

@andresrex
Copy link
Author

Is this what I should do?

Profanity::dictionary($dictionary)->blocker("message")->filter()

@andresrex
Copy link
Author

I actually do want to contribute but need to finish this up already. PM me if interested

@ConsoleTVs
Copy link
Owner

Profanity::blocker("message")->dictionary($dictionary)->filter()

@andresrex
Copy link
Author

It is not working :( I am able to get the file content with file_get_contents, but when "json_decode" it returns null. My Dictionary has the same structure thank yours.

@andresrex
Copy link
Author

What would be the structure for the array?

$array["es"] = [
"puto", "imbecil"
];

Is it like this?
Thanks mate

@ConsoleTVs
Copy link
Owner

ConsoleTVs commented Feb 23, 2018

I already told you the structure...

[
    {
        "language": "en",
        "word": "bitch"
    },
    {
        "language": "en",
        "word": "fuck"
    }
]

Anyway, the best way to do it if you're not understanding it, is to contribute to the repo and add them yourself...

add the words here:

https://github.com/ConsoleTVs/Profanity/blob/master/Generator/es

Compile using python3: https://github.com/ConsoleTVs/Profanity/blob/master/Generator/build.py

python build.py

copy output.json to the dictionary folder and rename it to Default.json

Then submit the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants