Checking if a sentence is English after decryption I wrote a program that will loop through the anagrams of a word and run each one through the decryption of a columnar transposition cipher on a document. However, for a certain word, the number of anagrams was 7! (5040) meaning I could not check each output individually.

I experimented with Google's python langdetect module and I had a look into ngrams, but it seems that the nature of the cipher causes any variation to appear English.

Would there be any other way to check the output document to check its 'English rating'? What about a combination of I.C. and ngrams?

Thanks in advance!
Try tokenizing the plaintext using an English dictionary. Give higher scores to bigger words to prevent your analyzer from favoring a bunch of one to two letter words. Total the score up and take the highest.

I'm not trying to plug, but there's an (badly written) example in this repo:
https://github.com/wildcardcorp/samson

Here's the code for the analyzer itself:
https://github.com/wildcardcorp/samson/blob/master/samson/analyzers/english_analyzer.py

Example of usage:

&gt;&gt;&gt; from samson.analyzers.english_analyzer import EnglishAnalyzer
&gt;&gt;&gt; message = bytearray(b'stopcollaborateandlisten')
&gt;&gt;&gt; analyzer = EnglishAnalyzer()
&gt;&gt;&gt; analyzer.analyze(message)
105605.2045585186
&gt;&gt;&gt; import random
&gt;&gt;&gt; random.shuffle(message)
&gt;&gt;&gt; message
bytearray(b'nisoabtpenaltdlecoslrato')
&gt;&gt;&gt; analyzer.analyze(message)
22361.397837608132