Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase array size #57

Open
jeyadosstimothy opened this issue Apr 16, 2019 · 3 comments
Open

Increase array size #57

jeyadosstimothy opened this issue Apr 16, 2019 · 3 comments
Assignees

Comments

@jeyadosstimothy
Copy link

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 jeyadosstimothy changed the title Increase word length Increase array size Apr 16, 2019
@simonastefan
Copy link

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

@simonastefan
Copy link

Actually, the code is ok it's just the name of defined limits that are wrong:

#define WORD_LEN 10 /* the maximal length of each word in a classifier */
#define NUM_WORDS 10 /* the number of words per catagory classifier */

in
const char *classifier[LAST_FIELD][NUM_WORDS][WORD_LEN] = {

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants