ritwik12 / Virtual-Assistant

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

complexity improvement, header guard, minor fixes #96

Closed mcavazotti closed 4 years ago

mcavazotti commented 4 years ago

Now the Virtual Assistant creates an ordered array from the words in the knowledge base. To create this array, the complexity is the same as it was before. The improvement comes at the input analysis. Instead of looking through all the known words, the program now performs a binary search.

I also increased the WORD_LEN to 15 to avoid buffer overflow (this actually happened to me), added a header guard at defines.h and reordered the classifier list to match categories_str.

mcavazotti commented 4 years ago

72

ritwik12 commented 4 years ago

@mcavazotti Approach looks good. can you please document it properly too using comments and Doc strings to help understand what is happening in the code.

ritwik12 commented 4 years ago

Also please try to use proper variable names in place of i and j in loops. I know we have used that at several places as the code was a lot immature at the beginning and now if we are improving it. It would be better to improve those things in the flow.

ritwik12 commented 4 years ago

@mcavazotti That was some good work here, I tested the code and that worked well too. Thanks a lot for your contribution here!!

mcavazotti commented 4 years ago

you're welcome

ritwik12 commented 3 years ago

@all-contributors please add @mcavazotti for code

allcontributors[bot] commented 3 years ago

@ritwik12

I've put up a pull request to add @mcavazotti! :tada: