![]() |
BogaNet 1.4.0
|
Filter to remove domains (urls/emails etc.). 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 (Dictionary< string, string[]> dataDict) |
| Load sources from a given Dictionary. | |
| virtual bool | LoadFiles (params Tuple< string, string >[] files) |
| Load source files (CSV) from a given path. | |
| virtual async Task< bool > | LoadFilesAsync (params Tuple< string, string >[] files) |
| Load source files (CSV) from a given path asynchronously. | |
| virtual bool | LoadFilesFromUrl (params Tuple< string, string >[] urls) |
| Load source files (CSV) from given URLs. | |
| virtual async Task< bool > | LoadFilesFromUrlAsync (params Tuple< string, string >[] urls) |
| Load source files (CSV) from given URLs asynchronously. | |
| virtual void | Add (string srcName, params string[] domains) |
| Adds a source with domains. | |
| 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.ISourceFilter | |
| delegate void | FilesLoaded (params Tuple< string, string >[] files) |
| Delegate for the load status of the files. | |
Static Protected Member Functions | |
| static void | logFilterNotReady () |
| static void | logSourceNotFound (string res) |
Static Protected Attributes | |
| const string | DOMAIN_REGEX_START = @"\b{0,1}((ht|f)tp(s?)\:\/\/)?[\w\-\.\@]*[\.]" |
| const string | DOMAIN_REGEX_END = @"(:\d{1,5})?(\/|\b)" |
| const RegexOptions | REGEX_IC = RegexOptions.IgnoreCase |
| const RegexOptions | REGEX_CI = RegexOptions.CultureInvariant |
| const RegexOptions | REGEX_COMPILED = RegexOptions.Compiled |
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 domains. | |
Properties inherited from BogaNet.Util.Singleton< DomainFilter > | |
| static T | Instance [get] |
Properties inherited from BogaNet.BWF.Filter.IDomainFilter | |
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 domains (urls/emails etc.).
|
virtual |
Adds a source with domains.
| srcName | Source name |
| domains | Domains for the source |
| ArgumentNullException |
Implements BogaNet.BWF.Filter.IDomainFilter.
|
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.
| dataDict | Dictionary to load |
returns>True if the operation was successful
| Exception |
Implements BogaNet.BWF.Filter.IDomainFilter.
|
virtual |
Load source files (CSV) from a given path.
| files | Files to load (Item1 = source name, Item2 = file) |
returns>True if the operation was successful
| Exception |
Implements BogaNet.BWF.Filter.IDomainFilter.
|
virtual |
Load source files (CSV) from a given path asynchronously.
| files | Files to load (Item1 = source name, Item2 = file) |
returns>True if the operation was successful
| Exception |
Implements BogaNet.BWF.Filter.IDomainFilter.
|
virtual |
Load source files (CSV) from given URLs.
| urls | URLs of files to load (Item1 = source name, Item2 = file) |
returns>True if the operation was successful
| Exception |
Implements BogaNet.BWF.Filter.IDomainFilter.
|
virtual |
Load source files (CSV) from given URLs asynchronously.
| urls | URLs of files to load (Item1 = source name, Item2 = file) |
returns>True if the operation was successful
| Exception |
Implements BogaNet.BWF.Filter.IDomainFilter.
|
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.
|
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 |
Replace characters for domains.
Implements BogaNet.BWF.Filter.IDomainFilter.
|
get |
All source names of the current filter.
Implements BogaNet.BWF.Filter.ISourceFilter.
| ISourceFilter.? FilesLoaded BogaNet.BWF.Filter.DomainFilter.OnFilesLoaded |