-
Notifications
You must be signed in to change notification settings - Fork 0
/
recognize_intent.h
52 lines (37 loc) · 1.35 KB
/
recognize_intent.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef RECOGNIZEINTENT_H
#define RECOGNIZEINTENT_H
#include <string>
#include <array>
struct Weather
{
static const uint array_size = 6;
std::array<std::string, array_size> weather{"weather", "rain", "sunny", "warm", "snow", "wet"};
std::array<std::string, array_size> city{"Copenhagen", "New York", "Stockholm", "Oslo", "Paris", "Berlin"};
std::array<std::string, 2> intent_outputs{"Get Weather", "City"};
};
struct Calendar
{
std::array<std::string, 10> calendar{
"tomorrow", "free", "time", "available", "today", "after tomorrow", "calendar", "day", "weekend", "later"};
std::array<std::string, 1> intent_outputs{"Check Calendar"};
};
struct Fact
{
std::array<std::string, 6> fact{"fact", "interesting", "bored", "something", "random", "knowledge"};
std::array<std::string, 1> intent_outputs{"Get Fact"};
};
template <class T>
std::string
concatenateStringsToOutput(const std::string& output_prefix, const uint type_match_count, const T& type_structure)
{
std::string output = output_prefix;
for (size_t i = 0; i < type_match_count; i++)
{
output += type_structure.intent_outputs[i] + " ";
}
output.pop_back();
return output;
};
bool isSpecialCharacter(const char c);
std::string recognizeIntent(std::string input_line, const bool debug_print = false);
#endif /* RECOGNIZEINTENT_H */