Virtual-Assistant icon indicating copy to clipboard operation
Virtual-Assistant copied to clipboard

Increase array size

Open jeyadosstimothy opened this issue 5 years ago • 3 comments

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"} };

jeyadosstimothy avatar Apr 16 '19 09:04 jeyadosstimothy

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

simonastefan avatar Oct 16 '19 19:10 simonastefan

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.

simonastefan avatar Oct 16 '19 21:10 simonastefan

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

ritwik12 avatar Oct 17 '19 07:10 ritwik12