Vcsn  2.2
Be Rational
vcsn::detail::efsmer< Aut > Class Template Reference

Format automaton to EFSM format, based on FSM format. More...

#include <efsm.hh>

Inheritance diagram for vcsn::detail::efsmer< Aut >:
Collaboration diagram for vcsn::detail::efsmer< Aut >:

Public Member Functions

void operator() ()
 Actually output aut_ on os_. More...
 
- Public Member Functions inherited from vcsn::detail::printer< Aut >
 printer (const automaton_t &aut, std::ostream &out)
 

Protected Types

using automaton_t = Aut
 
using super_t = printer< Aut >
 
using label_t = typename super_t::label_t
 
using state_t = typename super_t::state_t
 
using transition_t = typename super_t::transition_t
 
- Protected Types inherited from vcsn::detail::printer< Aut >
using automaton_t = Aut
 
using context_t = context_t_of< automaton_t >
 
using label_t = label_t_of< automaton_t >
 
using transition_t = transition_t_of< automaton_t >
 
using weightset_t = weightset_t_of< automaton_t >
 
using weight_t = weight_t_of< automaton_t >
 
using polynomialset_t = polynomialset< context_t >
 
using polynomial_t = typename polynomialset_t::value_t
 
using states_t = std::vector< state_t >
 A list of states. More...
 

Private Member Functions

std::string arc_type_ () const
 The OpenFST name that corresponds to our weightset. More...
 
template<typename LS >
void print_label_ (const LS &ls, const typename LS::value_t &l) const
 
template<typename Label >
void print_label_ (const Label &l, std::false_type) const
 Acceptor. More...
 
template<typename Label >
void print_label_ (const Label &l, std::true_type) const
 Two-tape automaton. More...
 
void print_transition_ (const transition_t t) const override
 
void print_transitions_ ()
 Output all the transitions, and final states. More...
 
template<typename LabelSet , typename Labels , typename GetLabel >
auto add_alphabet_ (const LabelSet &ls, Labels &labels, GetLabel get_label) -> std::enable_if_t< has_generators_mem_fn< LabelSet >
 Fill labels with the gensets of ls. More...
 
template<typename LabelSet , typename Labels , typename GetLabel >
auto add_alphabet_ (const LabelSet &, Labels &, GetLabel) -> std::enable_if_t<!has_generators_mem_fn< LabelSet >
 Fill ls with the letters. More...
 

Private Attributes

const is_transducer_t is_transducer = {}
 
const charisymbols_
 File name for input tape symbols. More...
 
const charosymbols_
 File name for output tape symbols. More...
 

Additional Inherited Members

- Public Types inherited from vcsn::detail::printer< Aut >
using state_t = state_t_of< automaton_t >
 
- Protected Member Functions inherited from vcsn::detail::printer< Aut >
virtual std::string label_ (const label_t &l) const
 Convert a label to its representation. More...
 
virtual void print_transition_ (transition_t t) const
 Output the transition t. More...
 
void print_state_ (const state_t s)
 Output transitions, sorted lexicographically on (Label, Dest). More...
 
void print_transitions_ ()
 Output transitions, sorted lexicographically. More...
 
void list_states_ (const states_t &ss)
 List names of states in ss, preceded by ' '. More...
 
states_t initials_ ()
 The list of initial states, sorted. More...
 
states_t finals_ ()
 The list of final states, sorted. More...
 
- Protected Attributes inherited from vcsn::detail::printer< Aut >
automaton_t aut_
 The automaton we have to output. More...
 
std::ostream & os_
 Output stream. More...
 
const labelset_t_of< automaton_t > & ls_ = *aut_->labelset()
 Short-hand to the labelset. More...
 
const weightset_tws_ = *aut_->weightset()
 Short-hand to the weightset. More...
 
const polynomialset_t ps_ {aut_->context()}
 Short-hand to the polynomialset used to print the entries. More...
 

Detailed Description

template<Automaton Aut>
class vcsn::detail::efsmer< Aut >

Format automaton to EFSM format, based on FSM format.

Template Parameters
Autan automaton type, not a pointer type.

http://www2.research.att.com/~fsmtools/fsm/man4/fsm.5.html

Definition at line 41 of file efsm.hh.

Member Typedef Documentation

template<Automaton Aut>
using vcsn::detail::efsmer< Aut >::automaton_t = Aut
protected

Definition at line 44 of file efsm.hh.

template<Automaton Aut>
using vcsn::detail::efsmer< Aut >::label_t = typename super_t::label_t
protected

Definition at line 47 of file efsm.hh.

template<Automaton Aut>
using vcsn::detail::efsmer< Aut >::state_t = typename super_t::state_t
protected

Definition at line 48 of file efsm.hh.

template<Automaton Aut>
using vcsn::detail::efsmer< Aut >::super_t = printer<Aut>
protected

Definition at line 45 of file efsm.hh.

template<Automaton Aut>
using vcsn::detail::efsmer< Aut >::transition_t = typename super_t::transition_t
protected

Definition at line 49 of file efsm.hh.

Member Function Documentation

