Below is the file 'tokens_test.cc' from this revision. You can also download the file.


#include <iostream>
#include "markov.hh"
#include "tokens.hh"

using namespace std;

typedef Tokens<string> s_tok;

void
string_test (s_tok &t)
{
    string s;

    t.add ("goat");
    t.add ("cheese");
    t.add ("chhhhhhhhhheeeese");
}

void
input_test (s_tok &t)
{
    string i;

    for (int c=0;c<50;c++) {
        cin >> i;
        t.add (i);
    }
}

void
test (void)
{
    s_tok t;

    string_test (t);
    input_test (t);
    t.playback ();

    MarkovModel m(t, 2);
    m.Dump();
}

int
main (int argc, char *argv[])
{
    test ();
    return 0;
}