How can I specify my own wordlists?
Opened this issue · 7 comments
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.
- 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...
Is this what I should do?
Profanity::dictionary($dictionary)->blocker("message")->filter()
I actually do want to contribute but need to finish this up already. PM me if interested
Profanity::blocker("message")->dictionary($dictionary)->filter()
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.
What would be the structure for the array?
$array["es"] = [
"puto", "imbecil"
];
Is it like this?
Thanks mate
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