Add utility function to match classes in dictionary.