Finding the neighborhood of a query in a dictionary | Synapse