MackySoft.Text.Vocabularies 0.1.0

dotnet add package MackySoft.Text.Vocabularies --version 0.1.0
                    
NuGet\Install-Package MackySoft.Text.Vocabularies -Version 0.1.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="MackySoft.Text.Vocabularies" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MackySoft.Text.Vocabularies" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="MackySoft.Text.Vocabularies" />
                    
Project file
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 MackySoft.Text.Vocabularies --version 0.1.0
                    
#r "nuget: MackySoft.Text.Vocabularies, 0.1.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 MackySoft.Text.Vocabularies@0.1.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=MackySoft.Text.Vocabularies&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=MackySoft.Text.Vocabularies&version=0.1.0
                    
Install as a Cake Tool

MackySoft.Text.Vocabularies

NuGet License: MIT

MackySoft.Text.Vocabularies defines finite, typed vocabularies whose values map one-to-one to canonical text.

The package targets netstandard2.1 and does not depend on System.Text.Json. It is suitable for protocol literals, configuration values, and other machine-readable closed sets that need one exact text for each declared value.

Installation

Install a pinned version from nuget.org:

dotnet add package MackySoft.Text.Vocabularies --version <version>

Define and Resolve a Vocabulary

using MackySoft.Text.Vocabularies;

[VocabularyDefinition]
public enum DeploymentMode
{
    [VocabularyText("safe")]
    Safe,

    [VocabularyText("advanced")]
    Advanced,
}

string text = Vocabulary.GetText(DeploymentMode.Safe);

if (Vocabulary.TryGetValue("advanced", out DeploymentMode mode))
{
    Console.WriteLine(mode);
}

foreach (VocabularyEntry<DeploymentMode> entry in Vocabulary.GetEntries<DeploymentMode>())
{
    Console.WriteLine($"{entry.Text}: {entry.Value}");
}

Resolution uses ordinal comparison. The package does not trim input, ignore case, resolve aliases, or normalize Unicode.

Definition Guarantees

A vocabulary is validated on first use. Validation rejects definitions that:

  • have no declared members;
  • omit VocabularyTextAttribute from any member;
  • repeat a typed value or canonical text;
  • use empty, whitespace-only, leading-whitespace, or trailing-whitespace text.

Vocabulary.Validate(Type) validates a definition known only at runtime. Vocabulary.IsVocabulary(Type) discovers declared definitions and validates them without requiring a JSON adapter or another consumer to inspect member metadata.

Non-Goals

This package does not provide descriptions, examples, JSON Schema, general text codecs, path rules, JSON canonicalization, or product-specific input policy.

For System.Text.Json string values and property names, use MackySoft.Text.Vocabularies.Json.

Repository and Support

Source, issues, and support are available in the MackySoft .NET Foundations repository.

License

This package is under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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 was computed.  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 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on MackySoft.Text.Vocabularies:

Package Downloads
MackySoft.Text.Vocabularies.Json

System.Text.Json adapters for finite typed text vocabularies.

MackySoft.JsonSchema.Generation

Product-independent JSON Contract Model, JSON Schema Draft 2020-12, and type metadata generation for .NET.

MackySoft.Ucli.Contracts

Shared contract types for uCLI IPC protocol.

MackySoft.Ucli.Unity

Unity Editor plugin for uCLI IPC and automation.

MackySoft.AgentDistribution

Reusable .NET services for building, distributing, installing, exporting, and diagnosing skills and custom-agent artifacts.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 4,797 7/24/2026