static const string __SHOW_NUMBER_INVOCATION = "show numbers";
static const string __SHOW_GRID_INVOCATION = "show grid";
+static const vector<string> __SHOW_NUMBER_KOKR = {"힌트 보여줘", "숫자 힌트 보여줘", "숫자 보여줘", "숫자"};
+static const vector<string> __SHOW_LABEL_KOKR = {"힌트 메세지 보여줘", "텍스트 보여줘", "텍스트", "텍스트 힌트 보여줘"};
+static const vector<string> __SHOW_GRID_KOKR = {"그리드", "그리드 모드", "그리드로 보여줘"};
+
static const int __DEFAULT_DISPLAY_WIDTH = 1920;
static const int __DEFAULT_DISPLAY_HEIGHT = 1080;
}
}
+static bool __is_exist_in_candidates(const string &text, const vector<string> &candidates)
+{
+ for (auto &candidate : candidates) {
+ if (0 == text.compare(candidate)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
bool VoiceTouchEngine::checkVoiceTouchMode(const std::string &text)
{
_I("[VoiceTouchEngine] Input text(%s)", text.c_str());
string loweredText = StringUtil::makeLowerCase(text);
voice_touch_mode_e mode = __currentMode;
- if (0 == loweredText.compare(__SHOW_TOOLTIP_INVOCATION)) {
+ if (__is_exist_in_candidates(loweredText, __SHOW_LABEL_KOKR)) {
mode = VOICE_TOUCH_MODE_TOOLTIP_TEXT;
- } else if (0 == loweredText.compare(__SHOW_NUMBER_INVOCATION)) {
+ } else if (__is_exist_in_candidates(loweredText, __SHOW_NUMBER_KOKR)) {
mode = VOICE_TOUCH_MODE_TOOLTIP_NUMBER;
- } else if (0 == loweredText.compare(__SHOW_GRID_INVOCATION)) {
+ } else if (__is_exist_in_candidates(loweredText, __SHOW_GRID_KOKR)) {
mode = VOICE_TOUCH_MODE_GRID;
}