Vcsn
2.2
Be Rational
|
Represent alphabets whose "letters" are strings. More...
#include <string.hh>
Public Types | |
using | letter_t = symbol |
Internalize the letters to save trees. More... | |
using | word_t = std::vector< letter_t > |
Public Member Functions | |
word_t | to_word (const letter_t l) const |
const word_t & | to_word (const word_t &l) const |
word_t | mul (const letter_t l, const letter_t r) const |
word_t | mul (const word_t &l, const letter_t r) const |
word_t | mul (const letter_t l, const word_t &r) const |
word_t | mul (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... | |
word_t | undelimit (const word_t &w) const |
Remove first and last characters, that must be "special". More... | |
word_t | transpose (const word_t &w) const |
letter_t | transpose (letter_t l) const |
bool | is_letter (const letter_t) const |
bool | is_letter (const word_t &w) const |
std::ostream & | print (const letter_t l, std::ostream &o, const format &fmt={}) const |
std::ostream & | print (const word_t &w, std::ostream &o, const format &fmt={}) const |
Static Public Member Functions | |
static symbol | sname () |
static word_t | empty_word () |
static bool | is_empty_word (const word_t &w) |
static bool | equal (const letter_t l, const letter_t r) |
Whether l == r. More... | |
static bool | equal (const word_t &l, const word_t &r) |
Whether l == r. More... | |
static bool | less (const letter_t l, const letter_t r) |
Whether l < r. More... | |
static bool | less (const word_t &l, const word_t &r) |
Whether l < r. More... | |
static letter_t | one_letter () |
The reserved letter used to forge the "one" label (the unit, the identity). More... | |
static letter_t | get_letter (std::istream &i, bool quoted=true) |
Read one letter from i. More... | |
template<typename T = letter_t> | |
static T | special () |
Special character, used to label transitions from pre() and to post(). More... | |
Static Private Member Functions | |
static letter_t | special_letter () |
The reserved letter used to forge the labels for initial and final transitions. More... | |
Represent alphabets whose "letters" are strings.
This is useful for linguistics where sometimes letters are words ("it is beautiful" has three letters: "it" "is" and "beautiful") but also to deal with UTF-8, since graphemes then have various widths.
using vcsn::string_letters::letter_t = symbol |
using vcsn::string_letters::word_t = std::vector<letter_t> |
Add the special character first and last.
Definition at line 108 of file string.hh.
References mul(), and special_letter().
|
inlinestatic |
|
inlinestatic |
Read one letter from i.
Either a single char, or a "letter" enclosed in single-quotes.
Definition at line 199 of file string.hh.
References vcsn::get_char(), and sname().
|
inlinestatic |
|
inline |
|
inline |
Definition at line 45 of file string.hh.
References one_letter().
Referenced by delimit().
Definition at line 61 of file string.hh.
References one_letter().
Definition at line 76 of file string.hh.
References one_letter().
Definition at line 91 of file string.hh.
References is_empty_word().
|
inlinestatic |
|
inlinestatic |
Definition at line 26 of file string.hh.
Referenced by get_letter().
|
static |
Special character, used to label transitions from pre() and to post().
|
inlinestaticprivate |
The reserved letter used to forge the labels for initial and final transitions.
Use the public special() interface.
Definition at line 193 of file string.hh.
Referenced by delimit(), vcsn::string_letters::special< string_letters::letter_t >(), vcsn::string_letters::special< string_letters::word_t >(), and undelimit().
Remove first and last characters, that must be "special".
Definition at line 114 of file string.hh.
References special_letter().