in reply to how to guess the kind of spoken or programming language a text is written in
That is actually a very interesting problem, and it might serve you well to experiment. I suppose it would work best with highly structured languages, but then again this would be easily defeated with the likes of Perl - unless of course you train it with *enough* codes of sufficient kwalitee.