Search Unity

Bad Word Filter PRO - Solution against profanity and obscenity

Discussion in 'Assets and Asset Store' started by Stefan-Laubenberger, Jan 9, 2015.

  1. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi

    Thank you for reporting this!
    It's fixed in the current beta - if you like to have access, please send us your invoice via email.


    So long,
    Stefan
     
  2. Ghetaldus

    Ghetaldus

    Joined:
    Jul 15, 2017
    Posts:
    46
    Nice. Have sent you email with invoice number.
     
  3. dh7300

    dh7300

    Joined:
    Jan 23, 2020
    Posts:
    9
    Hello.
    I want to apply bad filter to only two languages in my project.

    However, even looking at the demo scene, I don't know what scripts and functions should be imported and applied to my project.

    When I first played the demo scene,'_emoji','_global' and'english' were pre-selected in the settings section, and I want to know where the code responsible for this part is. Knowing this, I think I can set the language I want to select first and then proceed with the work.
     
  4. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi

    Please take a look at chapter 7 of the documentation:
    https://www.crosstales.com/media/data/assets/badwordfilter/BadWordFilter-doc.pdf

    Just add the desired sources (=languages) at the end of the call, like this:
    Code (CSharp):
    1. bool isNotOk = BadWordManager.Instance.Contains("hello world", "english", "german");
    I hope this helps you further.


    Cheers
    Stefan
     
  5. InglewoodTechnology

    InglewoodTechnology

    Joined:
    Mar 7, 2016
    Posts:
    40
    Howdy;

    Un-installed and then re-installed BWF. Now, after install, there are no files in the Editor Default Resources folder and the BWF prefab can't find any of it's installed scripts. Did I miss a step in the installation process?
     
  6. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi Mr. Congressman :)

    Please make sure you deleted the whole "Assets/Plugins/crosstales"-folder before re-installing the asset.


    Cheers
    Stefan
     
  7. InglewoodTechnology

    InglewoodTechnology

    Joined:
    Mar 7, 2016
    Posts:
    40
    Stefan;

    I believe I did; I followed the steps on pg 27 of the docs; update, new scene, delete, import.
     
  8. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Ok, but please delete the whole "crosstales"-folder and import it again.
    Does that solve the issue?
     
  9. InglewoodTechnology

    InglewoodTechnology

    Joined:
    Mar 7, 2016
    Posts:
    40
    That has been my process; delete entire "crosstales" folder, import, new scene, drag BWF prefab in (I did this again just before posting); can't find scripts attached to prefab.
     
  10. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    This is really strange - I currently have no idea why this happens in your project.
    Can you please create a new, empty project with the same Unity version and import BWF there? What happens?
     
  11. InglewoodTechnology

    InglewoodTechnology

    Joined:
    Mar 7, 2016
    Posts:
    40
    New project import works perfectly, which is actually very frustrating! How can I diagnose what's wrong/different with my existing project?
     
  12. InglewoodTechnology

    InglewoodTechnology

    Joined:
    Mar 7, 2016
    Posts:
    40
    In my problem project, if the "Editor Default Resources" folder is missing, it is not created on install. If the folder is present during install, it is not populated.

    In the test project, the folder was not present before install but was created and populated during install.

    What would prevent that folder from being created during install?
     
  13. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    I'm frustrated too, but let's try this:
    1. Remove all "crosstales"-folders again (including the one in "Editor Default Resources")
    2. Remove any asmdefs for our asset (if you created one)
    3. Remove CT_BWF and CT_UI from the "Scripting Define Symbols" in the build settings
    4. Close and restart Unity
    5. Make sure you have no errors in your project
    6. Import the asset again
     
  14. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Also Available near Scunthorpe is Penistone, you couldn't make it up.

    I tracked through all these posts just to find this post from the reviews. LUL

    Trust you are well. Waves from here
     
  15. aaron-PlayQ

    aaron-PlayQ

    Joined:
    Mar 27, 2015
    Posts:
    19
    Hello, while using the BWF BadWord mask using the default regex checks (not Simple Check) I noticed that the string "AM" is being filtered. I encountered this while passing a string containing a timestamp.

    Here's a screenshot of my debugger showing the regex it's tripping on:
    upload_2021-7-6_14-21-32.png

    EDIT: The culprit is the Turkish regex filter: crosstales\BadWordFilter\Resources\Filters\ltr\tr.txt
    When I remove it "AM" is no longer filtered.
     
    Last edited: Jul 6, 2021
    twobob and Stefan-Laubenberger like this.
  16. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Thank you for mention this - we will fix the regex for the upcoming release.
     
    aaron-PlayQ and twobob like this.
  17. GiyomuGames

    GiyomuGames

    Joined:
    Jan 12, 2015
    Posts:
    80
    Hello there! Quick question about BWF: I see that in the documentation it says
    Code (CSharp):
    1. 4.2.5. Simple Check
    2. This option enables the "Simple Check"-mode for the manager. This detects the bad
    3. words in all sentences, regardless of any regex-settings. This is required for Chinese,
    4. Japanese, Korean and Thai.
    If I am checking text for which I don't know if it is in Japanese or in English (for example), should I perform a simple check first and if it passed then a normal check?
     
  18. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi

    If you expect more users from Japan, then your approach is fine. Otherwise swap the tests, so first normal and then the simple check.


    Cheers
    Stefan
     
    GiyomuGames likes this.
  19. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
  20. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
  21. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
  22. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Yes, that's because WebGL (=Javascript) isn't multi-threaded until now.
    As soon as it's supported, we will add it to BWF.
     
    jGate99 likes this.
  23. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    to avoid unnecessary garbage generation, can you please add support for taking an existing List<string> and adding bad words to it rather than instantiating new one?

    BWFManager.Instance.OnGetAllComplete += InstanceOnOnGetAllComplete;
    instance.GetAllAsync(value, existingListForWordsAlreadyEmpty);
     
  24. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hello again

    We made a fix to prevent possible memory garbage in the GetAll-method.
    If you like to test it, please send us an email with your invoice.

    Have a nice weekend!


    Cheers
    Stefan
     
    jGate99 likes this.
  25. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    If this is not related to passing an existing List<string>, then adding this on top of what you have already done will better optimize it. For example with Unity 2021.2 i'm using Pools a lot, and i can supply a precreated List<string> whch your method populate and returns, without instantiating new list<string> every time
     
  26. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    The new version has only one list per filter during the whole life-time of the app.
    If you like to test it, let me know.
     
    jGate99 likes this.
  27. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    sure, sounds good
     
  28. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Then please send me an email with the invoice number.
     
  29. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Hi @Stefan-Laubenberger

    Today i had a trouble some day, when i built for android on last minute it started to add camera permission, until i realized its due to your library, even though im just dealing with words.

    Can you please add Directives to Disable unncessary code that trigger such issues?

    upload_2021-11-15_22-9-5.png
     
    GiyomuGames likes this.
  30. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    We apologize for the hassle it caused!

    This extension method was added in the last release and we were unaware it causes this behaviour on mobiles.
    We fixed it and will release soon an update. Meanwhile, just delete the method.
     
    jGate99 likes this.
  31. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Thanks appreciate that :)
     
  32. GiyomuGames

    GiyomuGames

    Joined:
    Jan 12, 2015
    Posts:
    80
    Thanks, I noticed the same issue :)
     
  33. Da_Elf

    Da_Elf

    Joined:
    Jan 21, 2017
    Posts:
    15
    FIXED!! had to make a reference to the BWF Prefab

    Where can i find a current tutorial? the video online is older since ManagerMask doesnt seem to exist any more nor does BWFManager.ReplaceAll.
    bought it but no clue how to use it.

    Ok i used

    using Crosstales.BWF.Model.Enum;

    This got the managermask to work. but the replaceAll is still not working when i put in
    usersName.text = BWFManager.ReplaceAll(usersName.text,Mask,Sources);

    i get this error
    An object reference is required for the nonstatic field, method, or property 'member'
     
    Last edited: Dec 18, 2021
  34. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi

    I apologize for the old video tutorial - we have planned to update all videos in the next few months.
    However, have you tried our manual (chapter 7):
    https://www.crosstales.com/media/data/assets/badwordfilter/BadWordFilter-doc.pdf

    BWF is now a singleton and to access the methods and properties, you have to call it like this BWFManager.Instance.ReplaceAll().
    There is no need for a reference to the prefab.

    I hope this helps you further.


    Regards,
    Stefan
     
  35. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Hi @stefan
    Can you please tell which language has "Gaytan" as bad word?
    And how do i disable bad word filter on it
     
  36. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi

    You can always enable "Debug BadWords" in the configuration to see which filter caused the detection:
    upload_2021-12-23_10-21-11.png

    However, "Gaytan" is found because BWF per default matches all words which start with "gay" to prevent word creations like "Gaymaster" etc.
    You can change the regex in "en.txt" (line 121) to \bgay\b to prevent this case.

    I hope this helps you further.

    Have a nice xmas!


    Cheers
    Stefan
     
    jGate99 likes this.
  37. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    What if i only want to approve Gaytan but keep old regex intact for gaymaster etc etc
     
  38. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Regex can exclude certain words and it would look like that:

    \b(?!\bGaytan\b)gay\b
     
    jGate99 likes this.
  39. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Thanks, but what happens when i update your plugin to a newer version and in that case it'd be replaced, right?
     
  40. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    I would recommend creating a copy of the "Source" and text file "en" and then replace it in the "Bad Word Provider":
    upload_2021-12-25_15-36-27.png

    This way, you would use always the right version of the customized files.
     
    jGate99 likes this.
  41. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    310
    Hi, I added a custom Source to the “Special restricted words” GameObject in the BWF prefab and the regex count is updated correctly in the Inspector, but then at runtime BWF fails to detect only the bad words that should be found by my custom Regexs. I am using https://regex101.com/ to make sure my Regexs are correct. What could be wrong?

    EDIT: ok, looks like the issue is different... There is no way to detect "joemama" even if I add the full word as it is in the custom Source. What's going on here? :D

    EDIT2: also a number of other regexs won't detect bad words, but they do when tested in Regex101. Looks like regexs that don't detect anything from the very first character are ignored completely in BWF (even if a detection happens from the second, third, etc character), but I may be wrong.
     
    Last edited: Dec 30, 2021
  42. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi Danjel

    First of all, I wish you a great 2022!

    Maybe something is wrong with the setup or the call of the method.
    Please try it by enabling "Debug BadWords" in the configuration and then create a new scene and add the "BadWordManager" and a "BadWordProviderText" to it.
    Then add your file with the regexes to the "BadWordProviderText" and add the provider to the manager:
    upload_2022-1-2_17-1-27.png

    Afterwards, call "BadWordManager.Instance.xyz" (xyz = the desired method) and test it.
    If this still fails, please send me some of your regexes for further testing on our side.


    Cheers
    Stefan
     
  43. Timmy-Hsu

    Timmy-Hsu

    Joined:
    Aug 27, 2015
    Posts:
    51
    Hi,

    1.Is it possible to make the Filters files to Assetbundles to update files?
    If new words are added, the filter file needs to be patched.
    2.I try WebGL Demo, I can't type or paste Chinese characters to Input.
     
  44. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi

    Thank you for your interest in BWF!

    Here are the answers to you questions:
    1. Yes, but you have to reload the providers by yourself. Therefore, we recommend hosting the files on the Internet - this is the easiest way and fully supported in our asset.
    2. Copy and paste doesn't work in WebGL and we had to create a fix (included in the asset) which seems to break non Latin-input :( However, we will soon provide downloadable demos for the standalone platforms, but we can assure you that Chinese is supported and working.


    Cheers
    Stefan
     
    Timmy-Hsu likes this.
  45. Timmy-Hsu

    Timmy-Hsu

    Joined:
    Aug 27, 2015
    Posts:
    51
    1.If the files on the Internet, will BWF download the files every time app run first time?
    Or only when check the file is different?
    2.When BWF download the files? Because We maybe add all words in one file.

    I bought BWF and try DemoSync and DemoAsync.
    I find some issues.

    if BadWordManager.Instance.SimpleCheck == false
    三八 => Bad words found!
    三八1 => No bad words found!

    sh*t => Bad words found!
    sh*t1 => Bad words found!

    if BadWordManager.Instance.SimpleCheck == true
    三八 => Bad words found!
    三八1 => Bad words found!

    sh*t => No bad words found!
    sh*t1 => No bad words found!

    So I need to check SimpleCheck is true and false twice.
    If I use BWFManager.Instance.GetAll, it's simple to use.
    But If I use BWFManager.Instance.GetAllAsync, it's a little complex to use.

    Can you add functions like these?
    This way I can handle it all in one function.
    public IEnumerator GetAllAsync(string text, Model.Enum.ManagerMask mask = Model.Enum.ManagerMask.All, params string[] sourceNames, System.Action<string originaltext, System.Collections.Generic.List<string> badwords> OnGetObjectAction = null)

    public IEnumerator ReplaceAllAsync(string text, Model.Enum.ManagerMask mask = Model.Enum.ManagerMask.All, params string[] sourceNames, System.Action<string originaltext, string cleantext> OnGetObjectAction = null)
     
    Last edited: Aug 25, 2022
  46. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Currently, BWF simply loads those files at startup. We will add some improvements in the future, like persisting the downloaded files and maybe even a check for updated content, but I can't give you an ETA.

    About the "SimpleCheck": you've got it right, SimpleCheck should be true for non-Latin languages and vice versa.
    Therefore, you have to call it twice, but we will add a new parameter called "doAllChecks" for all methods. If this parameter is set to true, it will check both variants for you and return the result - so you don't have to bother anymore.
    This is planned for the next release - would that be helpful?
     
    Timmy-Hsu likes this.
  47. Timmy-Hsu

    Timmy-Hsu

    Joined:
    Aug 27, 2015
    Posts:
    51
    Thanks for add doAllChecks ️feature.
    It will more simpler to use.

    1.If BadWordFilter Data's URL and Resource in Settings, both set value, How will it work?
    2.If BadWordFilter Data has two same word, will the duplicate be removed?
    3.About _CTHelper object (CTHelper) , It will auto spawned the object at startup, even if the scene did not have BWF object, Is it possible to solve this situation?
    Like this.
    Snipaste_2022-08-26_10-42-18.jpg
     
  48. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Here are the answers:
    1. It loads Resources and/or URLs. E.g. you could have a list of general bad words in the Resources and use the URL to add new words
    2. Currently, it will load all bad words without removing duplicates (but this is a good input and we consider adding the function in a future release)
    3. CTHelper is not interfering with your app and is used to provide working singletons in the Editor. However, if you don't want it, just remove the class
     
    Timmy-Hsu likes this.
  49. Timmy-Hsu

    Timmy-Hsu

    Joined:
    Aug 27, 2015
    Posts:
    51
    Hi,

    About CapitalizationFilter and PunctuationFilter,
    seems the allowed length minimum is 1.
    Could you adjust the minimum setting to 0?

    If has any Punctuation or Capitalization, then it has bad words.
     
  50. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Ok, we will add this in the next release.
     
    Timmy-Hsu likes this.