jpreprocess

Japanese text preprocessor for Text-to-Speech application.

This project is a rewrite of OpenJTalk in Rust language.

Usage

Put the following in Cargo.toml

toml [dependencies] jpreprocess = "0.2.0"

Example

In this example, jpreprocess takes a lindera dictionary and preprocesses a text into jpcommon labels.

```rs use jpreprocess::*;

let config = JPreprocessDictionaryConfig::FileLindera(PathBuf::from("pathtolindera_dictionary")); let jpreprocess = JPreprocess::new(config)?;

let jpcommonlabel = jpreprocess .extractfullcontext("日本語文を解析し、音声合成エンジンに渡せる形式に変換します.")?; asserteq!( jpcommonlabel[2], concat!( "sil^n-i+h=o", "/A:-3+1+7", "/B:xx-xxxx", "/C:02xx+xx", "/D:02+xxxx", "/E:xxxx!xxxx-xx", "/F:74#0xx@13|112", "/G:44%0xx1", "/H:xxxx", "/I:3-12@1+2&1-8|1+41", "/J:529", "/K:2+8-41" ) ); ```

Copyrights

This software includes source code from:

License

BSD-3-Clause

API Reference