Home

Awesome

PragmaticSegmenterNet

Build status

<img src="https://raw.githubusercontent.com/UglyToad/PragmaticSegmenterNet/master/logo.png" width="128" height="128" />

This project is a direct port of Pragmatic Segmenter which provides rule-based sentence boundary detection.

Usage

The Segmenter class provides the Segment method which in the simplest usage takes a string:

using PragmaticSegmenterNet;

IReadOnlyList<string> result = Segmenter.Segment("One Sentence. And another sentence.");

// ["One Sentence.", "And another sentence."]

IReadOnlyList<string> result2 = Segmenter.Segment("Anything.", Language.Italian);

// ["Anything"]

The Segment method has a number of optional parameters:

IReadOnlyList<string> Segment(string text, Language language = Language.English, bool cleanText = true, DocumentType documentType = DocumentType.Any)

Languages

Credit

This project wouldn't be possible without the work done by Pragmatic Segmenter team.