_I("[CommandFinder] Initiate command searcher. text(%s)", text.c_str());
__loweredText = StringUtil::makeLowerCase(text);
- __splitedText = StringUtil::splitText(__loweredText, ' ');
+ __splitText = StringUtil::splitText(__loweredText, ' ');
__isLabel = true;
}
string label = StringUtil::makeLowerCase(command->getLabel());
bool isValid = true;
- for (auto& word : __splitedText) {
+ for (auto& word : __splitText) {
if (label.find(word) == string::npos) {
isValid = false;
break;
{
_I("[CommandFinder] Find command by word");
- int maxNumber = __splitedText.size() * __WORD_MATCHING_RATE;
+ int maxNumber = __splitText.size() * __WORD_MATCHING_RATE;
Command* result = nullptr;
for (auto command : __commands) {
string label = StringUtil::makeLowerCase(command->getLabel());
int numOfWord = 0;
- for (auto& word : __splitedText) {
+ for (auto& word : __splitText) {
if (label.find(word) != string::npos) {
numOfWord++;
}
for (auto command : __commands) {
string label = StringUtil::makeLowerCase(command->getLabel());
- vector<string> splitedLabel = StringUtil::splitText(label, ' ');
+ vector<string> splitLabel = StringUtil::splitText(label, ' ');
int score = 0;
- for (auto& word : __splitedText) {
+ for (auto& word : __splitText) {
if (word.size() < 3) {
continue;
}
// This is for calculating Levenshtein distance as similarity matric.
const int __MIN_THRESHOLD = word.size() * __CHAR_MATCHING_RATE;
int minScore = __MIN_THRESHOLD;
- for (auto& labelWord : splitedLabel) {
+ for (auto& labelWord : splitLabel) {
if (labelWord.size() < 3) {
continue;
}
}
int threshold = 0;
- for (auto& word : __splitedText) {
+ for (auto& word : __splitText) {
if (3 <= word.size()) {
threshold += word.size();
}