UglyToad / PragmaticSegmenterNet

Port of PragmaticSegmenter for sentence boundary detection
Other
33 stars 12 forks source link
nlp segmentation sentence sentence-boundary-detection sentence-segmentation

PragmaticSegmenterNet

Build status

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.