Awali
Another Weighted Automata library
Public Types | Public Member Functions | Static Public Member Functions
awali::sttc::wordset< GenSet > Class Template Reference

Implementation of labels are words. More...

#include <wordset.hh>

Public Types

using genset_ptr = std::shared_ptr< const genset_t >
 
using genset_t = GenSet
 
using kind_t = labels_are_words
 
using letter_t = typename genset_t::letter_t
 
using letters_t = std::set< letter_t >
 
using self_type = wordset
 
using value_t = word_t
 
using word_t = typename genset_t::word_t
 

Public Member Functions

 wordset (const genset_t &gs={})
 
word_t concat (const letter_t l, const letter_t r) const
 
word_t concat (const letter_t l, const word_t &r) const
 
word_t concat (const word_t &l, const letter_t r) const
 
word_t concat (const word_t &l, const word_t &r) const
 
word_t delimit (const word_t &w) const
 Add the special character first and last. More...
 
const genset_tgenset () const
 
bool is_valid (const value_t &v) const
 
bool open (bool o) const
 Whether unknown letters should be added, or rejected. More...
 
value_t parse (const std::string &s) const
 
value_t parse (const std::string &s, size_t &p, bool fixed_alphabet=true) const
 
std::ostream & print (const value_t &l, std::ostream &o, const std::string &format="text") const
 
std::ostream & print_set (std::ostream &o, const std::string &format="text") const
 
template<unsigned version = version::fsm_json>
json::node_tto_json () const
 
value_t transpose (const value_t &v) const
 
word_t undelimit (const word_t &w) const
 Remove first and last characters, that must be "special". More...
 
template<typename... Args>
value_t value (Args &&... args) const
 Value constructor. More...
 
template<unsigned version = version::fsm_json>
value_t value_from_json (json::node_t const *p) const
 
template<unsigned version = version::fsm_json>
json::node_tvalue_to_json (value_t v) const
 
std::string vname (bool full=true) const
 
word_t word (const letter_t &l) const
 Convert to a word. More...
 
word_t word (const value_t &v) const
 Convert to a word. More...
 

Static Public Member Functions

static value_t conv (self_type, value_t v)
 
static bool equals (const value_t l, const value_t r)
 Whether l == r. More...
 
static constexpr bool has_one ()
 
static size_t hash (const value_t &v)
 
static constexpr bool is_free ()
 
static constexpr bool is_letterized ()
 
static bool is_one (const value_t &l)
 
static constexpr bool is_ratexpset ()
 
static bool is_special (const value_t &v)
 
static bool less_than (const value_t l, const value_t r)
 Whether l < r. More...
 
static word_t letters_of (word_t v)
 Prepare to iterate over the letters of v. More...
 
static value_t one ()
 
static size_t size (const value_t &v)
 
static std::string sname ()
 
static value_t special ()
 

Detailed Description

template<typename GenSet>
class awali::sttc::wordset< GenSet >

Implementation of labels are words.

Member Typedef Documentation

◆ genset_ptr

template<typename GenSet >
using awali::sttc::wordset< GenSet >::genset_ptr = std::shared_ptr<const genset_t>

◆ genset_t

template<typename GenSet >
using awali::sttc::wordset< GenSet >::genset_t = GenSet

◆ kind_t

template<typename GenSet >
using awali::sttc::wordset< GenSet >::kind_t = labels_are_words

◆ letter_t

template<typename GenSet >
using awali::sttc::wordset< GenSet >::letter_t = typename genset_t::letter_t

◆ letters_t

template<typename GenSet >
using awali::sttc::wordset< GenSet >::letters_t = std::set<letter_t>

◆ self_type

template<typename GenSet >
using awali::sttc::wordset< GenSet >::self_type = wordset

◆ value_t

template<typename GenSet >
using awali::sttc::wordset< GenSet >::value_t = word_t

◆ word_t

template<typename GenSet >
using awali::sttc::wordset< GenSet >::word_t = typename genset_t::word_t

Constructor & Destructor Documentation

◆ wordset()

template<typename GenSet >
awali::sttc::wordset< GenSet >::wordset ( const genset_t gs = {})

Member Function Documentation

◆ concat() [1/4]

template<typename GenSet >
word_t awali::sttc::wordset< GenSet >::concat ( const letter_t  l,
const letter_t  r 
) const

◆ concat() [2/4]

template<typename GenSet >
word_t awali::sttc::wordset< GenSet >::concat ( const letter_t  l,
const word_t r 
) const

◆ concat() [3/4]

template<typename GenSet >
word_t awali::sttc::wordset< GenSet >::concat ( const word_t l,
const letter_t  r 
) const

◆ concat() [4/4]

template<typename GenSet >
word_t awali::sttc::wordset< GenSet >::concat ( const word_t l,
const word_t r 
) const

◆ conv()

