Checks if the entered search term is a valid key in the HashMap of words