[][src]Trait rustfst::algorithms::compose::matchers::Matcher

pub trait Matcher<W: Semiring>: Debug + Clone {
    type F: ExpandedFst<W>;
    type Iter: Iterator<Item = IterItemMatcher<W>> + Clone;
    fn new(fst: Arc<Self::F>, match_type: MatchType) -> Result<Self>
    where
        Self: Sized
;
fn iter(&self, state: StateId, label: Label) -> Result<Self::Iter>;
fn final_weight(&self, state: StateId) -> Result<Option<W>>;
fn match_type(&self, test: bool) -> Result<MatchType>;
fn flags(&self) -> MatcherFlags;
fn priority(&self, state: StateId) -> Result<usize>;
fn fst(&self) -> &Arc<Self::F>; }

Matchers find and iterate through requested labels at FST states. In the simplest form, these are just some associative map or search keyed on labels. More generally, they may implement matching special labels that represent sets of labels such as sigma (all), rho (rest), or phi (fail).

Associated Types

type F: ExpandedFst<W>

type Iter: Iterator<Item = IterItemMatcher<W>> + Clone

Loading content...

Required methods

fn new(fst: Arc<Self::F>, match_type: MatchType) -> Result<Self> where
    Self: Sized

fn iter(&self, state: StateId, label: Label) -> Result<Self::Iter>

fn final_weight(&self, state: StateId) -> Result<Option<W>>

fn match_type(&self, test: bool) -> Result<MatchType>

fn flags(&self) -> MatcherFlags

fn priority(&self, state: StateId) -> Result<usize>

Indicates preference for being the side used for matching in composition. If the value is kRequirePriority, then it is mandatory that it be used. Calling this method without passing the current state of the matcher invalidates the state of the matcher.

fn fst(&self) -> &Arc<Self::F>

Loading content...

Implementors

impl<W: Semiring, F: ExpandedFst<W>> Matcher<W> for SortedMatcher<W, F>[src]

type F = F

type Iter = IteratorSortedMatcher<W, F::TRS>

impl<W: Semiring, M: Matcher<W>> Matcher<W> for TrivialLookAheadMatcher<W, M>[src]

type F = M::F

type Iter = M::Iter

impl<W: Semiring, M: Matcher<W>> Matcher<W> for MultiEpsMatcher<W, M>[src]

type F = M::F

type Iter = IteratorMultiEpsMatcher<W, M>

impl<W: Semiring, M: Matcher<W>, MFT: MatcherFlagsTrait> Matcher<W> for LabelLookAheadMatcher<W, M, MFT>[src]

type F = M::F

type Iter = M::Iter

impl<W: Semiring, M: Matcher<W>, MFT: MatcherFlagsTrait> Matcher<W> for TrLookAheadMatcher<W, M, MFT>[src]

type F = M::F

type Iter = M::Iter

Loading content...