5 #ifndef BPP_SEQ_ALPHABET_LETTERALPHABET_H
6 #define BPP_SEQ_ALPHABET_LETTERALPHABET_H
63 throw BadCharException(state,
"LetterAlphabet::charToInt: Unknown state",
this);
64 return letters_[
static_cast<unsigned int>(state[0])];
A partial implementation of the Alphabet interface.
AbstractAlphabet & operator=(const AbstractAlphabet &alph)
virtual void setState(size_t pos, AlphabetState *st)
Set a state in the Alphabet.
virtual void registerState(AlphabetState *st)
Add a state to the Alphabet.
This is the base class to describe states in an Alphabet.
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.
Specialized partial implementation of Alphabet using single letters.
void registerState(AlphabetState *st)
Add a state to the Alphabet.
LetterAlphabet & operator=(const LetterAlphabet &bia)
static const int LETTER_UNDEF_VALUE
std::vector< int > letters_
bool isCharInAlphabet(const std::string &state) const
Tell if a state (specified by its string description) is allowed by the the alphabet.
void setState(size_t pos, AlphabetState *st)
Set a state in the Alphabet.
virtual ~LetterAlphabet()
bool isCharInAlphabet(char state) const
LetterAlphabet(bool caseSensitive=false)
virtual LetterAlphabet * clone() const =0
LetterAlphabet(const LetterAlphabet &bia)
int charToInt(const std::string &state) const
Give the int description of a state given its string description.
This alphabet is used to deal NumericAlphabet.