diff options
Diffstat (limited to 'ebooks.cpp')
-rw-r--r-- | ebooks.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ebooks.cpp b/ebooks.cpp index ed660a9..753ead6 100644 --- a/ebooks.cpp +++ b/ebooks.cpp | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <twitcurl.h> | 10 | #include <twitcurl.h> |
11 | #include <unistd.h> | 11 | #include <unistd.h> |
12 | #include <yaml-cpp/yaml.h> | 12 | #include <yaml-cpp/yaml.h> |
13 | #include "freevars.h" | ||
13 | 14 | ||
14 | using namespace::std; | 15 | using namespace::std; |
15 | 16 | ||
@@ -28,6 +29,11 @@ int main(int argc, char** args) | |||
28 | 29 | ||
29 | cout << "Preprocessing corpus..." << endl; | 30 | cout << "Preprocessing corpus..." << endl; |
30 | kgramstats* stats = new kgramstats(corpus, 5); | 31 | kgramstats* stats = new kgramstats(corpus, 5); |
32 | |||
33 | cout << "Preprocessing freevars..." << endl; | ||
34 | freevars* vars = new freevars(); | ||
35 | vars->addVar("name", "names.txt"); | ||
36 | vars->addVar("noun", "nouns.txt"); | ||
31 | 37 | ||
32 | cout << "Generating..." << endl; | 38 | cout << "Generating..." << endl; |
33 | for (;;) | 39 | for (;;) |
@@ -36,7 +42,7 @@ int main(int argc, char** args) | |||
36 | string hi; | 42 | string hi; |
37 | for (vector<string>::iterator it = doc.begin(); it != doc.end(); ++it) | 43 | for (vector<string>::iterator it = doc.begin(); it != doc.end(); ++it) |
38 | { | 44 | { |
39 | hi += *it + " "; | 45 | hi += vars->parse(*it) + " "; |
40 | } | 46 | } |
41 | 47 | ||
42 | hi = hi.substr(0,140); | 48 | hi = hi.substr(0,140); |