diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-05-20 23:14:06 -0400 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-05-20 23:15:10 -0400 |
| commit | 8c3022e759191e90b5e12bcb6b0b5a6a48b37840 (patch) | |
| tree | 0d9a8a12616d6ea335fdc687049b05f679e8ccc6 /freevars.cpp | |
| parent | a9c391efd5f0f73b5374dcfd807cdf59ed663e6b (diff) | |
| download | rawr-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.cpp | 32 |
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 | |||
| 5 | freevar::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 | |||
| 19 | bool freevar::check(std::string f) const | ||
| 20 | { | ||
| 21 | return (instances.count(f) == 1); | ||
| 22 | } | ||
| 23 | |||
| 24 | void freevar::add(std::string f) | ||
| 25 | { | ||
| 26 | instances.insert(f); | ||
| 27 | } | ||
| 28 | |||
| 29 | word& freevar::getWord() | ||
| 30 | { | ||
| 31 | return w; | ||
| 32 | } | ||