template<typename GenSet >
static value_t awali::sttc::wordset< GenSet >::conv ( self_type  ,
value_t  v 
)
static

◆ delimit()

template<typename GenSet >
word_t awali::sttc::wordset< GenSet >::delimit ( const word_t w) const

Add the special character first and last.

◆ equals()

template<typename GenSet >
static bool awali::sttc::wordset< GenSet >::equals ( const value_t  l,
const value_t  r 
)
static

Whether l == r.

◆ genset()

template<typename GenSet >
const genset_t& awali::sttc::wordset< GenSet >::genset ( ) const

◆ has_one()

template<typename GenSet >
static constexpr bool awali::sttc::wordset< GenSet >::has_one ( )
staticconstexpr

◆ hash()

template<typename GenSet >
static size_t awali::sttc::wordset< GenSet >::hash ( const value_t v)
static

◆ is_free()

template<typename GenSet >
static constexpr bool awali::sttc::wordset< GenSet >::is_free ( )
staticconstexpr

◆ is_letterized()

template<typename GenSet >
static constexpr bool awali::sttc::wordset< GenSet >::is_letterized ( )
staticconstexpr

◆ is_one()

template<typename GenSet >
static bool awali::sttc::wordset< GenSet >::is_one ( const value_t l)
static

◆ is_ratexpset()

template<typename GenSet >
static constexpr bool awali::sttc::wordset< GenSet >::is_ratexpset ( )
staticconstexpr

◆ is_special()

template<typename GenSet >
static bool awali::sttc::wordset< GenSet >::is_special ( const value_t v)
static

◆ is_valid()

template<typename GenSet >
bool awali::sttc::wordset< GenSet >::is_valid ( const value_t v) const

◆ less_than()

template<typename GenSet >
static bool awali::sttc::wordset< GenSet >::less_than ( const value_t  l,
const value_t  r 
)
static

Whether l < r.

◆ letters_of()

template<typename GenSet >
static word_t awali::sttc::wordset< GenSet >::letters_of ( word_t  v)
static

Prepare to iterate over the letters of v.

◆ one()

template<typename GenSet >
static value_t awali::sttc::wordset< GenSet >::one ( )
static

◆ open()

template<typename GenSet >
bool awali::sttc::wordset< GenSet >::open ( bool  o) const

Whether unknown letters should be added, or rejected.

Parameters
owhether to accept
Returns
the previous status.

◆ parse() [1/2]

template<typename GenSet >
value_t awali::sttc::wordset< GenSet >::parse ( const std::string &  s) const

◆ parse() [2/2]

template<typename GenSet >
value_t awali::sttc::wordset< GenSet >::parse ( const std::string &  s,
size_t &  p,
bool  fixed_alphabet = true 
) const

◆ print()

template<typename GenSet >
std::ostream& awali::sttc::wordset< GenSet >::print ( const value_t l,
std::ostream &  o,
const std::string &  format = "text" 
) const

◆ print_set()

template<typename GenSet >
std::ostream& awali::sttc::wordset< GenSet >::print_set ( std::ostream &  o,
const std::string &  format = "text" 
) const

◆ size()

template<typename GenSet >
static size_t awali::sttc::wordset< GenSet >::size ( const value_t v)
static

◆ sname()

template<typename GenSet >
static std::string awali::sttc::wordset< GenSet >::sname ( )
static

◆ special()

template<typename GenSet >
static value_t awali::sttc::wordset< GenSet >::special ( )
static

◆ to_json()

template<typename GenSet >
template<unsigned version = version::fsm_json>
json::node_t* awali::sttc::wordset< GenSet >::to_json ( ) const

◆ transpose()

template<typename GenSet >
value_t awali::sttc::wordset< GenSet >::transpose ( const value_t v) const

◆ undelimit()

template<typename GenSet >
word_t awali::sttc::wordset< GenSet >::undelimit ( const word_t w) const

Remove first and last characters, that must be "special".

◆ value()

template<typename GenSet >
template<typename... Args>
value_t awali::sttc::wordset< GenSet >::value ( Args &&...  args) const

Value constructor.

◆ value_from_json()

template<typename GenSet >
template<unsigned version = version::fsm_json>
value_t awali::sttc::wordset< GenSet >::value_from_json ( json::node_t const *  p) const

◆ value_to_json()

template<typename GenSet >
template<unsigned version = version::fsm_json>
json::node_t* awali::sttc::wordset< GenSet >::value_to_json ( value_t  v) const

◆ vname()

template<typename GenSet >
std::string awali::sttc::wordset< GenSet >::vname ( bool  full = true) const

◆ word() [1/2]

template<typename GenSet >
word_t awali::sttc::wordset< GenSet >::word ( const letter_t l) const

Convert to a word.

◆ word() [2/2]

template<typename GenSet >
word_t awali::sttc::wordset< GenSet >::word ( const value_t v) const

Convert to a word.


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