Document clustering program, in Java