Kaz.Operations.Text.Tokenizing 1.0.0

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

Kaz.Operations.Text.RegularExpressions

About

This library extends the Kaz.Operations.Text possibilities by adding a tokenizer class. This library targets .NET 8 and .NET Framework 4.7.2.

Features

  • Adds a tokenizer class.
  • Adds a fluent API builder to configure and build the tokenizer class.

How to use

using System;
using Kaz.Operations.Text.Tokenizing;

class Program 
{
	enum Tokens
	{
		String,
		Number,
		Boolean
	}

	static void Main(string[] args)
	{
		var builder = new TokenizerBuilder<Tokens>();

		builder.AddRule("Hello", Tokens.String) // Adds a rule for matching patterns
			   .AddRule("123", Tokens.Number)
			   .AddRule("true", Tokens.Boolean);
		
		var tokenizer = builder.Build(); // Returns a new tokenizer class instance

		string text = "Hello 123 true";
		var tokens = tokenizer.Tokenize(text); // Returns all matched tokens

		foreach (var token in tokens)
		{
			Console.WriteLine(token.ToString());
		}
	}
}

Main Classes & Structures

The main classes are:

  • TokenizerBuilder
  • Tokenizer

The main structures are:

  • Token

Licence

Kaz.Operations.Text.Tokenizing is released as an open source project under the MIT Licence.

Feedback & Contributing

You can report a bug or contribute at the GitHub repository.

Product 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 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 Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.7.2

  • net8.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.

Version Downloads Last Updated
1.0.0 132 6/21/2026