From ec1d49da924a69dcaaac8fceb64a34fcd3f9f1e0 Mon Sep 17 00:00:00 2001 From: Eric Kafe Date: Thu, 4 Nov 2021 14:05:28 +0100 Subject: [PATCH] Rewind Wordnet data file after each lookup (#2868) --- 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")