rustfst 1.3.0

Library for constructing, combining, optimizing, and searching weighted finite-state transducers (FSTs).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::semirings::Semiring;
use crate::StateId;

#[derive(PartialOrd, PartialEq, Hash, Clone, Debug, Eq)]
pub struct Element<W: Semiring> {
    pub state: Option<StateId>,
    pub weight: W,
}

impl<W: Semiring> Element<W> {
    pub fn new(state: Option<StateId>, weight: W) -> Self {
        Self { state, weight }
    }
}