This ANSI Common Lisp program categorizes the chapters of the book War and Peace by Leo Tolstoi into war-related and peace-related chapters.
This program was written using the SBCL Common Lisp implementation. As of this writing, SBCL 2.4.0 can compile and run this code; other Lisp implementations may also be capable of running it.
Installing SBCL on a Debian-based distribution should be as simple as issuing this command at a shell prompt:
$ sudo apt install sbcl
Other distributions may or may not package SBCL; refer to the SBCL project's getting started page for more information.
This program uses the cl-str library for string manipulation and lparallel for multithreading map operations. Unit testing uses the FiveAM testing library. Quicklisp is used for installing and loading dependencies. Detailed instructions for installing and using Quicklisp may be found on that project's homepage, but here is a quickstart guide:
$ curl -o /tmp/ql.lisp http://beta.quicklisp.org/quicklisp.lisp
$ sbcl --no-sysinit --no-userinit --load /tmp/ql.lisp \
--eval '(quicklisp-quickstart:install :path "~/.quicklisp")' \
--eval '(ql:add-to-init-file)' \
--quit
With Quicklisp installed, your environment should be ready to run this program.
The program is executed via run.sh
. The program must be run from within this directory, or it will not find the files it needs. On the first run, Quicklisp will retrieve dependencies before loading the program. Subsequent runs should use the cached dependencies. The result will be written to standard out.
Example:
$ git clone https://github.com/skyler544/war-and-peace
$ cd war-and-peace
$ ./run.sh
The tests are executed via test.sh
. This script loads the main program file but does not run it; instead, it runs the test suite and prints the results to standard out.
Example:
$ git clone https://github.com/skyler544/war-and-peace
$ cd war-and-peace
$ ./test.sh