Okay, a bit more context: Given is a string that SHOULD contain a sentence of a language (around 2 - 50 characters, english in most cases, the language is known and precomputed information like "list of forbidden character pairs" is available). The task is to find out whether it is likely that someone did not enter something meaningfull, but just randomly. Analyzing grammer or content is not necessary, the algorithm should be light and fast. I thought about using a dictionary, but I figured that will increase the physical size of the algorithm quite much (especially if many languages are supported). However, I think using a dictionary only for short words might be a good idea.