![]() |
BogaNet 1.4.0
|
Filter to remove bad words aka profanity. More...
Public Member Functions | |
| virtual bool | Remove (string srcName) |
| Removes a source and assigned data. | |
| virtual bool | ContainsSource (string srcName) |
| Checks if a given source name exists in the filter. | |
| virtual void | Clear () |
| Clears all sources. | |
| virtual void | Load (bool isLTR, Dictionary< string, string[]> dataDict) |
| Load sources from a given Dictionary. | |
| virtual bool | LoadFiles (bool isLTR, params Tuple< string, string >[] files) |
| Load source files (CSV) from a given path. | |
| virtual async Task< bool > | LoadFilesAsync (bool isLTR, params Tuple< string, string >[] files) |
| Load source files (CSV) from a given path asynchronously. | |
| virtual bool | LoadFilesFromUrl (bool isLTR, params Tuple< string, string >[] urls) |
| Load source files (CSV) from given URLs. | |
| virtual async Task< bool > | LoadFilesFromUrlAsync (bool isLTR, params Tuple< string, string >[] urls) |
| Load source files (CSV) from given URLs asynchronously. | |
| virtual void | Add (bool isLTR, string srcName, string[] words) |
| virtual bool | Contains (string text, params string[]? sourceNames) |
| Searches for bad words in a text. | |
| virtual List< string > | GetAll (string text, params string[]? sourceNames) |
| Searches for bad words in a text. | |
| virtual string | ReplaceAll (string text, params string[]? sourceNames) |
| Searches and replaces all bad words in a text. | |
Public Member Functions inherited from BogaNet.BWF.Filter.IBadWordFilter | |
| void | Add (bool isLTR, string srcName, params string[] words) |
| Adds a source with words. | |
Public Member Functions inherited from BogaNet.BWF.Filter.ISourceFilter | |
| delegate void | FilesLoaded (params Tuple< string, string >[] files) |
| Delegate for the load status of the files. | |
Protected Member Functions | |
| string | replaceText (string input) |
Static Protected Member Functions | |
| static void | logFilterNotReady () |
| static void | logSourceNotFound (string res) |
Static Protected Attributes | |
| const string | EXACT_REGEX_START = @"(?<![\w\d])" |
| const string | EXACT_REGEX_END = @"s?(?![\w\d])" |
| const RegexOptions | REGEX_IC = RegexOptions.IgnoreCase |
| const RegexOptions | REGEX_CI = RegexOptions.CultureInvariant |
| const RegexOptions | REGEX_COMPILED = RegexOptions.Compiled |
| const RegexOptions | REGEX_RTL = RegexOptions.RightToLeft |
| const RegexOptions | REGEX_NONE = RegexOptions.None |
Properties | |
| virtual int | Count [get] |
| Current count of sources from the filter. | |
| virtual List< string > | SourceNames [get] |
| All source names of the current filter. | |
| virtual bool | IsLoaded [get] |
| Is the filter loaded? | |
| virtual char[] | ReplaceCharacters = ['*'] [get, set] |
| Replace characters for bad words. | |
| virtual ReplaceMode | Mode = ReplaceMode.Default [get, set] |
| Replace mode operations on the input string. | |
| virtual bool | RemoveSpaces [get, set] |
| Remove unnecessary spaces between letters in the input string. | |
| virtual int | MaxTextLength = 3 [get, set] |
| Maximal text length for the space detection. | |
| virtual string | RemoveCharacters = string.Empty [get, set] |
| Remove unnecessary characters from the input string. | |
| virtual bool | SimpleCheck [get, set] |
| Use simple detection algorithm (e.g. for Chinese, Japanese, Korean, Thai etc.). | |
Properties inherited from BogaNet.Util.Singleton< BadWordFilter > | |
| static T | Instance [get] |
Properties inherited from BogaNet.BWF.Filter.IBadWordFilter | |
Properties inherited from BogaNet.BWF.Filter.ISourceFilter | |
Events | |
| ISourceFilter.? FilesLoaded | OnFilesLoaded |
Events inherited from BogaNet.BWF.Filter.ISourceFilter | |
| FilesLoaded | OnFilesLoaded |
| Event triggered whenever the files are loaded. | |
Filter to remove bad words aka profanity.
|
virtual |
|
virtual |
Clears all sources.
Implements BogaNet.BWF.Filter.ISourceFilter.
|
virtual |
Searches for bad words in a text.
| text | Text to check |
| sourceNames | Relevant sources (e.g. "english", optional) |
Implements BogaNet.BWF.Filter.IFilter.
|
virtual |
Checks if a given source name exists in the filter.
| srcName | Source name to check |
| ArgumentNullException |
Implements BogaNet.BWF.Filter.ISourceFilter.
|
virtual |
Searches for bad words in a text.
| text | Text to check |
| sourceNames | Relevant sources (e.g. "english", optional) |
Implements BogaNet.BWF.Filter.IFilter.
|
virtual |
Load sources from a given Dictionary.
| isLTR | Is source written left-to-right? |
| dataDict | Dictionary to load |
returns>True if the operation was successful
| Exception |
Implements BogaNet.BWF.Filter.IBadWordFilter.
|
virtual |
Load source files (CSV) from a given path.
| isLTR | Is source written left-to-right? |
| files | Files to load (Item1 = source name, Item2 = file) |
returns>True if the operation was successful
| Exception |
Implements BogaNet.BWF.Filter.IBadWordFilter.
|
virtual |
Load source files (CSV) from a given path asynchronously.
| isLTR | Is source written left-to-right? |
| files | Files to load (Item1 = source name, Item2 = file) |
returns>True if the operation was successful
| Exception |
Implements BogaNet.BWF.Filter.IBadWordFilter.
|
virtual |
Load source files (CSV) from given URLs.
| isLTR | Is source written left-to-right? |
| urls | URLs of files to load (Item1 = source name, Item2 = file) |
returns>True if the operation was successful
| Exception |
Implements BogaNet.BWF.Filter.IBadWordFilter.
|
virtual |
Load source files (CSV) from given URLs asynchronously.
| isLTR | Is source written left-to-right? |
| urls | URLs of files to load (Item1 = source name, Item2 = file) |
returns>True if the operation was successful
| Exception |
Implements BogaNet.BWF.Filter.IBadWordFilter.
|
staticprotected |
|
staticprotected |
|
virtual |
Removes a source and assigned data.
| srcName | Source name to remove |
returns>True if the operation was successful
| ArgumentNullException |
Implements BogaNet.BWF.Filter.ISourceFilter.
|
virtual |
Searches and replaces all bad words in a text.
| text | Text to check |
| sourceNames | Relevant sources (e.g. "english", optional) |
Implements BogaNet.BWF.Filter.IFilter.
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
get |
Current count of sources from the filter.
Implements BogaNet.BWF.Filter.ISourceFilter.
|
get |
Is the filter loaded?
Implements BogaNet.BWF.Filter.ISourceFilter.
|
getset |
Maximal text length for the space detection.
Implements BogaNet.BWF.Filter.IBadWordFilter.
|
getset |
Replace mode operations on the input string.
Implements BogaNet.BWF.Filter.IBadWordFilter.
|
getset |
Remove unnecessary characters from the input string.
Implements BogaNet.BWF.Filter.IBadWordFilter.
|
getset |
Remove unnecessary spaces between letters in the input string.
Implements BogaNet.BWF.Filter.IBadWordFilter.
|
getset |
Replace characters for bad words.
Implements BogaNet.BWF.Filter.IBadWordFilter.
|
getset |
Use simple detection algorithm (e.g. for Chinese, Japanese, Korean, Thai etc.).
Implements BogaNet.BWF.Filter.IBadWordFilter.
|
get |
All source names of the current filter.
Implements BogaNet.BWF.Filter.ISourceFilter.
| ISourceFilter.? FilesLoaded BogaNet.BWF.Filter.BadWordFilter.OnFilesLoaded |