This repository is part of my Bachelor thesis Judy.
It contains 2 different programs.
The first one is called compare, which compares Judy data structure and Trie data structure based on hyphenating words with hyphenation patterns.
And second on called the hyphenator, which loads hyphenation patterns and then hyphenates words from the file or terminal input. Multiple words can be hyphenated on one line, but the characters . and - should be avoided for correct patterns usage.
Needed prerequisites
- make
- gcc
- Judy library - download from here
- Cprops library - download from here
- Valgrind
- time command - If the
timecommand is installed in a path other than/usr/bin/time, it needs to be manually updated in the Makefile.
Then run make
make run-teststo run all testmake time-testto run only time complexity testingmake memory-testto run only space complexity testingmake hyphenatorcreate a hyphenator program and run the example
- The first argument must be options
-lxwhere x can be an arbitrary number higher than 0, it setsleft_hyphen_minfor hyphenating process-rxwhere x can be an arbitrary number higher than 0, it setsright_hyphen_minfor hyphenating process-f file_pathoption specifies a file with words to be hyphenated, if not specified, words from the terminal will be hyphenated
- After the arguments must be a file with only patterns
- Example of usage for hyphenation from file
./bin/hyphenator -l2 -r2 -f assets/thai_words.dic assets/thai_patterns.texor from terminal./bin/hyphenator -l2 -r2 assets/thai_patterns.tex - When hyphenating from the terminal, some commands can be used to change the hyphenation process
:qEnds the hyphenator program:lxSets theleft_hyphen_minto numberx:rxSets theright_hyphen_minto numberx