From e6b79fa17569e25758509bbd7b6b090a7a69ed9b Mon Sep 17 00:00:00 2001 From: Eric Kafe Date: Wed, 27 Oct 2021 12:36:27 +0200 Subject: [PATCH] Rewind Wordnet data file after each lookup --- nltk/corpus/reader/wordnet.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nltk/corpus/reader/wordnet.py b/nltk/corpus/reader/wordnet.py index fda24a4360..3b49d8223a 100644 --- a/nltk/corpus/reader/wordnet.py +++ b/nltk/corpus/reader/wordnet.py @@ -1423,6 +1423,7 @@ def synset_from_pos_and_offset(self, pos, offset): raise WordNetError( f"No WordNet synset found for pos={pos} at offset={offset}." ) + data_file.seek(0) return synset @deprecated("Use public method synset_from_pos_and_offset() instead")