Skip to main content

vn_nlp/
lib.rs

1#![forbid(unsafe_code)]
2#![doc = "Vietnamese NLP library — tokenization, normalization, segmentation."]
3#![doc = ""]
4#![doc = "# Quick Start"]
5#![doc = ""]
6#![doc = "```rust"]
7#![doc = "use vn_nlp::tokenize;"]
8#![doc = ""]
9#![doc = "let tokens = tokenize(\"Xin chào Việt Nam\").unwrap();"]
10#![doc = "assert_eq!(tokens[0].text, \"Xin\");"]
11#![doc = "```"]
12
13// Re-export core types
14pub use vn_nlp_core::*;
15
16// Re-export tokenize module
17#[cfg(feature = "tokenize")]
18pub mod tokenize {
19    //! Tokenization algorithms cho tiếng Việt.
20    pub use vn_nlp_tokenize::*;
21}
22
23// Re-export normalize module
24#[cfg(feature = "normalize")]
25pub mod normalize {
26    //! Text normalization — diacritics, Unicode NFC/NFD.
27    pub use vn_nlp_normalize::*;
28}
29
30// Re-export segment module
31#[cfg(feature = "segment")]
32pub mod segment {
33    //! Sentence segmentation.
34    pub use vn_nlp_segment::*;
35}
36
37// Convenience re-exports at top level
38#[cfg(feature = "tokenize")]
39pub use vn_nlp_tokenize::tokenize;
40
41#[cfg(feature = "normalize")]
42pub use vn_nlp_normalize::normalize;
43
44#[cfg(feature = "segment")]
45pub use vn_nlp_segment::segment;