Taurit.Libraries.NaturalLanguageTimespanParser 0.0.6-beta

This is a prerelease version of Taurit.Libraries.NaturalLanguageTimespanParser.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Taurit.Libraries.NaturalLanguageTimespanParser --version 0.0.6-beta
NuGet\Install-Package Taurit.Libraries.NaturalLanguageTimespanParser -Version 0.0.6-beta
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="Taurit.Libraries.NaturalLanguageTimespanParser" Version="0.0.6-beta" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Taurit.Libraries.NaturalLanguageTimespanParser --version 0.0.6-beta
#r "nuget: Taurit.Libraries.NaturalLanguageTimespanParser, 0.0.6-beta"
#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.
// Install Taurit.Libraries.NaturalLanguageTimespanParser as a Cake Addin
#addin nuget:?package=Taurit.Libraries.NaturalLanguageTimespanParser&version=0.0.6-beta&prerelease

// Install Taurit.Libraries.NaturalLanguageTimespanParser as a Cake Tool
#tool nuget:?package=Taurit.Libraries.NaturalLanguageTimespanParser&version=0.0.6-beta&prerelease

Taurit.Libraries.NaturalLanguageTimespanParser

This library allows to convert a time span expressed in a natural language into the machine-friendly representation (eg. in seconds, minutes, hours).

I use it mostly with regard to my todo list, for example to collect stats about the total estimated time of tasks on my todo list.

Examples

var englishCulture = new CultureInfo("en");
var timespanParser = new TimespanParser(englishCulture);

// example 1
TimespanParseResult result1 = timespanParser.Parse("Review english lesson @home 20m");
// result1.Success == true
// result1.Duration == {00:20:00}

TimespanParseResult result2 = timespanParser.Parse("@home Read for 45 MINUTES");
// result2.Success == true
// result2.Duration == {00:45:00}

TimespanParseResult result3 = timespanParser.Parse("@home Read for seven minutes");
// result3.Success == true
// result3.Duration == {00:07:00}

TimespanParseResult result4 = timespanParser.Parse("Play drums (2h 30 Min) @home");
// result4.Success == true
// result4.Duration == {02:30:00}

More examples are available in unit tests files in the source 😃

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.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
0.1.0-beta 175 10/22/2023
0.0.6-beta 509 8/6/2022
0.0.5-beta 128 8/6/2022
0.0.4-beta 406 11/14/2021
0.0.3-beta 453 9/12/2019