simnalamburt / rust-pragmatic-segmenter

🗣️ Rust port of pySBD and pragmatic-segmenter
Other
11 stars 0 forks source link

Unmaintained, see https://github.com/simnalamburt/rust-pragmatic-segmenter/issues/8#issuecomment-1641767315

 

rust-pragmatic-segmenter version

Rust port of pySBD v0.3.1 and Ruby pragmatic_segmenter. Documentations

rust-pragmatic-segmenter is rule-based SBD. It uses a lot of regular expressions to separate sentences.

use pragmatic_segmenter::Segmenter;

let segmenter = Segmenter::new()?;
let result: Vec<_> = segmenter.segment("Hi Mr. Kim. Let's meet at 3 P.M.").collect();
//=> vec!["Hi Mr. Kim. ", "Let's meet at 3 P.M."]

How to build

sudo apt install -y libclang-dev
cargo build

TODOs

 


rust-pragmatic-segmenter is primarily distributed under the terms of both the Apache License (Version 2.0) and the MIT license. See COPYRIGHT for details.