PhoneticFlow 1.0.1
See the version list below for details.
dotnet add package PhoneticFlow --version 1.0.1
NuGet\Install-Package PhoneticFlow -Version 1.0.1
<PackageReference Include="PhoneticFlow" Version="1.0.1" />
<PackageVersion Include="PhoneticFlow" Version="1.0.1" />
<PackageReference Include="PhoneticFlow" />
paket add PhoneticFlow --version 1.0.1
#r "nuget: PhoneticFlow, 1.0.1"
#:package PhoneticFlow@1.0.1
#addin nuget:?package=PhoneticFlow&version=1.0.1
#tool nuget:?package=PhoneticFlow&version=1.0.1
PhoneticFlow
PhoneticFlow is a dependency-free .NET 10 (C#) library that converts traditional
English spelling into Lytspel, a simplified phonetic spelling system for
English (https://lytspel.org). It is a clean-room port of
Lytspel (Python/Perl/Haskell) to C#,
reusing its dictionary data and core conversion algorithm under the terms of
the original ISC license (see LICENSE.txt).
"Hello world. This is a simple example of phonetic English spelling."
->
"Heló wurld. Thiss is a simpl egzampl ov fonetic Inglish speling."
Project layout
src/
├── PhoneticFlow.slnx Solution file
├── LICENSE.txt, README.md, .gitignore
├── PhoneticFlow/ Class library (the NuGet package)
│ └── data/phoneticflow-dict.csv
├── PhoneticFlow.Tests/ xUnit tests
└── PhoneticFlow.Sample/ Minimal console app demonstrating usage
All commands below are run from inside src/ (where PhoneticFlow.slnx lives).
Note:
PhoneticFlow/LICENSE.txtandPhoneticFlow/README.mdare copies of the files at the root ofsrc/, kept alongside the.csproj.dotnet packembeds them in the NuGet package; referencing files outside the project directory for this purpose has been observed to fail withNU5019on some SDK versions, so local copies are used instead. Keep both copies in sync when editing.
Installing
Once published, the package can be installed with:
dotnet add package PhoneticFlow
Usage
using PhoneticFlow;
var converter = new PhoneticConverter();
string result = converter.Convert("Hello world.");
// "Heló wurld."
PhoneticConverter is stateful (it tracks sentence boundaries across calls),
so create one instance per logical document/thread and reuse it as you convert
successive paragraphs. Call Reset() to clear sentence-boundary tracking when
starting an unrelated piece of text.
Looking up individual words
var dict = PhoneticDictionary.Shared;
string? converted = dict.Lookup("hello"); // "heló"
string? unknown = dict.Lookup("zzzznotaword"); // null
Custom part-of-speech resolution
Some words have more than one Lytspel spelling depending on their grammatical role — for example "abstract" (adjective/noun "ábstract" vs. verb "abstract"), or "I" (pronoun "Y" vs. other readings of "i"). The original Lytspel resolves this using NLP-based part-of-speech tagging (spaCy). PhoneticFlow does not bundle an NLP dependency; instead it uses a deterministic default — prefer the noun reading, then fall back through adjective/adverb/preposition/verb forms — which is documented as a known simplification.
If you have access to real POS tags (from your own NLP pipeline, or because you already know the grammatical role of specific words), you can plug in your own resolution strategy:
PosResolver preferVerb = (word, variants) =>
variants.TryGetValue("v", out var verbForm) ? verbForm : variants.Values.First();
var dict = new PhoneticDictionary(preferVerb);
var converter = new PhoneticConverter(dict);
Known limitations (v1)
- No part-of-speech tagging. Ambiguous words default to a deterministic
noun-first heuristic instead of true grammatical analysis (see above). The
most noticeable case is the pronoun "I", which the original Lytspel always
respells as "Y" but which PhoneticFlow may render as "I" unless you supply
a custom
PosResolver. - Plain text only. HTML and EPUB conversion (supported by the original Python tool) are not included in this version.
- No web component, by design — PhoneticFlow is a library only.
Building from source
cd src
dotnet build PhoneticFlow.slnx
dotnet test PhoneticFlow.slnx
dotnet run --project PhoneticFlow.Sample
Packing the NuGet package
dotnet pack PhoneticFlow/PhoneticFlow.csproj -c Release -o ../artifacts
This produces PhoneticFlow.<version>.nupkg (and a .snupkg symbols
package) in ../artifacts, ready to push to NuGet.org or a private feed:
dotnet nuget push ../artifacts/PhoneticFlow.<version>.nupkg \
--api-key <YOUR_API_KEY> \
--source https://api.nuget.org/v3/index.json
Attribution
The phonetic dictionary (PhoneticFlow/data/phoneticflow-dict.csv,
~107,000 entries) and the core conversion algorithm are derived from the
Lytspel project by Christian Siefkes,
licensed under the ISC license. See LICENSE.txt for the full notice.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.