![]() |
Vcsn
2.3a
Be Rational
|
Print automaton to EFSM format, based on FSM format. More...
#include <efsm.hh>
Public Member Functions | |
void | operator() () |
Actually output aut_ on os_. More... | |
![]() | |
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 |
![]() | |
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... | |
using | is_transducer_t = std::integral_constant< bool, 2<=rank< labelset_t_of< automaton_t >>::value > |
Whether is a transducer (two-tape automaton) as opposed to an acceptor. 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 |
Output the transition t. More... | |
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 char * | osymbols_ |
File name for output tape symbols. More... | |
Additional Inherited Members | |
![]() | |
using | state_t = state_t_of< automaton_t > |
![]() | |
virtual std::string | label_ (const label_t &l) const |
Convert a label to its representation. 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... | |
![]() | |
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_t & | ws_ = *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... | |
const is_transducer_t | is_transducer_ = {} |
Print automaton to EFSM format, based on FSM format.
Aut | an automaton type, not a pointer type. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inlineprivate |
Fill labels with the gensets of ls.
Case where genset
is supported.
ls | the labelset from which to pull the gensets |
labels | the set of labels to fill |
get_label | a 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. |
|
inlineprivate |
|
inlineprivate |
The OpenFST name that corresponds to our weightset.
Definition at line 98 of file efsm.hh.
References vcsn::detail::map(), and vcsn::detail::printer< Aut >::ws_.
Referenced by vcsn::detail::efsmer< Aut >::operator()().
|
inline |
Actually output aut_ on os_.
Definition at line 48 of file efsm.hh.
References vcsn::detail::efsmer< Aut >::arc_type_(), vcsn::detail::printer< Aut >::is_transducer_, vcsn::detail::printer< Aut >::os_, vcsn::detail::efsmer< Aut >::osymbols_, and vcsn::detail::efsmer< Aut >::print_transitions_().
|
inlineprivate |
Definition at line 115 of file efsm.hh.
References vcsn::detail::printer< Aut >::os_, and vcsn::format::raw.
Referenced by vcsn::detail::efsmer< Aut >::print_label_(), and vcsn::detail::efsmer< Aut >::print_transition_().
|
inlineprivate |
Acceptor.
Definition at line 125 of file efsm.hh.
References vcsn::detail::printer< Aut >::ls_, and vcsn::detail::efsmer< Aut >::print_label_().
|
inlineprivate |
Two-tape automaton.
Definition at line 132 of file efsm.hh.
References vcsn::detail::printer< Aut >::ls_, vcsn::detail::printer< Aut >::os_, and vcsn::detail::efsmer< Aut >::print_label_().
|
inlineoverrideprivatevirtual |
Output the transition t.
Do not insert eol. "Src Label Dst".
Reimplemented from vcsn::detail::printer< Aut >.
Definition at line 139 of file efsm.hh.
References vcsn::detail::printer< Aut >::aut_, vcsn::detail::printer< Aut >::is_transducer_, vcsn::detail::printer< Aut >::os_, vcsn::detail::efsmer< Aut >::print_label_(), vcsn::detail::states_size(), and vcsn::detail::printer< Aut >::ws_.
Referenced by vcsn::detail::efsmer< Aut >::print_transitions_().
|
inlineprivate |
Output all the transitions, and final states.
Definition at line 167 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()().
|
private |
File name for output tape symbols.
Definition at line 321 of file efsm.hh.
Referenced by vcsn::detail::efsmer< Aut >::operator()().