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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! Multi-Tape Weighted Finite State Transducers.
//!
//! This module implements multi-tape WFSTs for synchronized transduction
//! over multiple input/output streams. Multi-tape transducers generalize
//! standard two-tape transducers to k tapes.
//!
//! # Mathematical Definition
//!
//! A k-tape weighted transducer is a tuple T = (Q, Σ₁,...,Σₖ, q₀, F, E, ρ) where:
//! - Q: Finite set of states
//! - Σ₁,...,Σₖ: Tape alphabets (each tape has its own alphabet)
//! - q₀: Initial state
//! - F ⊆ Q: Final states
//! - E: Transitions of the form (q, (a₁,...,aₖ), w, q') where aᵢ ∈ Σᵢ ∪ {ε}
//! - ρ: Final weight function
//!
//! # Transition Format
//!
//! ```text
//! (state, [label₁, label₂, ..., labelₖ], weight, next_state)
//! ```
//!
//! Each label can be `Some(symbol)` or `None` (epsilon).
//!
//! # Example
//!
//! ```rust,ignore
//! use lling_llang::multitape::{MultiTapeWfstBuilder, MultiTapeLabel};
//! use lling_llang::semiring::TropicalWeight;
//!
//! // Create a 3-tape transducer for word alignment
//! let mut builder = MultiTapeWfstBuilder::<char, TropicalWeight, 3>::new();
//!
//! let s0 = builder.add_state();
//! builder.set_start(s0);
//! builder.set_final(s0, TropicalWeight::one());
//!
//! // Transition: source word, target word, alignment tag
//! builder.add_transition(s0, s0, ['h', 'h', 'A'], TropicalWeight::one());
//! builder.add_transition(s0, s0, ['e', 'e', 'A'], TropicalWeight::one());
//! builder.add_transition(s0, s0, ['l', 'l', 'A'], TropicalWeight::one());
//!
//! let mt = builder.build();
//! ```
//!
//! # Applications
//!
//! - **Word alignment**: (source, target, alignment tape)
//! - **Multi-stream ASR**: (audio features, visual features, text)
//! - **Morphological analysis**: (surface form, lemma, morphological tags)
//! - **Parallel corpus processing**: Multiple language tapes
pub use ;
pub use MultiTapeLabel;
pub use ;
pub use ;
pub use ;
pub use MultiTapeTransition;
pub use ;
// StateId re-exported from wfst