Natasha.Razdel 7.0.1

dotnet add package Natasha.Razdel --version 7.0.1                
NuGet\Install-Package Natasha.Razdel -Version 7.0.1                
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="Natasha.Razdel" Version="7.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Natasha.Razdel --version 7.0.1                
#r "nuget: Natasha.Razdel, 7.0.1"                
#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 Natasha.Razdel as a Cake Addin
#addin nuget:?package=Natasha.Razdel&version=7.0.1

// Install Natasha.Razdel as a Cake Tool
#tool nuget:?package=Natasha.Razdel&version=7.0.1                

Natasha

Порт библиотеки https://github.com/natasha на C#

Поддерживаемые библиотеки:

Natasha.Razdel

Sentenizer

Использование:

var text = """
- "Так в чем же дело?" - "Не ра-ду-ют".
И т. д. и т. п. В общем, вся газета
""";

var sentenizer = new TextSentenizer();
var data = sentenizer.Split(text).ToList();

// [0:22] - "Так в чем же дело?"
// [23:39] - "Не ра-ду-ют".
// [41:56] И т. д. и т. п.
// [57:76] В общем, вся газета

Tokenizer

Использование:

var text = "Кружка-термос на 0.5л (50/64 см³, 516;...)";
var tokenizer = new TextTokenizer();
var data = tokenizer.Split(text).ToList();

// [0:13] Кружка-термос
// [14:16] на
// [17:20] 0.5
// [20:21] л
// [22:23] (
// [23:28] 50/64
// [29:32] см?
// [32:33] ,
// [34:37] 516
// [37:38] ;
// [38:41] ...
// [41:42] )

Отличия от оригинала:

  1. В рамках импортозамещения удалено правило yahoo!
  2. Добавлена возможность модифицировать спсиок правил и создавать собственные

Пример реализации собственного правила:

/// <summary>
/// правило присоединения символа номера (№) к числу справа
/// </summary>
class NumberRule : Rule<TokenSplit>
{
    public override RuleAction Check(TokenSplit split)
    {
        var res = split.Left == "№" && split.Right1.Type == AtomType.Int;
        return res ? RuleAction.Join : RuleAction.None;
    }
}

...

tokenizer.Rules.Add(new NumberRule());
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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.
  • net7.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
7.0.1 238 7/1/2023
7.0.0 155 6/22/2023