Filter for bad words. The class can also replace all bad words inside a string.
More...
|
| BadWordFilter (System.Collections.Generic.List< BadWordProvider > badWordProviderLTR, System.Collections.Generic.List< BadWordProvider > badWordProviderRTL, string replaceCharacters="*", ReplaceMode mode=ReplaceMode.Default, bool simpleCheck=false, bool removeSpaces=false, bool disableOrdering=false, string removeCharacters="") |
| Instantiate the class. More...
|
|
override bool | Contains (string text, params string[] sourceNames) |
| Searches for bad words in a text. More...
|
|
override System.Collections.Generic.List< string > | GetAll (string text, params string[] sourceNames) |
| Searches for bad words in a text. More...
|
|
override string | ReplaceAll (string text, bool markOnly=false, string prefix="", string postfix="", params string[] sourceNames) |
| Searches and replaces all bad words in a text. More...
|
|
| BaseFilter (bool disableOrdering) |
| Instantiate the class. More...
|
|
virtual string | Unmark (string text, string prefix="<b><color=red>", string postfix="</color></b>") |
| Unmarks the text with a prefix and postfix. More...
|
|
virtual 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...
|
|
|
string | replaceText (string input) |
|
|
static void | logFilterNotReady () |
|
static void | logResourceNotFound (string res) |
|
static void | logContains () |
|
static void | logGetAll () |
|
static void | logReplaceAll () |
|
readonly System.Collections.Generic.Dictionary< string, Source > | _sources = new System.Collections.Generic.Dictionary<string, Source>() |
|
readonly System.Collections.Generic.List< string > | _getAllResult = new System.Collections.Generic.List<string>() |
|
Filter for bad words. The class can also replace all bad words inside a string.
◆ BadWordFilter()
Crosstales.BWF.Filter.BadWordFilter.BadWordFilter |
( |
System.Collections.Generic.List< BadWordProvider > |
badWordProviderLTR, |
|
|
System.Collections.Generic.List< BadWordProvider > |
badWordProviderRTL, |
|
|
string |
replaceCharacters = "*" , |
|
|
ReplaceMode |
mode = ReplaceMode.Default , |
|
|
bool |
simpleCheck = false , |
|
|
bool |
removeSpaces = false , |
|
|
bool |
disableOrdering = false , |
|
|
string |
removeCharacters = "" |
|
) |
| |
Instantiate the class.
- Parameters
-
badWordProviderLTR | List of all left-to-right providers. |
badWordProviderRTL | List of all right-to-left providers. |
replaceCharacters | Replace characters for bad words (default: *, optional). |
mode | Replace mode operations on the input string (default: Default, optional). |
simpleCheck | Use simple detection algorithm (default: false, optional). |
removeSpaces | Remove unnecessary spaces between letters in the input string (default: false, optional). |
disableOrdering | Disables the ordering of the 'GetAll'-method (default: false, optional). |
removeCharacters | Remove unnecessary characters from the input string (default: empty, optional). |
◆ Contains()
override bool Crosstales.BWF.Filter.BadWordFilter.Contains |
( |
string |
text, |
|
|
params string[] |
sourceNames |
|
) |
| |
|
virtual |
Searches for bad words in a text.
- Parameters
-
text | Text to check |
sourceNames | Relevant sources (e.g. "english", optional) |
- Returns
- True if a match was found
Implements Crosstales.BWF.Filter.BaseFilter.
◆ GetAll()
override System.Collections.Generic.List<string> Crosstales.BWF.Filter.BadWordFilter.GetAll |
( |
string |
text, |
|
|
params string[] |
sourceNames |
|
) |
| |
|
virtual |
Searches for bad words in a text.
- Parameters
-
text | Text to check |
sourceNames | Relevant sources (e.g. "english", optional) |
- Returns
- List with all the matches
Implements Crosstales.BWF.Filter.BaseFilter.
◆ ReplaceAll()
override string Crosstales.BWF.Filter.BadWordFilter.ReplaceAll |
( |
string |
text, |
|
|
bool |
markOnly = false , |
|
|
string |
prefix = "" , |
|
|
string |
postfix = "" , |
|
|
params string[] |
sourceNames |
|
) |
| |
|
virtual |
Searches and replaces all bad words in a text.
- Parameters
-
text | Text to check |
markOnly | Only mark the words (default: false, optional) |
prefix | Prefix for every found bad word (optional) |
postfix | Postfix for every found bad word (optional) |
sourceNames | Relevant sources (e.g. "english", optional) |
- Returns
- Clean text
Implements Crosstales.BWF.Filter.BaseFilter.
◆ MaxTextLength
int Crosstales.BWF.Filter.BadWordFilter.MaxTextLength = 3 |
Maximal text length for the space detection.
◆ Mode
Replace mode operations on the input string.
◆ RemoveCharacters
string Crosstales.BWF.Filter.BadWordFilter.RemoveCharacters |
Remove unnecessary characters from the input string.
◆ RemoveSpaces
bool Crosstales.BWF.Filter.BadWordFilter.RemoveSpaces |
Remove unnecessary spaces between letters in the input string.
◆ ReplaceCharacters
string Crosstales.BWF.Filter.BadWordFilter.ReplaceCharacters |
Replace characters for bad words.
◆ SimpleCheck
bool Crosstales.BWF.Filter.BadWordFilter.SimpleCheck |
Use simple detection algorithm.
◆ BadWordProviderLTR
System.Collections.Generic.List<BadWordProvider>? Crosstales.BWF.Filter.BadWordFilter.BadWordProviderLTR |
|
getset |
List of all left-to-right providers.
- Returns
- All left-to-right providers.
◆ BadWordProviderRTL
System.Collections.Generic.List<BadWordProvider>? Crosstales.BWF.Filter.BadWordFilter.BadWordProviderRTL |
|
getset |
List of all right-to-left providers.
- Returns
- All right-to-left providers.
◆ isReady
override bool?? Crosstales.BWF.Filter.BadWordFilter.isReady |
|
get |
Checks the readiness status of the filter.
- Returns
- True if the filter is ready.
The documentation for this class was generated from the following file:
- C:/Users/slaub/Unity/assets/BWFPro/BWFPro/Assets/Plugins/crosstales/BadWordFilter/Scripts/Filter/BadWordFilter.cs