diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-02-01 09:30:04 -0500 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-02-01 09:30:04 -0500 |
| commit | 617155fe562652c859a380d85cc5710783d79448 (patch) | |
| tree | f5eee89b0fa4b3c9dfe7187ca78916a71b59045e /freevars.h | |
| parent | b316e309559d7176af6cf0bb7dcd6dbaa83c01cd (diff) | |
| download | rawr-ebooks-617155fe562652c859a380d85cc5710783d79448.tar.gz rawr-ebooks-617155fe562652c859a380d85cc5710783d79448.tar.bz2 rawr-ebooks-617155fe562652c859a380d85cc5710783d79448.zip | |
Added emoji freevar
Strings of emojis are tokenized separately from anything else, and added to an emoticon freevar, which is mixed in with regular emoticons like :P. This breaks old-style freevars like $name$ and $noun$ so some legacy support for compatibility is left in but eventually $name$ should be made into an actual new freevar. Emoji data is from gemoji (https://github.com/github/gemoji).
Diffstat (limited to 'freevars.h')
| -rw-r--r-- | freevars.h | 21 |
1 files changed, 12 insertions, 9 deletions
| diff --git a/freevars.h b/freevars.h index c92b9f5..f800220 100644 --- a/freevars.h +++ b/freevars.h | |||
| @@ -1,19 +1,22 @@ | |||
| 1 | #include <map> | ||
| 2 | #include <string> | 1 | #include <string> |
| 3 | #include <vector> | 2 | #include <set> |
| 4 | 3 | ||
| 5 | #ifndef FREEVARS_H | 4 | #ifndef FREEVARS_H |
| 6 | #define FREEVARS_H | 5 | #define FREEVARS_H |
| 7 | 6 | ||
| 8 | class freevars | 7 | class word; |
| 8 | |||
| 9 | class freevar | ||
| 9 | { | 10 | { |
| 10 | public: | 11 | public: |
| 11 | freevars(); | 12 | freevar(word& w, std::string file); |
| 12 | void addVar(std::string name, std::string filename); | 13 | bool check(std::string f) const; |
| 13 | std::string parse(std::string in); | 14 | void add(std::string f); |
| 15 | word& getWord(); | ||
| 14 | 16 | ||
| 15 | private: | 17 | private: |
| 16 | std::map<std::string, std::vector<std::string>* >* vars; | 18 | word& w; |
| 19 | std::set<std::string> instances; | ||
| 17 | }; | 20 | }; |
| 18 | 21 | ||
| 19 | #endif \ No newline at end of file | 22 | #endif \ No newline at end of file |
