Agash.TTSTextNormalization
0.3.0
dotnet add package Agash.TTSTextNormalization --version 0.3.0
NuGet\Install-Package Agash.TTSTextNormalization -Version 0.3.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Agash.TTSTextNormalization" Version="0.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Agash.TTSTextNormalization" Version="0.3.0" />
<PackageReference Include="Agash.TTSTextNormalization" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Agash.TTSTextNormalization --version 0.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Agash.TTSTextNormalization, 0.3.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Agash.TTSTextNormalization@0.3.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Agash.TTSTextNormalization&version=0.3.0
#tool nuget:?package=Agash.TTSTextNormalization&version=0.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
TTSTextNormalization
.NET library for normalizing user-generated text before Text-to-Speech playback (chat, donations, comments, alerts), so engines pronounce content more consistently.
Targets
net10.0(primary)net9.0
Install
dotnet add package Agash.TTSTextNormalization
What You Get
- Emoji normalization (including ZWJ sequences and flags)
- Currency normalization (
$10.50,EUR 100, etc.) to spoken forms - Number normalization (cardinal, ordinal, decimal, multi-dot/version-style)
- URL replacement via configurable placeholder text
- Abbreviation expansion for common chat/gaming terms (
lol,brb,gg, ...) - Basic sanitization of control chars and punctuation variants
- Cleanup for excessive punctuation and repeated letters
- Final whitespace and punctuation spacing normalization
- DI-first, ordered pipeline via
ITextNormalizationRule
Quick Start (DI)
using Microsoft.Extensions.DependencyInjection;
using TTSTextNormalization.Abstractions;
using TTSTextNormalization.DependencyInjection;
using TTSTextNormalization.Rules;
ServiceCollection services = new();
services.Configure<UrlRuleOptions>(o => o.PlaceholderText = " website link ");
services.Configure<EmojiRuleOptions>(o => o.Suffix = "emoji");
services.AddTextNormalization(builder =>
{
builder.AddBasicSanitizationRule();
builder.AddEmojiRule();
builder.AddCurrencyRule();
builder.AddAbbreviationNormalizationRule();
builder.AddNumberNormalizationRule();
builder.AddExcessivePunctuationRule();
builder.AddLetterRepetitionRule();
builder.AddUrlNormalizationRule();
builder.AddWhitespaceNormalizationRule();
});
ServiceProvider provider = services.BuildServiceProvider();
ITextNormalizer normalizer = provider.GetRequiredService<ITextNormalizer>();
string input = "OMG!!! that stream was 🔥🔥🔥 $10.50 www.example.com";
string output = normalizer.Normalize(input);
Notes
- This library normalizes text only. It does not provide TTS playback itself.
- Rule ordering is configurable; defaults are designed for chat-like inputs.
Build
dotnet restore
dotnet build -c Release
dotnet test -c Release
Contributing
PRs are welcome. If behavior changes, include tests in TTSTextNormalization.Tests.
License
MIT. See LICENSE.txt.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Humanizer.Core (>= 3.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Options (>= 10.0.3)
-
net9.0
- Humanizer.Core (>= 3.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Options (>= 10.0.3)
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 |
|---|---|---|
| 0.3.0 | 68 | 2/24/2026 |
| 0.2.1 | 301 | 4/18/2025 |
| 0.1.1 | 229 | 4/18/2025 |
| 0.1.0 | 254 | 4/17/2025 |
| 0.0.0-alpha.0.2 | 204 | 4/17/2025 |