In fact, just for giggles, since the function mode is actually arbitrarily powerful, you could do this:
Code:
from calibre.gui2.tweak_book import dictionaries
def replace(match, context):
word = match.group()
if not dictionaries.recognized(word):
word = word.upper()
return word
Which even gets rid of the need to define your own list of common words, it will use the dictionary for whatever language is specified in the books opf file (provided of course you have installed such a dictionary).