diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-03-16 11:27:16 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-03-16 11:27:16 -0400 |
commit | 3aceae8ab1eb5992110ea57a9479bbc3177feb21 (patch) | |
tree | 13167a266805344efb7bb1d900486f782c23285e /progress.h | |
parent | e1be2716746e75cf6ed37e86461a7f580a964564 (diff) | |
download | furries-3aceae8ab1eb5992110ea57a9479bbc3177feb21.tar.gz furries-3aceae8ab1eb5992110ea57a9479bbc3177feb21.tar.bz2 furries-3aceae8ab1eb5992110ea57a9479bbc3177feb21.zip |
Added more inflections, word relationships, and pronunciations
Nouns, adjectives, and adverbs now have inflected forms. A large number of WordNet word relationships (all noun-noun relationships, plus synonymy and antonymy for all word types except verbs) have been added. Additionally, CMUDICT is now being used to store word pronunciations for rhyming purposes. Verbly is now also a compiled library rather than being header-only due to the complexity of the query interface.
Diffstat (limited to 'progress.h')
-rw-r--r-- | progress.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/progress.h b/progress.h new file mode 100644 index 0000000..81f07a3 --- /dev/null +++ b/progress.h | |||
@@ -0,0 +1,50 @@ | |||
1 | #ifndef PROGRESS_H_A34EF856 | ||
2 | #define PROGRESS_H_A34EF856 | ||
3 | |||
4 | #include <string> | ||
5 | |||
6 | class progress { | ||
7 | private: | ||
8 | std::string message; | ||
9 | int total; | ||
10 | int cur = 0; | ||
11 | int lprint = 0; | ||
12 | |||
13 | public: | ||
14 | progress(std::string message, int total) : message(message), total(total) | ||
15 | { | ||
16 | std::cout << message << " 0%" << std::flush; | ||
17 | } | ||
18 | |||
19 | void update(int val) | ||
20 | { | ||
21 | if (val <= total) | ||
22 | { | ||
23 | cur = val; | ||
24 | } else { | ||
25 | cur = total; | ||
26 | } | ||
27 | |||
28 | int pp = cur * 100 / total; | ||
29 | if (pp != lprint) | ||
30 | { | ||
31 | lprint = pp; | ||
32 | |||
33 | std::cout << "\b\b\b\b" << std::right; | ||
34 | std::cout.width(3); | ||
35 | std::cout << pp << "%" << std::flush; | ||
36 | } | ||
37 | } | ||
38 | |||
39 | void update() | ||
40 | { | ||
41 | update(cur+1); | ||
42 | } | ||
43 | |||
44 | ~progress() | ||
45 | { | ||
46 | std::cout << "\b\b\b\b100%" << std::endl; | ||
47 | } | ||
48 | }; | ||
49 | |||
50 | #endif /* end of include guard: PROGRESS_H_A34EF856 */ | ||