That's called semantic analysis of a text. The easiest way is to define set of words that are common for a specific document category. Than you make statistics for that document over the word classes. And you elect the best matching group.
If you need more deeply analysis, you have to make use of a thesaurus (a semantic graph of a language). For English you can use this one:
http://wordnet.princeton.edu/[
^], but it is not common to all cultures to have such thesaurus already made :(
If yo have to go even deeper, you will have to do research. Start here:
http://www.sersc.org/journals/IJSIP/vol1_no1/papers/07.pdf[
^],
http://en.wikipedia.org/wiki/Document_classification[
^]