Base class for all filters. More...
Public Member Functions | |
BaseFilter (bool disableOrdering) | |
Instantiate the class. More... | |
abstract bool | Contains (string text, params string[] sourceNames) |
Searches for bad words in a text. More... | |
abstract System.Collections.Generic.List< string > | GetAll (string text, params string[] sourceNames) |
Searches for bad words in a text. More... | |
abstract string | ReplaceAll (string text, bool markOnly=false, string prefix="", string postfix="", params string[] sourceNames) |
Searches and replaces all bad words in a text. 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... | |
Public Attributes | |
bool | DisableOrdering |
Static Protected Member Functions | |
static void | logFilterNotReady () |
static void | logResourceNotFound (string res) |
static void | logContains () |
static void | logGetAll () |
static void | logReplaceAll () |
Protected Attributes | |
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>() |
Properties | |
virtual System.Collections.Generic.List< Source > | Sources [get] |
abstract bool | isReady [get] |
Properties inherited from Crosstales.BWF.Filter.IFilter | |
System.Collections.Generic.List< Crosstales.BWF.Data.Source > | Sources [get] |
All sources of the current filter. More... | |
bool | isReady [get] |
Checks the readiness status of the current filter. More... | |
Detailed Description
Base class for all filters.
Constructor & Destructor Documentation
◆ BaseFilter()
Crosstales.BWF.Filter.BaseFilter.BaseFilter | ( | bool | disableOrdering | ) |
Instantiate the class.
- Parameters
-
disableOrdering Disables the ordering of the 'GetAll'-method (prevent possible memory garbage).
Member Function Documentation
◆ Contains()
|
pure 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.IFilter.
Implemented in Crosstales.BWF.Filter.BadWordFilter, Crosstales.BWF.Filter.DomainFilter, Crosstales.BWF.Filter.CapitalizationFilter, and Crosstales.BWF.Filter.PunctuationFilter.
◆ GetAll()
|
pure 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.IFilter.
Implemented in Crosstales.BWF.Filter.BadWordFilter, Crosstales.BWF.Filter.DomainFilter, Crosstales.BWF.Filter.CapitalizationFilter, and Crosstales.BWF.Filter.PunctuationFilter.
◆ Mark()
|
virtual |
Marks the text with a prefix and postfix.
- Parameters
-
text Text containing bad words replace Replace the bad words (default: false, optional) prefix Prefix for every found bad word (default: bold and red, optional) postfix Postfix for every found bad word (default: bold and red, optional) sourceNames Relevant sources (e.g. "english", optional)
- Returns
- Text with marked domains
Implements Crosstales.BWF.Filter.IFilter.
◆ ReplaceAll()
|
pure 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.IFilter.
Implemented in Crosstales.BWF.Filter.BadWordFilter, Crosstales.BWF.Filter.DomainFilter, Crosstales.BWF.Filter.PunctuationFilter, and Crosstales.BWF.Filter.CapitalizationFilter.
◆ Unmark()
|
virtual |
Unmarks the text with a prefix and postfix.
- Parameters
-
text Text with marked bad words prefix Prefix for every found bad word (optional) postfix Postfix for every found bad word (optional)
- Returns
- Text with marked bad words
Implements Crosstales.BWF.Filter.IFilter.
The documentation for this class was generated from the following file:
- C:/Users/slaub/Unity/assets/BWFPro/BWFPro/Assets/Plugins/crosstales/BadWordFilter/Scripts/Filter/BaseFilter.cs