Skip to content

Deduplicate NLTK resource download checks #47

Description

@shimpeiws

Summary

ensure_nltk_resources() is called from multiple locations across processor.py and filters.py. Although it is centralized in nltk_resources.py, each call triggers NLTK's internal check, adding unnecessary overhead.

Proposed Approach

  • Call ensure_nltk_resources() once at application startup (e.g., in cli.py before analysis begins)
  • Alternatively, add a module-level flag in nltk_resources.py so it only executes on the first invocation
  • Remove scattered calls from processor.py and filters.py

Affected Files

  • src/barscan/analyzer/nltk_resources.py
  • src/barscan/analyzer/processor.py
  • src/barscan/analyzer/filters.py

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions