Skip to content

fix: close input file in count_word_frequencies#617

Open
Chessing234 wants to merge 1 commit into
allenai:mainfrom
Chessing234:fix/count-word-frequencies-file-handle
Open

fix: close input file in count_word_frequencies#617
Chessing234 wants to merge 1 commit into
allenai:mainfrom
Chessing234:fix/count-word-frequencies-file-handle

Conversation

@Chessing234

Copy link
Copy Markdown

Summary

  • count_frequencies left the corpus input file open after reading.
  • Use a context manager so the file is closed when processing finishes.

Test plan

  • Run count_word_frequencies.py on a small input file

Made with Cursor

Use a context manager when reading the input corpus file.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant