ritwik12 / Virtual-Assistant

A linux based Virtual assistant on Artificial Intelligence in C
GNU General Public License v3.0
128 stars 95 forks source link

Increase array size #57

Open jeyadosstimothy opened 5 years ago

jeyadosstimothy commented 5 years ago

In requests.c the class arrays are initialized with maximum word length 10, but for restaurant_class the word length is 11 for "restaurants" and 12 if '\0' is included (code below)

char *restaurant_class[10][10] = { {"Please", "find", "some", "restaurants"}, {"Find", " ", "some", "restaurants"}, {"Show", " ", " ", "restaurants"}, {"Find", "places", "to", "eat"} };

simonastefan commented 4 years ago

The problematic code from requests.c was moved to defines.h but the issue still stands. I would like to fix this. Thanks!

simonastefan commented 4 years ago

Actually, the code is ok it's just the name of defined limits that are wrong: https://github.com/ritwik12/Virtual-Assistant/blob/3905ebdc57cf5833b3898c83f1775f951b884c12/utils/defines.h#L9-L10 in https://github.com/ritwik12/Virtual-Assistant/blob/3905ebdc57cf5833b3898c83f1775f951b884c12/utils/defines.h#L44 It should be const char *classifier[LAST_FIELD][NUM_CLASS][NUM_WORDS]

This is not a functional bug but it could be misleading. Let me know if you would still want this fixed.

ritwik12 commented 4 years ago

@simonastefan Lets give it a try, I was curious about hardcoded limits while merging that PR also. Please check if your suggestion works well.