DavidGroup.Content.AntiProfanity
1.0.0
dotnet add package DavidGroup.Content.AntiProfanity --version 1.0.0
NuGet\Install-Package DavidGroup.Content.AntiProfanity -Version 1.0.0
<PackageReference Include="DavidGroup.Content.AntiProfanity" Version="1.0.0" />
<PackageVersion Include="DavidGroup.Content.AntiProfanity" Version="1.0.0" />
<PackageReference Include="DavidGroup.Content.AntiProfanity" />
paket add DavidGroup.Content.AntiProfanity --version 1.0.0
#r "nuget: DavidGroup.Content.AntiProfanity, 1.0.0"
#:package DavidGroup.Content.AntiProfanity@1.0.0
#addin nuget:?package=DavidGroup.Content.AntiProfanity&version=1.0.0
#tool nuget:?package=DavidGroup.Content.AntiProfanity&version=1.0.0
DavidGroup.Content.AntiProfanity
Detects profanity in text using predefined word lists in advanced JSON or simple TXT formats.
🚀 Getting Started
Install NuGet Package
Using the .NET CLI:
dotnet add package DavidGroup.Content.AntiProfanity
Or via the Package Manager Console:
Install-Package DavidGroup.Content.AntiProfanity
How to use it?
Feel free to explore the samples to find practical examples for each feature. New samples are added continuously as more features are developed.
📦 Key Features
Registration
Program.sc
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
builder.Services.AddAntiProfanity(builder.Configuration, Assembly.GetExecutingAssembly())
.AddHandler<ProfanityDetectionJsonHandler>()
.AddHandler<ProfanityDetectionTxtHandler>();
WebApplication app = builder.Build();
await app.Services.InitializeAntiProfanityDataSourcesAsync();
app.Run();
appsettings.json
{
"AntiProfanity": {
"DataSourcesBasePath": "Data/ProfanityDataSources",
"DataSources": [
"en.json",
"ru.txt"
]
}
}
Detection & Censoring
[ApiController]
[Route("api/[controller]")]
public class AntiProfanityController(IAntiProfanityService antiProfanityService) : ControllerBase
{
[HttpPost("detect")]
public async Task<IActionResult> Detect([FromBody] DetectionsRequestDto dto)
{
ReadOnlyCollection<ProfanityOccurrence> detections =
await antiProfanityService.DetectAsync(dto.Text, dto.SeverityLevel);
return Ok(detections);
}
[HttpPost("censor")]
public async Task<IActionResult> Censor([FromBody] CensorRequestDto dto)
{
string censored =
await antiProfanityService.CensorAsync(dto.Text, dto.SeverityLevel, dto.CensorChar);
return Ok(censored);
}
}
🤝 Contributing
Found a bug? Have an idea? Want to contribute?
- Submit an issue: https://github.com/david-group-solutions/anti-profanity/issues
- Create a pull request: https://github.com/david-group-solutions/anti-profanity/pulls
Contributions of any size are appreciated!
📝 License
Distributed under the MIT license. See License for more information.
Copyright © 2025-2026 David Khachatryan (David Group Solutions)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Options (>= 10.0.10)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.10)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.10)
- Scrutor (>= 7.0.0)
-
net8.0
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Options (>= 10.0.10)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.10)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.10)
- Scrutor (>= 7.0.0)
-
net9.0
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Options (>= 10.0.10)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.10)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.10)
- Scrutor (>= 7.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 128 | 7/24/2026 |
| 1.0.0-develop.2 | 67 | 7/24/2026 |