Borisbot Chatbot
I have now finished and handed in my Chatbot final year assessment project for Programming at Reading University. Whenever I get the time I will release the source code, and executables for Windows and Linux as open source. The following is an extract from a reflection I gave on Reading's own Comptuing community, Redgloo…
I've leant alot about C++ whilst doing this project.
The main area that has signicantly improved my code during this project was in classes and objects. I have been able to manipulate them in such a way that means that I can reuse exactly the same classes later and still be completely relevant. I quickly setup a files class and object.
I quickly saw that implementing this class simplified my code significantly, and reduced my main() to only 16 lines of code.
In the end, the problem boiled down to only a few cruicial function:
1. Read()
2. Respond()
Written in C++ code as
respond( read () );
This was then encased within a do-while loop.
Before beginning the chatbot project, I had little clue about how to implement fiels in C++. But lots of coffee, skittles and visits to cplusplus.com later, I can basically do anything with them.
Half way through the problem, I soon came to realise that C++ is not the ideal language for chatbots to be written in. Unlike most modern languages, C++ is platform dependent (with larger programs anyway), has no regular expression in built functions and handles stings extremely badly.
Regular expression would have been a Godsend to this project, as they could have searched through a user's input for particular words. But i had to make do with setting up vectors of strings, and compairing two vector elements together methodically.