Public Types | Public Member Functions

fst::SequenceComposeFilter< M1, M2 > Class Template Reference

This filter requires epsilons on FST1 to be read before epsilons on FST2. More...

#include <fst/compose-filter.h>

Collaboration diagram for fst::SequenceComposeFilter< M1, M2 >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef M1::FST FST1
typedef M2::FST FST2
typedef FST1::Arc Arc
typedef CharFilterState FilterState
typedef M1 Matcher1
typedef M2 Matcher2
typedef Arc::StateId StateId
typedef Arc::Label Label
typedef Arc::Weight Weight

Public Member Functions

 SequenceComposeFilter (const FST1 &fst1, const FST2 &fst2, M1 *matcher1=0, M2 *matcher2=0)
 SequenceComposeFilter (const SequenceComposeFilter< M1, M2 > &filter, bool safe=false)
 ~SequenceComposeFilter ()
FilterState Start () const
void SetState (StateId s1, StateId s2, const FilterState &f)
FilterState FilterArc (Arc *arc1, Arc *arc2) const
void FilterFinal (Weight *, Weight *) const
Matcher1GetMatcher1 ()
 Return resp matchers. Ownership stays with filter.
Matcher2GetMatcher2 ()
uint64 Properties (uint64 props) const

Detailed Description

template<class M1, class M2>
class fst::SequenceComposeFilter< M1, M2 >

This filter requires epsilons on FST1 to be read before epsilons on FST2.

COMPOSITION FILTERS - these determine which matches are allowed to proceed. The filter's state is represented by the type ComposeFilter::FilterState. The basic filters handle correct epsilon matching. Their interface is:

template <class M1, class M2> class ComposeFilter { public: typedef typename M1::FST1 FST1; typedef typename M1::FST2 FST2; typedef typename FST1::Arc Arc; typedef ... FilterState; typedef ... Matcher1; typedef ... Matcher2;

Required constructors. ComposeFilter(const FST1 &fst1, const FST2 &fst2, M1 *matcher1 = 0, M2 *matcher2 = 0); If safe=true, the copy is thread-safe. See Fst<>::Copy() for further doc. ComposeFilter(const ComposeFilter<M1, M2> &filter, bool safe = false); Return start state of filter. FilterState Start() const; Specifies current composition state. void SetState(StateId s1, StateId s2, const FilterState &f);

Apply filter at current composition state to these transitions. If an arc label to be matched is kNolabel, then that side does not consume a symbol. Returns the new filter state or, if disallowed, FilterState::NoState(). The filter is permitted to modify its inputs, e.g. for optimizations. FilterState FilterArc(Arc *arc1, Arc *arc2) const; // Apply filter at current composition state to these final weights (cf. superfinal transitions). The filter may modify its inputs, e.g. for optimizations. void FilterFinal(Weight *final1, Weight *final2) const;

Return resp matchers. Ownership stays with filter. These methods allow the filter to access and possibly modify the composition matchers (useful e.g. with lookahead). Matcher1 *GetMatcher1(); Matcher2 *GetMatcher2();

This specifies how the filter affects the composition result properties. It takes as argument the properties that would apply with a trivial composition fitler. uint64 Properties(uint64 props) const; };

Definition at line 206 of file compose-filter.h.


Member Typedef Documentation

template<class M1, class M2>
typedef FST1::Arc fst::SequenceComposeFilter< M1, M2 >::Arc

Definition at line 210 of file compose-filter.h.

template<class M1, class M2>
typedef CharFilterState fst::SequenceComposeFilter< M1, M2 >::FilterState

Definition at line 211 of file compose-filter.h.

template<class M1, class M2>
typedef M1::FST fst::SequenceComposeFilter< M1, M2 >::FST1

Definition at line 208 of file compose-filter.h.

template<class M1, class M2>
typedef M2::FST fst::SequenceComposeFilter< M1, M2 >::FST2

Definition at line 209 of file compose-filter.h.

template<class M1, class M2>
typedef Arc::Label fst::SequenceComposeFilter< M1, M2 >::Label

Definition at line 216 of file compose-filter.h.

template<class M1, class M2>
typedef M1 fst::SequenceComposeFilter< M1, M2 >::Matcher1

Definition at line 212 of file compose-filter.h.

template<class M1, class M2>
typedef M2 fst::SequenceComposeFilter< M1, M2 >::Matcher2

Definition at line 213 of file compose-filter.h.

template<class M1, class M2>
typedef Arc::StateId fst::SequenceComposeFilter< M1, M2 >::StateId

Definition at line 215 of file compose-filter.h.

template<class M1, class M2>
typedef Arc::Weight fst::SequenceComposeFilter< M1, M2 >::Weight

Definition at line 217 of file compose-filter.h.


Constructor & Destructor Documentation

template<class M1, class M2>
fst::SequenceComposeFilter< M1, M2 >::SequenceComposeFilter ( const FST1 fst1,
const FST2 fst2,
M1 *  matcher1 = 0,
M2 *  matcher2 = 0 
) [inline]

Definition at line 219 of file compose-filter.h.

template<class M1, class M2>
fst::SequenceComposeFilter< M1, M2 >::SequenceComposeFilter ( const SequenceComposeFilter< M1, M2 > &  filter,
bool  safe = false 
) [inline]

Definition at line 228 of file compose-filter.h.

template<class M1, class M2>
fst::SequenceComposeFilter< M1, M2 >::~SequenceComposeFilter (  )  [inline]

Definition at line 237 of file compose-filter.h.


Member Function Documentation

template<class M1, class M2>
FilterState fst::SequenceComposeFilter< M1, M2 >::FilterArc ( Arc arc1,
Arc arc2 
) const [inline]

Definition at line 257 of file compose-filter.h.

template<class M1, class M2>
void fst::SequenceComposeFilter< M1, M2 >::FilterFinal ( Weight ,
Weight  
) const [inline]

Definition at line 267 of file compose-filter.h.

template<class M1, class M2>
Matcher1* fst::SequenceComposeFilter< M1, M2 >::GetMatcher1 (  )  [inline]

Return resp matchers. Ownership stays with filter.

Definition at line 270 of file compose-filter.h.

template<class M1, class M2>
Matcher2* fst::SequenceComposeFilter< M1, M2 >::GetMatcher2 (  )  [inline]

Definition at line 271 of file compose-filter.h.

template<class M1, class M2>
uint64 fst::SequenceComposeFilter< M1, M2 >::Properties ( uint64  props  )  const [inline]

Definition at line 273 of file compose-filter.h.

template<class M1, class M2>
void fst::SequenceComposeFilter< M1, M2 >::SetState ( StateId  s1,
StateId  s2,
const FilterState f 
) [inline]

Definition at line 244 of file compose-filter.h.

template<class M1, class M2>
FilterState fst::SequenceComposeFilter< M1, M2 >::Start (  )  const [inline]

Definition at line 242 of file compose-filter.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines