19 nocaseAlphabet_(nocaseAlphabet)
22 for (
size_t i = 0; i < chars.size(); ++i)
26 char c = *chars[i].c_str();
40 throw BadIntException(state,
"CaseMaskedAlphabet::getMaskedEquivalentState. Unsupported state code.",
this);
47 throw BadIntException(state,
"CaseMaskedAlphabet::getMaskedEquivalentState. State has masked equivalent.",
this);
55 throw BadCharException(state,
"CaseMaskedAlphabet::getMaskedEquivalentState. Unsupported state code.",
this);
63 throw BadIntException(code,
"CaseMaskedAlphabet::getMaskedEquivalentState. State has masked equivalent.",
this);
std::string intToChar(int state) const
Give the string description of a state given its int description.
bool isIntInAlphabet(int state) const
Tell if a state (specified by its int description) is allowed by the the alphabet.
This is the base class to describe states in an Alphabet.
const std::string & getName() const
Get the name of the state.
const std::string & getLetter() const
Get the letter(s) corresponding to the state.
int getNum() const
Get the state's number.
An alphabet exception thrown when trying to specify a bad char to the alphabet.
An alphabet exception thrown when trying to specify a bad int to the alphabet.
std::shared_ptr< const LetterAlphabet > nocaseAlphabet_
int getMaskedEquivalentState(int state) const
Get the masked state equivalent to the input one.
CaseMaskedAlphabet(std::shared_ptr< const LetterAlphabet > nocaseAlphabet)
Specialized partial implementation of Alphabet using single letters.
void registerState(AlphabetState *st)
Add a state to the Alphabet.
bool isCharInAlphabet(char state) const
int charToInt(const std::string &state) const
Give the int description of a state given its string description.
std::string toLower(const std::string &s)
This alphabet is used to deal NumericAlphabet.