#include <dfa_min.h>
Public Member Functions | |
void | clear () |
void | freeze () |
Get rid of the extra data used for maintaining the automaton minimality. | |
bool | insert (const basic_string< char_type > &s) |
Add a word defined by a character string. | |
template<class ForwardI > | |
bool | insert (ForwardI, ForwardI) |
Add a word defined by a range on a sequence of characters of type char_type . | |
unsigned int | size () const |
unsigned int | wc () const |
word count. |
Words can be added keeping the automaton minimal. It does not define the standard DFA interface but a restricted one that allows only word insertions and read-only operations thus enforcing the invariants for the structure integrity to be guaranteed.
Parameter | Description | Default | Requirements |
---|---|---|---|
CharTraits | Character traits describing the alphabet that the words are built with. | plain | CharTraits is a model of Alphabet and CharTraits::char_type is a POD type |
Tag | The type of the data attached to states. | empty_tag |
void clear | ( | ) |
wc() == 0
void freeze | ( | ) |
Get rid of the extra data used for maintaining the automaton minimality.
Once frozen, words can still be added but the next insertion will take more time to rebuild the necessary data structure that had been disposed of.
bool insert | ( | const basic_string< char_type > & | s | ) |
Add a word defined by a character string.
true
if the word has been actually added, false
if the word already exists and that the operation left the automaton unchanged. bool insert | ( | ForwardI | , | |
ForwardI | ||||
) |
Add a word defined by a range on a sequence of characters of type char_type
.
true
if the word has been actually added, false
if the word already exists and that the operation left the automaton unchanged. Reimplemented in DFA_min_hash.
Referenced by DFA_min< CharTraits, astl::hash_tag >::insert().
unsigned int size | ( | ) | const |
wc()
unsigned int wc | ( | ) | const |
word count.
Referenced by DFA_min_hash::insert().