about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorFeffernoose <fefferburbia@gmail.com>2013-10-06 15:06:03 -0400
committerFeffernoose <fefferburbia@gmail.com>2013-10-06 15:06:03 -0400
commit3d995835426312809aa7a5a4403ef3984339be0f (patch)
tree34b7a02c8b17b24f2b40f81c97b7007cb69b20ff
parent8e2693ebb6670f8b8c66f5818be87140467ed5f3 (diff)
parent9f095cd071efa059449e4694f4fc3da22ca9e456 (diff)
downloadrawr-ebooks-3d995835426312809aa7a5a4403ef3984339be0f.tar.gz
rawr-ebooks-3d995835426312809aa7a5a4403ef3984339be0f.tar.bz2
rawr-ebooks-3d995835426312809aa7a5a4403ef3984339be0f.zip
Merge branch 'master' of https://github.com/hatkirby/rawr-ebooks
-rw-r--r--main.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/main.cpp b/main.cpp index 8310bf4..20f1a1f 100644 --- a/main.cpp +++ b/main.cpp
@@ -17,19 +17,19 @@ int main(int argc, char** args)
17{ 17{
18 srand(time(NULL)); 18 srand(time(NULL));
19 19
20 YAML::Node config = YAML::LoadFile("config.yml"); 20 YAML::Node config = YAML::LoadFile("config.yml");
21 21 ifstream infile(config["corpus"].as<std::string>().c_str());
22 for (;;) 22 string corpus;
23 string line;
24 while (getline(infile, line))
23 { 25 {
24 ifstream infile(config["corpus"].as<std::string>().c_str()); 26 corpus += " " + line;
25 string corpus; 27 }
26 string line; 28
27 while (getline(infile, line)) 29 kgramstats* stats = new kgramstats(corpus, 5);
28 {
29 corpus += " " + line;
30 }
31 30
32 kgramstats* stats = new kgramstats(corpus, 5); 31 for (;;)
32 {
33 vector<string> doc = stats->randomSentence(rand() % 25 + 5); 33 vector<string> doc = stats->randomSentence(rand() % 25 + 5);
34 string hi; 34 string hi;
35 for (vector<string>::iterator it = doc.begin(); it != doc.end(); ++it) 35 for (vector<string>::iterator it = doc.begin(); it != doc.end(); ++it)