1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! # crftag
//!
//! CRF-based POS tagger and shallow parser (chunker) built on [`crfrs`].
//!
//! Fully independent — drop it into any Rust project.
//!
//! ## Features
//!
//! - [`POSTagger`] — structured-perceptron tagger
//! - [`Chunker`] — IOB chunker (shallow parser)
//! - [`RuleBasedChunker`] — grammar-based chunker, no model file required
//! - [`tree2brackets`] — formats a parse result as a bracketed string
//! - [`features`] — raw feature extraction (for custom models)
//! - [`crfrs`] — re-exported; use for training/loading models directly
//!
//! ## Quick start
//!
//! ```no_run
//! use crftag::POSTagger;
//!
//! let mut tagger = POSTagger::new();
//! tagger.load_model("pos_tagger.model").unwrap();
//! let tagged = tagger.tag(&["من", "به", "مدرسه", "رفتم", "."]).unwrap();
//! ```
//!
//! ## Training
//!
//! ```no_run
//! use crftag::{POSTagger, crfrs::TrainConfig};
//!
//! let corpus: Vec<Vec<(String, String)>> = vec![]; // (word, tag) pairs
//! POSTagger::train_and_save(&corpus, "pos_tagger.model", TrainConfig::default()).unwrap();
//! ```
/// Error types for crftag.
// Re-export crfrs so callers can use TrainConfig without an explicit dep.
pub use crfrs;
pub use ;
pub use ;
pub use POSTagger;