In the LEPL1503 UCLouvain class, we had to code a C program called spellchecker which given an input file and dictionaries, can detect and can optionally correct mistakes generating binary output files
In order to achieve that, we had to program an efficient, fast and clean program capable of using multiple threads to speed up the process
Our group members - Group S1 :
- Younes - Yoouss
- Sofia - SCY-Sofia
- Maryam - MaryamAkraiche
- Adjovi - adjovimalaika2006
- Maurice - SuperMorisl
Caution
If a link is broken, please refer to the Contributors page
Please note that my GitHub contribution stats (additions and deletions) are misleading because I had to delete and re-upload heavy files (such as those in the benchmark folder)
My actual stats are much closer to those of Sofia - SCY-Sofia
- The architecture & modules
- How to run tests & Valgrind
- Benchmarks & how to use them
- The LEPL1503 instructions (in French)
Debian based users (WSL, Ubuntu, Mint, Pop_OS!, ...)
sudo apt install build-essential cmake libcunit-dev valgrindRed Hat based users (Fedora, ...)
sudo dnf install gcc gcc-c++ make cmake CUnit-devel valgrindArch based users (Arch, EndeavourOS, ...)
sudo pacman -S gcc make cmake cunit valgrindMacOS users
brew install gcc cmake cunit valgrind- Via https :
git clone https://github.com/Yoouss/b2-spellchecker.git- Or ssh :
git clone git@github.com:Yoouss/b2-spellchecker.gitmakeCompiles the program's file (spellchecker)
./spellchecker --dicts <dictionary_path> --input <input_path> [--output <output_path>] [--mode <mode>] [--threads <number>] [--verbose]Here's the specification of each arguments, the ones in brackets being optionals :
-
--dicts <dictionary_path>: Specifies the dictionaries' pathThe user can also choose a single dictionary or use
allas an argument to specify all the dictionaries from thedictsdirectory-> examples :
dicts,all,dicts/fr.dict
-
--input <input_path>: Specifies the input file's path-> example :
inputs/input_10l.txt
-
--output_path <output_path>: Specifies the output files' name, without extension-> example :
outputIf this argument isn't specified, the terminal will be used by default, the user then has 2 options :
./spellchecker ... > <output_path>
Use a chevron
>to get the binary output in the file<output_path>specified./spellchecker ... | hexdumpOr use
| hexdumpto see the binary output on the terminal
-
--mode <mode>: Specifies the program mode between :-
detection: detects errors and writes them instdoutor in a new file<output_path>.errif<output_path>is specified -
correction: detects errors, corrects them and writes them instdoutor in new files<output_path>.errfor the detection and<output_path>.fixfor the correction if<output_path>is specified
If the mode isn't specified, the
detectionmode will be used by default -
-
--threads <number>: Specifies the number of threads used-
If
<number>is smaller or equal to 1, the program will be executed in a mono-threaded way (sequentialy) -
If
<number>is greater than 1, the program will be executed in a multi-threaded way using<number>threads maximum per functions with configurable parallelism
-
--verbose: Displays more details in real time
make./spellchecker --dicts dicts --input inputs/input_50l.txt --output my_output --mode correction --threads 2This project has been a good opportunity to work together in groups despite the lack of time and motivation from some classmates (of course not those mentionned in the group members section !)
Overall it forced us to follow similar practices, to review others' code via forge (UCLouvain's Gitlab), to manage merge requests, to use tickets in order to stay focused on our own tasks and develop our programming skills