Skip to content

Instantly share code, notes, and snippets.

View vlecam's full-sized avatar

Valentin Le Cam vlecam

View GitHub Profile

Write a module that takes a file path as argument and returns a map with word counts.

  • The module name is up to you
  • Additional modules can be implemented as needed
  • The file will always be a text file
  • The counting logic should be case insensitive
  • Other than the apostrophe in a contraction all forms of punctuation are ignored
  • The words can be separated by any form of whitespace (ie "\t", "\n", " ")
  • A word is:
  • A number composed of one or more ASCII digits (ie "0" or "1234") OR