summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'SwifTools')
-rw-r--r--SwifTools/EmojiMapper.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/SwifTools/EmojiMapper.cpp b/SwifTools/EmojiMapper.cpp
index 74b3537..4381cf0 100644
--- a/SwifTools/EmojiMapper.cpp
+++ b/SwifTools/EmojiMapper.cpp
@@ -6,6 +6,7 @@
#include <SwifTools/EmojiMapper.h>
+#include <algorithm>
#include <string>
#include <unordered_map>
@@ -27,9 +28,21 @@ namespace Swift {
std::vector<std::string> EmojiMapper::getCategories() {
- std::vector<std::string> categories;
+ std::vector<std::string> categories = {
+ "people",
+ "nature",
+ "food",
+ "activity",
+ "travel",
+ "objects",
+ "symbols",
+ "flags"
+ };
+
for (const auto& keyValuePair : emojisInCategory) {
- categories.push_back(keyValuePair.first);
+ if (std::find(std::begin(categories), std::end(categories), keyValuePair.first) == std::end(categories)) {
+ categories.push_back(keyValuePair.first);
+ }
}
return categories;
}