pyphen-rs

Crates.iopyphen-rs
lib.rspyphen-rs
version0.1.0
sourcesrc
created_at2019-05-27 21:50:36.524338
updated_at2019-05-27 21:50:36.524338
descriptionA pure Rust port of Pyphen, a Python hyphenation library
homepagehttps://github.com/nareshganduri/pyphen-rs
repositoryhttps://github.com/nareshganduri/pyphen-rs
max_upload_size
id137416
size9,987,617
Naresh Ganduri (nareshganduri)

documentation

README

pyphen-rs

A pure Rust port of Python's Pyphen library.

Usage

use pyphen_rs;

assert_eq!(pyphen_rs::language_fallback("nl_NL_variant1").unwrap(), "nl_NL");

pyphen_rs::LANGUAGES.with(|l|) {
    assert!(l.borrow().contains_key("nl_NL"));
};

let dic = pyphen_rs::Builder::lang("nl_NL").build().unwrap();
assert_eq!(dic.inserted("lettergrepen"), "let-ter-gre-pen");

let wrap = dic.wrap("autobandventieldopje", 11); // Some(("autoband-", "ventieldopje"))
let iter = dic.iterate("Amsterdam"):
iter.next(); // Some(("Amster", "dam"))
iter.next(); // Some(("Am", "sterdam"))
iter.next(); // None

License

Pyphen-rs is released under the GPL 2.0+/LGPL 2.1+/MPL 1.1 tri-license. See COPYING.GPL, COPYING.LGPL and COPYING.MPL for more details.

Commit count: 4

cargo fmt