Lookup dictionary to tell if words are prefixes or words of the given dictionary.