method to get the next term from a dictionary file