Manager for for bad words. More...

Inheritance diagram for Crosstales.BWF.Manager.BadWordManager:
Crosstales.BWF.Manager.BaseManager< BadWordManager, BadWordFilter >

Public Member Functions

void Load ()
 Loads the current filter with all settings from this object. More...
 
bool Contains (string text, params string[] sourceNames)
 Searches for bad words in a text. More...
 
void ContainsAsync (string text, params string[] sourceNames)
 Searches asynchronously for bad words in a text. Use the "OnContainsComplete"-callback to get the result. More...
 
System.Collections.Generic.List< string > GetAll (string text, params string[] sourceNames)
 Searches for bad words in a text. More...
 
void GetAllAsync (string text, params string[] sourceNames)
 Searches asynchronously for bad words in a text. Use the "OnGetAllComplete"-callback to get the result. More...
 
string ReplaceAll (string text, bool markOnly=false, string prefix="", string postfix="", params string[] sourceNames)
 Searches and replaces all bad words in a text. More...
 
void ReplaceAllAsync (string text, bool markOnly=false, string prefix="", string postfix="", params string[] sourceNames)
 Searches and replaces asynchronously all bad words in a text. Use the "OnReplaceAllComplete"-callback to get the result. More...
 
string Mark (string text, bool replace=false, string prefix="<b><color=red>", string postfix="</color></b>", params string[] sourceNames)
 Marks the text with a prefix and postfix. More...
 
- Public Member Functions inherited from Crosstales.BWF.Manager.BaseManager< BadWordManager, BadWordFilter >
string Unmark (string text, string prefix="<b><color=red>", string postfix="</color></b>")
 Unmarks the text with a prefix and postfix. More...
 

Static Public Member Functions

static void ResetObject ()
 Resets this object. More...
 

Public Attributes

string removeChars
 Remove unnecessary characters from the input string. More...
 
Crosstales.BWF.OnContainsCompleted OnContainsCompleted
 
Crosstales.BWF.OnGetAllCompleted OnGetAllCompleted
 
Crosstales.BWF.OnReplaceAllCompleted OnReplaceAllCompleted
 
System.Collections.Generic.List< Crosstales.BWF.Data.SourceSources => _filter?.Sources
 Returns all sources for the manager. More...
 
int TotalRegexCount => Sources.Sum(src => src.RegexCount)
 Total number of Regex. More...
 
- Public Attributes inherited from Crosstales.BWF.Manager.BaseManager< BadWordManager, BadWordFilter >
bool isReady
 Checks the readiness status of the manager. More...
 

Protected Member Functions

override void Awake ()
 
override void OnApplicationQuit ()
 
- Protected Member Functions inherited from Crosstales.BWF.Manager.BaseManager< BadWordManager, BadWordFilter >
void onContainsComplete (string text, bool result)
 
void onGetAllComplete (string text, System.Collections.Generic.List< string > badWords)
 
void onReplaceAllComplete (string originalText, string cleanText)
 

Protected Attributes

override Crosstales.BWF.OnContainsCompleted onContainsCompleted => OnContainsCompleted
 
override Crosstales.BWF.OnGetAllCompleted onGetAllCompleted => OnGetAllCompleted
 
override Crosstales.BWF.OnReplaceAllCompleted onReplaceAllCompleted => OnReplaceAllCompleted
 
- Protected Attributes inherited from Crosstales.BWF.Manager.BaseManager< BadWordManager, BadWordFilter >
_filter
 

Properties

string??? ReplaceChars [get, set]
 Replace characters for bad words. More...
 
ReplaceMode??? Mode [get, set]
 Replace mode operations on the input string. More...
 
bool??? RemoveSpaces [get, set]
 Remove unnecessary spaces between letters in the input string. More...
 
int??? MaxTextLength [get, set]
 Maximal text length for the space detection. More...
 
string??? RemoveChars [get, set]
 Remove unnecessary characters from the input string. More...
 
bool??? SimpleCheck [get, set]
 Use simple detection algorithm. This is the way to check for Chinese, Japanese, Korean and Thai bad words. More...
 
System.Collections.Generic.List< BadWordProviderBadWordProviderLTR [get, set]
 List of all left-to-right providers. More...
 
System.Collections.Generic.List< BadWordProviderBadWordProviderRTL [get, set]
 List of all right-to-left providers. More...
 
- Properties inherited from Crosstales.BWF.Manager.BaseManager< BadWordManager, BadWordFilter >
bool DisableOrdering [get, set]
 
abstract OnContainsCompleted onContainsCompleted [get]
 
abstract OnGetAllCompleted onGetAllCompleted [get]
 
abstract OnReplaceAllCompleted onReplaceAllCompleted [get]
 

Additional Inherited Members

- Events inherited from Crosstales.BWF.Manager.BaseManager< BadWordManager, BadWordFilter >
ContainsComplete OnContainsComplete
 An event triggered whenever the "Contains"-operation is completed. More...
 
GetAllComplete OnGetAllComplete
 An event triggered whenever the "GetAll"-operation is completed. More...
 
ReplaceAllComplete OnReplaceAllComplete
 An event triggered whenever the "ReplaceAll"-operation is completed. More...
 

Detailed Description

Manager for for bad words.

Member Function Documentation

◆ Contains()

bool Crosstales.BWF.Manager.BadWordManager.Contains ( string  text,
params string[]  sourceNames 
)

