about summary refs log tree commit diff stats
path: root/freevars.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2016-05-20 23:14:06 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2016-05-20 23:15:10 -0400
commit8c3022e759191e90b5e12bcb6b0b5a6a48b37840 (patch)
tree0d9a8a12616d6ea335fdc687049b05f679e8ccc6 /freevars.cpp
parenta9c391efd5f0f73b5374dcfd807cdf59ed663e6b (diff)
downloadrawr-ebooks-8c3022e759191e90b5e12bcb6b0b5a6a48b37840.tar.gz
rawr-ebooks-8c3022e759191e90b5e12bcb6b0b5a6a48b37840.tar.bz2
rawr-ebooks-8c3022e759191e90b5e12bcb6b0b5a6a48b37840.zip
Pulled the ebooks functionality out into a library
Diffstat (limited to 'freevars.cpp')
-rw-r--r--freevars.cpp32
1 files changed, 0 insertions, 32 deletions
diff --git a/freevars.cpp b/freevars.cpp deleted file mode 100644 index 4429d00..0000000 --- a/freevars.cpp +++ /dev/null
@@ -1,32 +0,0 @@
1#include "freevars.h"
2#include <fstream>
3#include "kgramstats.h"
4
5freevar::freevar(word& w, std::string file) : w(w)
6{
7 std::ifstream infile(file);
8 if (infile)
9 {
10 std::string line;
11 while (getline(infile, line))
12 {
13 instances.insert(line);
14 w.forms.add(line);
15 }
16 }
17}
18
19bool freevar::check(std::string f) const
20{
21 return (instances.count(f) == 1);
22}
23
24void freevar::add(std::string f)
25{
26 instances.insert(f);
27}
28
29word& freevar::getWord()
30{
31 return w;
32}