In this recipe, we will load a text file, extract the words from it, and then determine the number of times each of these words appears in the text.
The output will be written into a new file named
word_frequency.txt, where the words found in the text will be sorted and followed by an integer indicating their frequency in the text.
We will create a new Mix project and escriptize it, allowing us to run it as a command-line application:
> mix new word_frequency
escriptoption to the
mix.exsfile, indicating where the main function is located; in this case, it will be in the
def project do [app: :word_frequency, version: "0.0.1", elixir: "~> ...