[][src]Struct rustfst::FstPath

pub struct FstPath<W: Semiring> {
    pub ilabels: Vec<Label>,
    pub olabels: Vec<Label>,
    pub weight: W,
}

Structure representing a path in a FST (list of input labels, list of output labels and total weight).

Fields

ilabels: Vec<Label>

List of input labels.

olabels: Vec<Label>

List of output labels.

weight: W

Total weight of the path computed by multiplying the weight of each transition.

Implementations

impl<W: Semiring> FstPath<W>[src]

pub fn new(ilabels: Vec<Label>, olabels: Vec<Label>, weight: W) -> Self[src]

Creates a new Path.

pub fn add_to_path(
    &mut self,
    ilabel: Label,
    olabel: Label,
    weight: &W
) -> Result<()>
[src]

Adds the content of an FST transition to the Path. Labels are added at the end of the corresponding vectors and the weight is multiplied by the total weight already stored in the Path.

pub fn add_weight(&mut self, weight: &W) -> Result<()>[src]

Add a single weight to the Path by multiplying the weight by the total weight of the path.

pub fn concat(&mut self, other: FstPath<W>) -> Result<()>[src]

Append a Path to the current Path. Labels are appended and weights multiplied.

pub fn is_empty(&self) -> bool[src]

Trait Implementations

impl<W: Clone + Semiring> Clone for FstPath<W>[src]

impl<W: Debug + Semiring> Debug for FstPath<W>[src]

impl<W: Semiring> Default for FstPath<W>[src]

fn default() -> Self[src]

Creates an empty path with a weight one.

impl<W: Semiring + Hash + Eq> Eq for FstPath<W>[src]

impl<W: Semiring + Hash + Eq> Hash for FstPath<W>[src]

impl<W: PartialEq + Semiring> PartialEq<FstPath<W>> for FstPath<W>[src]

impl<W: PartialOrd + Semiring> PartialOrd<FstPath<W>> for FstPath<W>[src]

impl<W: Semiring> StructuralPartialEq for FstPath<W>[src]

Auto Trait Implementations

impl<W> RefUnwindSafe for FstPath<W> where
    W: RefUnwindSafe

impl<W> Send for FstPath<W> where
    W: Send

impl<W> Sync for FstPath<W>

impl<W> Unpin for FstPath<W> where
    W: Unpin

impl<W> UnwindSafe for FstPath<W> where
    W: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.