This is the starter template for the labs of the Programming Styles course at USI.
Note that all labs where you need to implement the term frequency task use this exact same starter template.
You can test that your program produces the correct output by running our simple testing infrastructure.
You can run the test.sh script with bash.
You need to specify the target program and the input size.
As an example, this command uses a small input for a JavaScript implementation.
./test.sh term_frequency.js smallThe test scripts looks at the extension of the given program file to determine the interpreter that is going to be used to execute it:
.hs: Haskell file (interpreted byghci).java: Java file (interpreted byjava).js: JavaScript file (interpreted bynode)
The script executes your program and checks its output. If the output produced by your program does not correspond to the expected output, you will be shown a side-by-side diff where on the left you have the expected output and on the right the actual output produced by your code.
To see all the options in detail, run ./test.sh -h.