I just wrote a quick python script to extract the most common words in some tex files. It uses detex to strip tex commands from the files, strips characters like ".", ",", ";", "?", "!" from the end of words, ignores words that contain # or =, ignores case and the 100 most common english words (copied from http://www.duboislc.org/EducationWatch/First100Words.html)
#!/usr/bin/python
import subprocess, glob, operator
# Tweak output here:
charsToStripFromEnd = ".,;?!"
nonWordChars = "=#"
minOccurrence = 30
skipWords = 'the of and a to in is you that it he was for on are as with his they I at be this have from or one had by word but not what all were we when your can said there use an each which she do how their if will up other about out many then them these so some her would make like him into time has look two more write go see number no way could people my than first water been call who oil its now find long down day did get come made may part e.g i.e'.split()
output = subprocess.check_output( ['detex'] + glob.glob('*.tex') )
wordList = output.split()
words = {}
for w in wordList:
w = w.rstrip(charsToStripFromEnd).lower()
if len(w) <= 2: continue
isARealWord = True
for c in nonWordChars:
if c in w:
isARealWord = True
if not isARealWord: continue
if w in skipWords: continue
if not w in words:
words[w] = 1
else:
words[w] += 1
sorted = sorted(words.iteritems(), key=operator.itemgetter(1))
sorted.reverse()
for item in sorted:
print item[0], item[1]
if item[1] < minOccurrence: break