template<Automaton Aut>
template<typename LabelSet , typename Labels , typename GetLabel >
auto vcsn::detail::efsmer< Aut >::add_alphabet_ ( const LabelSet &  ls,
Labels &  labels,
GetLabel  get_label 
) -> std::enable_if_t<has_generators_mem_fn<LabelSet>
inlineprivate

Fill labels with the gensets of ls.

Case where genset is supported.

Parameters
lsthe labelset from which to pull the gensets
labelsthe set of labels to fill
get_labela projection to extract the label from a genset. For instance the genset might be pairs of labels, and get_label could select first or second.

Definition at line 222 of file efsm.hh.

template<Automaton Aut>
template<typename LabelSet , typename Labels , typename GetLabel >
auto vcsn::detail::efsmer< Aut >::add_alphabet_ ( const LabelSet &  ,
Labels &  ,
GetLabel   
) -> std::enable_if_t<!has_generators_mem_fn<LabelSet>
inlineprivate

Fill ls with the letters.

Case where genset is not supported: do nothing.

Definition at line 233 of file efsm.hh.

template<Automaton Aut>
std::string vcsn::detail::efsmer< Aut >::arc_type_ ( ) const
inlineprivate

The OpenFST name that corresponds to our weightset.

Definition at line 106 of file efsm.hh.

References vcsn::detail::map(), and vcsn::detail::printer< Aut >::ws_.

Referenced by vcsn::detail::efsmer< Aut >::operator()().

Here is the call graph for this function:

template<Automaton Aut>
void vcsn::detail::efsmer< Aut >::operator() ( )
inline

Actually output aut_ on os_.

Definition at line 60 of file efsm.hh.

References vcsn::detail::efsmer< Aut >::arc_type_(), vcsn::detail::efsmer< Aut >::is_transducer, vcsn::detail::efsmer< Aut >::isymbols_, vcsn::detail::printer< Aut >::os_, vcsn::detail::efsmer< Aut >::osymbols_, and vcsn::detail::efsmer< Aut >::print_transitions_().

Here is the call graph for this function:

template<Automaton Aut>
template<typename LS >
void vcsn::detail::efsmer< Aut >::print_label_ ( const LS &  ls,
const typename LS::value_t &  l 
) const
inlineprivate
template<Automaton Aut>
template<typename Label >
void vcsn::detail::efsmer< Aut >::print_label_ ( const Label &  l,
std::false_type   
) const
inlineprivate

Acceptor.

Definition at line 133 of file efsm.hh.

References vcsn::detail::printer< Aut >::ls_, and vcsn::detail::efsmer< Aut >::print_label_().

Here is the call graph for this function:

template<Automaton Aut>
template<typename Label >
void vcsn::detail::efsmer< Aut >::print_label_ ( const Label &  l,
std::true_type   
) const
inlineprivate

Two-tape automaton.

Definition at line 140 of file efsm.hh.

References vcsn::detail::printer< Aut >::ls_, vcsn::detail::printer< Aut >::os_, and vcsn::detail::efsmer< Aut >::print_label_().

Here is the call graph for this function:

template<Automaton Aut>
void vcsn::detail::efsmer< Aut >::print_transition_ ( const transition_t  t) const
inlineoverrideprivate

Definition at line 147 of file efsm.hh.

References vcsn::detail::printer< Aut >::aut_, vcsn::detail::efsmer< Aut >::is_transducer, vcsn::detail::printer< Aut >::os_, vcsn::detail::efsmer< Aut >::print_label_(), and vcsn::detail::printer< Aut >::ws_.

Referenced by vcsn::detail::efsmer< Aut >::print_transitions_().

Here is the call graph for this function:

template<Automaton Aut>
void vcsn::detail::efsmer< Aut >::print_transitions_ ( )
inlineprivate

Output all the transitions, and final states.

Definition at line 170 of file efsm.hh.

References vcsn::detail::printer< Aut >::aut_, vcsn::detail::final_transitions(), vcsn::detail::initial_transitions(), vcsn::detail::printer< Aut >::os_, vcsn::detail::printer< Aut >::print_state_(), vcsn::detail::efsmer< Aut >::print_transition_(), vcsn::sort(), and vcsn::detail::printer< Aut >::ws_.

Referenced by vcsn::detail::efsmer< Aut >::operator()().

Here is the call graph for this function:

Member Data Documentation

template<Automaton Aut>
const is_transducer_t vcsn::detail::efsmer< Aut >::is_transducer = {}
private
template<Automaton Aut>
const char* vcsn::detail::efsmer< Aut >::isymbols_
private
Initial value:
=
is_transducer ? "$medir/isymbols.txt" : "$medir/symbols.txt"

File name for input tape symbols.

Definition at line 332 of file efsm.hh.

Referenced by vcsn::detail::efsmer< Aut >::operator()().

template<Automaton Aut>
const char* vcsn::detail::efsmer< Aut >::osymbols_
private
Initial value:
=
is_transducer ? "$medir/osymbols.txt" : "$medir/symbols.txt"

File name for output tape symbols.

Definition at line 335 of file efsm.hh.

Referenced by vcsn::detail::efsmer< Aut >::operator()().


The documentation for this class was generated from the following file: