def getFilteredLexicon(lexicondict, allwords):
    """ Returns a lexicon with just the necessary words.
    Assumes all wanted keys exist in the given lexicon """
    return { word: lexicondict[word] for word in allwords }