Searches for bad words in a text.

Parameters
textText to check
sourceNamesRelevant sources (e.g. "english", optional)
Returns
True if a match was found

◆ ContainsAsync()

void Crosstales.BWF.Manager.BadWordManager.ContainsAsync ( string  text,
params string[]  sourceNames 
)

Searches asynchronously for bad words in a text. Use the "OnContainsComplete"-callback to get the result.

Parameters
textText to check
sourceNamesRelevant sources (e.g. "english", optional)

◆ GetAll()

System.Collections.Generic.List<string> Crosstales.BWF.Manager.BadWordManager.GetAll ( string  text,
params string[]  sourceNames 
)

Searches for bad words in a text.

Parameters
textText to check
sourceNamesRelevant sources (e.g. "english", optional)
Returns
List with all the matches

◆ GetAllAsync()

void Crosstales.BWF.Manager.BadWordManager.GetAllAsync ( string  text,
params string[]  sourceNames 
)

Searches asynchronously for bad words in a text. Use the "OnGetAllComplete"-callback to get the result.

Parameters
textText to check
sourceNamesRelevant sources (e.g. "english", optional)

◆ Load()

void Crosstales.BWF.Manager.BadWordManager.Load ( )

Loads the current filter with all settings from this object.

◆ Mark()

string Crosstales.BWF.Manager.BadWordManager.Mark ( string  text,
bool  replace = false,
string  prefix = "<b><color=red>",
string  postfix = "</color></b>",
params string[]  sourceNames 
)

Marks the text with a prefix and postfix.

Parameters
textText containing bad words
replaceReplace the bad words (default: false, optional)
prefixPrefix for every found bad word (default: bold and red, optional)
postfixPostfix for every found bad word (default: bold and red, optional)
sourceNamesRelevant sources (e.g. "english", optional)
Returns
Text with marked domains

◆ ReplaceAll()

string Crosstales.BWF.Manager.BadWordManager.ReplaceAll ( string  text,
bool  markOnly = false,
string  prefix = "",
string  postfix = "",
params string[]  sourceNames 
)

Searches and replaces all bad words in a text.

Parameters
textText to check
markOnlyOnly mark the words (default: false, optional)
prefixPrefix for every found bad word (optional)
postfixPostfix for every found bad word (optional)
sourceNamesRelevant sources (e.g. "english", optional)
Returns
Clean text

◆ ReplaceAllAsync()

void Crosstales.BWF.Manager.BadWordManager.ReplaceAllAsync ( string  text,
bool  markOnly = false,
string  prefix = "",
string  postfix = "",
params string[]  sourceNames 
)

Searches and replaces asynchronously all bad words in a text. Use the "OnReplaceAllComplete"-callback to get the result.

Parameters
textText to check
markOnlyOnly mark the words (default: false, optional)
prefixPrefix for every found bad word (optional)
postfixPostfix for every found bad word (optional)
sourceNamesRelevant sources (e.g. "english", optional)

◆ ResetObject()

static void Crosstales.BWF.Manager.BadWordManager.ResetObject ( )
static

Resets this object.

Member Data Documentation

◆ removeChars

string Crosstales.BWF.Manager.BadWordManager.removeChars

Remove unnecessary characters from the input string.

◆ Sources

System.Collections.Generic.List<Crosstales.BWF.Data.Source> Crosstales.BWF.Manager.BadWordManager.Sources => _filter?.Sources

Returns all sources for the manager.

Returns
List with all sources for the manager

◆ TotalRegexCount

int Crosstales.BWF.Manager.BadWordManager.TotalRegexCount => Sources.Sum(src => src.RegexCount)

Total number of Regex.

Returns
Total number of Regex.

Property Documentation

◆ BadWordProviderLTR

System.Collections.Generic.List<BadWordProvider> Crosstales.BWF.Manager.BadWordManager.BadWordProviderLTR
getset

List of all left-to-right providers.

◆ BadWordProviderRTL

System.Collections.Generic.List<BadWordProvider> Crosstales.BWF.Manager.BadWordManager.BadWordProviderRTL
getset

List of all right-to-left providers.

◆ MaxTextLength

int??? Crosstales.BWF.Manager.BadWordManager.MaxTextLength
getset

Maximal text length for the space detection.

◆ Mode

ReplaceMode??? Crosstales.BWF.Manager.BadWordManager.Mode
getset

Replace mode operations on the input string.

◆ RemoveChars

string??? Crosstales.BWF.Manager.BadWordManager.RemoveChars
getsetremove

Remove unnecessary characters from the input string.

◆ RemoveSpaces

bool??? Crosstales.BWF.Manager.BadWordManager.RemoveSpaces
getsetremove

Remove unnecessary spaces between letters in the input string.

◆ ReplaceChars

string??? Crosstales.BWF.Manager.BadWordManager.ReplaceChars
getset

Replace characters for bad words.

◆ SimpleCheck

bool??? Crosstales.BWF.Manager.BadWordManager.SimpleCheck
getset

Use simple detection algorithm. This is the way to check for Chinese, Japanese, Korean and Thai bad words.


The documentation for this class was generated from the following file:
  • C:/Users/slaub/Unity/assets/BWFPro/BWFPro/Assets/Plugins/crosstales/BadWordFilter/Scripts/Manager/BadWordManager.cs