Skip to main content

lindera_nodejs/
lib.rs

1//! # Lindera Node.js Bindings
2//!
3//! Node.js bindings for [Lindera](https://github.com/lindera/lindera), a morphological analysis library for CJK text.
4//!
5//! Built with [NAPI-RS](https://napi.rs/) for high-performance native Node.js addon support.
6//!
7//! ## Features
8//!
9//! - **Dictionary management**: Build, load, and use custom dictionaries
10//! - **Tokenization**: Multiple tokenization modes (normal, decompose)
11//! - **Filters**: Character and token filtering pipeline
12//! - **Training**: Train custom morphological models (with `train` feature)
13//! - **User dictionaries**: Support for custom user dictionaries
14//! - **TypeScript**: Full type definitions generated automatically
15
16#[macro_use]
17extern crate napi_derive;
18
19pub mod dictionary;
20pub mod error;
21pub mod metadata;
22pub mod mode;
23pub mod schema;
24pub mod token;
25pub mod tokenizer;
26pub mod util;
27
28#[cfg(feature = "train")]
29pub mod trainer;
30
31/// Returns the version of the lindera-nodejs package.
32#[napi]
33pub fn version() -> String {
34    env!("CARGO_PKG_VERSION").to_string()
35}