For a plain-text thesaurus, the Gutenberg Roget's is available, but in a pretty nasty format :) Check out
which is a very comprehensive hierachical thesaurus / dictionary system. A couple more modules have appeared recently too -
- I haven't tried them out myself, but one of these is sure to fit your needs.
Cheers, Ben.