README:
Yes, it is licensed under the GPL.Author: Travis Burtrum (moparisthebest)
I use no 3rd party libraries or system calls in this, only standard c++.
So if you have a c++ compiler (I use g++) then this should compile fine for you.
generic compiling:
./configure
make
compile using g++:
g++ markovchains.cpp -o markovchains
run as you would any app from the command line:
./markovchains
compile using mingw (for windows):
i586-mingw32msvc-g++ markovchains.cpp -o markovchains.exe
sample run (refer to test.txt for input):
./markovchains
commands:
'exit' exits the program
'load filename' loads all sentances in filename into the system (test.txt is provided)
any other input is loaded into the system, and a sentance is output based on the first word typed if possible
# load test.txt
name it charles barkely.
# my teachers name is john.
hello my name is bob.
# name
what is your name?
# name
my friends name is sam.
# name
my friends name is bob.
# name
hello my name is john.
# exit
Things that need done:
- Implement saving/loading mechanism
- Clean up code, try not to copy objects as much
- Make it N order
If anyone could give me some feedback on my code it would be much appreciated, I am most interested in a better way to store the Quads in memory, the way I do it know requires a lot of extra memory because the Quads I use as keys are copied because I can't store them by pointer like I want since I need to look them up by value and not by memory location. I'm sure there is a better way to handle this somewhere, thanks much.
http://www.moparisthebest.com/downloads/markovchains.tar.gz
No comments:
Post a Comment