filtering dictionaries by extension