Skip to content

Instantly share code, notes, and snippets.

@Michaelliv
Last active September 15, 2020 20:15
Show Gist options
  • Select an option

  • Save Michaelliv/aa02a9f7ffd0d9a9c88719ed9c5743ae to your computer and use it in GitHub Desktop.

Select an option

Save Michaelliv/aa02a9f7ffd0d9a9c88719ed9c5743ae to your computer and use it in GitHub Desktop.
def count_terms_line_by_line():
total_count: Counter = Counter()
for line in open(DATA_PATH, encoding="utf8"):
line_count = line.lower().split(' ')
total_count += Counter(line_count)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment